On Tue, 2011-11-29 at 11:21 +0530, Ajay Jain wrote: > I have an elaborate recursive make system and I want an easy way to have > the name of the source file handy. To this end, I can use > > .o : %.c > $Q$(CC) -D BASENAME_FILE="$(shell basename $<)" $(CFLAGS) -c $< -o $@ > > However, this is probably not very neat as I want all variables to reflect > in CFLAGS. > > I am more comfortable in using something like .. > CFLAGS += -D BASENAME_FILE="$$(notdir $$<)" > > in my top level Makefile and hope that this will be enough in my > multi-layer build system. However, this does not work. Can somebody help me > on this?
Using escaped dollar signs in the CFLAGS settings won't work at all. Why not just use 'CFLAGS += -D BASENAME_FILE="$(notdir $<)"' ? -- ------------------------------------------------------------------------------- Paul D. Smith <[email protected]> Find some GNU make tips at: http://www.gnu.org http://make.mad-scientist.net "Please remain calm...I may be mad, but I am a professional." --Mad Scientist _______________________________________________ Help-make mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-make
