9 ms·
I don't know, Make is difficult because we are used to think in procedures and not in rules; and the rule and macro syntax is a bit weird; it takes time to mast
by MichaelMoser123 11y ago
I don't know, Make is difficult because we are used to think in procedures and not in rules; and the rule and macro syntax is a bit weird; it takes time to master it.
i have a makefile/make system that uses gnu make macros;
(here http://mosermichael.github.io/cstuff/all/projects/2011/06/17.. http://mosermichael.github.io/cstuff/all/projects/2011/06/17.... )
this saves you from repeating the same make constructs many times over, in the following example you do a static library and executable.
1: TOPDIR=../..
2:
3: # - declare build targets. (built with make)
4: TARGETS:=shlib slibuser
5:
6: # - slib target is a static library -
7: shlib_TYPE=lib
8: shlib_SRC=slib.c
9:
10:
11: # - slibuser target is a executable using slib -
12: slibuser_TYPE=exe
13: slibuser_SRC=slibuser.c slibuser2.c slibuser3.c
14: slibuser_LIBS=shlib
15:
16: include $(TOPDIR)/rules.make
At a previous job they had an even more convoluted make system - it was simulating macros: the makefile was including another generic make file; this included make file was writing hidden files that contained the make rules ; then as the last step these generated files were included.
- J_Darnley 11y agoYour link is wrong and returns 404. Even https://mosermichael.github.io/ https://mosermichael.github.io/ returns 404. Can you prove the correct link?
- MichaelMoser123 11y agoThanks here is the correct link (can no longer edit the parent post). http://mosermichael.github.io/cstuff/ http://mosermichael.github.io/cstuff/ http://mosermichael.github.io/cstuff/all/projects/2011/06/17/make-system.html http://mosermichael.github.io/cstuff/all/projects/2011/06/17...
- J_Darnley 11y agotyvm