I was looking at some source that came across the net some time ago and
ran across a very strange construct in the makefile. It appears that this
makefile is targeted for a SYSV system and I am familiar only with 4.2BSD
make.
This is the weirdness:
target: file1.o file2.o file3.o file4.o
$(CC) $(CFLAGS) $(?:.o=.c)
Any suggestions? I'm hacking on the 4.3BSD make and wouldn't mind putting
this in, if it does what I think it does.
My interpretation says:
This:
$(CC) $(CFLAGS) $(?:.o=.c)
becomes this:
$(CC) $(CFLAGS) file1.c file2.c file3.c file4.c
If my interpretation is correct, then exactly what does $(?:.o=.c) mean?
Does the colon signify merely a modifier for the $? macro? Or is it some
perversion of the standard colon dependency? And is the equals sign a
special instance of the regular macro definition construct? Or does it just
specify a transform of all elements in $? that terminate in .o?
As an aside, can someone enumerate some of the differences between the 4.3BSD
make and the Fourth Generation Make (or whatever they call it) from AT&T?
Any informed answers are gratefully anticipated.
--
Chris Grevstad
hplabs!sdcrdcf!psivax!nrcvax!chris
ihnp4!nrcvax!chris
Refund? REFUND!? ..... REFUND!?!?!