feeding CFLAGS to sub-makes

Robert_Toxen at harvard.HARVARD.EDU Robert_Toxen at harvard.HARVARD.EDU
Thu Jan 8 05:07:30 AEST 1987


> Subject: Summary of answers:  feeding CFLAGS of "make CFLAGS=-g" to sub-makes
> 
> Thanks to everyone who replied to my question about how to ensure that
> "arguments" such as "CFLAGS=-g" in a command line such as
> 
> 	make CFLAGS=-g whatever ...
> 
> get fed to recursively-invoked makes.
> --
> 	UUCP: ..decvax!seismo!elsie!ado   ARPA: elsie!ado at seismo.ARPA

In each makefile when you invoke subservient makes instead of:

	foo: $(FRC)
		make foo

do:

	foo: $(FRC)
		make CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' foo

This can be used to reliably import other make variables.  FYI:
FRC means Force ReCompilation.

Bob Toxen
Stratus Computer, Marlboro, Mass.
{ucbvax!ihnp4}!anvil!bob        (Please use THIS address to reply.)
"unix is a subset of inextinguishable" (Concept stolen from Roy Smith.)



More information about the Comp.unix.questions mailing list