Chris Quenelle <Chris.Quenelle at sun.com> wrote: > Joerg Schilling wrote: > > 2) POSIX defines a way to forward command line macro=name > > macro definitions to sub-make programs (make programs > > called by the current make program) since at least 10 > > years. > > > > GNU Make implements this feature since about 15 years and > > smake implements this feature since 10 years. > > > > When whill Sun make implement this feature? > > > > Most reasons to patch makefiles from OSS packages will go > > away in case that command line macro=name definitions > > are forwarded to sub-makes. You just need to overwrite the > > values from the top level ake command line. > > I'm not familiar with this feature. I'm also not familiar with > feature of GNU make. I use a mechanism like this > to achieve the same result in Sun make Makefiles. > > > In my Makefiles I do this: > > ENVPARMS=\ > CC=$(CC) \ > LINT=$(LINT) \ > ... > > targ: > $(MAKE) $(ENVPARMS) ...
This is a bad hack as it only works for known macros that always have a predefined value != "". The POSIX standard describes how to do it, you don't neet to look into the unreadable GNU make source ;-) You append " -- " to MAKEFLAGS from within the make C code. You append a cleanly correct escaped macro=name list to this and you need to parse this list with the right precedence in the sub make. You may check the smake source for more help.... smake -f /dev/null -r -p FOO=123 'BAR=1 2 3 \se' XX=qq |grep MAKEF MAKEFLAGS = -pr -- FOO=123 BAR=1\ 2\ 3\ \\se XX=qq J?rg -- EMail:joerg at schily.isdn.cs.tu-berlin.de (home) J?rg Schilling D-13353 Berlin js at cs.tu-berlin.de (uni) joerg.schilling at fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily