3 ms·
Not exactly creative but KISS. I use only Makefile for a C project that compiles on both Linux, BSD and Mac OS. Point being that autoconf is often overkill for
by INTPenis 9y ago
Not exactly creative but KISS. I use only Makefile for a C project that compiles on both Linux, BSD and Mac OS.
Point being that autoconf is often overkill for smaller C projects.
- dvfjsdhgfv 9y ago...unless you want to support more platforms and discover missing dependencies you never heard of before.
- vortico 9y agoHave you made a cross-build system that compiles to all three on a single machine, or that works when run on each of the three? I've been working on a system based on gcc, MinGW64, and osxcross, but if that fails I'll use docker with crossbuild.
- analogwzrd 9y agoI'm taking a grad school embedded systems class where we have to maintain a makefile that cross compiles to two different embedded platforms as well as compiles on the host machine. We're doing it by calling a PLATFORM and using an IF statement in the makefile: make PLATFORM=HOST for example. The makefile then replaces the compiler variable, compiler flags, linker, flags, etc.
- gkya 9y agoLinux's makefile is fairly easy to read, and has a very smart way of doing cross platform builds w/ gcc.
- xoroshiro 9y agoThe Stockfish Makefile is probably the best example of this I've seen. It also does some advanced stuff I'm not sure I understand yet. Profiling, setting flags for CPU instructions and making profile builds, all with support for different C++ compilers. Pretty neat stuff from one of the best chess engines. https://github.com/official-stockfish/Stockfish/blob/master/src/Makefile https://github.com/official-stockfish/Stockfish/blob/master/...