4 ms·
This is a good start. Could be made a bit more minimal. I'll throw my base Makefile into the fray [0]. It supports cross compilation, CFLAGS & LDFLAGS usage,
by oso2k 10y ago
This is a good start. Could be made a bit more minimal.
I'll throw my base Makefile into the fray [0].
It supports cross compilation, CFLAGS & LDFLAGS usage, dependency file generation, source file autodetection (add the file to right folder and it's automatically included in the build), library building (`make lib`), Continuous Integration (`make start_ci/stop_ci`), Continuous Testing (`make start_ct/stop_ct`), Continuous Deployment (`make start_cd/stop_cd`), Installation (`make install`), Uninstallation (`make uninstall`), parallel compilation (`make -j4`), there's some build machine detecting/autoconfiguration support, build artifact generation, and even some git shortcuts (`make gstat/make make gpush`).
All in about 190 lines of Makefile (including some comments, and lots of blank space lines). It does depend on GNU watch if you use any of the `start_/stop_` targets. I'm about to add self-documentation to it as well.
For more minimal, comprehensible approaches, see the work of the suckless people [1][2][3].
[0] https://github.com/lpsantil/NewProj https://github.com/lpsantil/NewProj
[1] http://git.suckless.org/dwm/tree/Makefile http://git.suckless.org/dwm/tree/Makefile
[2] http://git.suckless.org/sbase/tree/Makefile http://git.suckless.org/sbase/tree/Makefile
[3] http://git.suckless.org/ii/tree/Makefile http://git.suckless.org/ii/tree/Makefile
- posterboy 10y ago> a bit more minimal ie. smaller, which is ironically smaller than the quote edit: compared to 'gcc $CFLAGS $LDFLAGs <...> *.c' it's all rather bloated