NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Portable Makefile ideas



Op zo feb 10 2019, om 18:40 schreef Sad Clouds:
> So the idea is to keep it small and simple, i.e. a few variable, some
> simple if/else logic and "Bob's your Uncle".

make is good as a build tool, not so much as a portable configuration
tool. Hence, when using make, I'd suggest keeping the makefile free of
configuration and platform knowledge. Instead, use variables that can be
overriden by the user or a configuration system like the conventional
CC, CFLAGS etc and possibly CFLAGS_SOMELIB or such for more granular
control. This is what the suckless people do. Please don't do things
like invoking uname, it's a surefire way to break cross compilation.

If you want to do configuration - automatic detection of things about
the environment - use something like autotools or CMake, they're meant
for that job.

Sijmen


Home | Main Index | Thread Index | Old Index