Preprocessor dependencies in MAKE
Conor P. Cahill
cpcahil at virtech.uucp
Sun Jun 16 01:58:56 AEST 1991
perl at dwrsun2.UUCP (Robert Perlberg) writes:
>which is made up of many `.sc' files, I would like to create a Make
>rule that will understand this general dependency so I don't have to
>create an explicit dependency for each file. I have tried the
>following:
> .SUFFIXES: .sc
> runme: runme.o
> $(CC) $(CFLAGS) -o $@ runme.o -lingres -lm
> .sc.o:
> esqlc $*.sc
> $(CC) $(CFLAGS) -c $*.c
>it works the first time, but then if I modify runme.sc and run make it
>says "`runme' is up to date".
The problem is that the .c.o rule is taking precedence. So what you need
to do is the following:
.SUFFIXES:
.SUFFIXES: .o .sc .c .c~ .....
The first line clears the suffixes list. The second line will cause
your .sc.o rule to be applied (assuming it fits) before the .c.o rule
would be applied. Note that you sould ensure that you don't leave off
any of the predefined suffixes on the second line or else they
won't be usable.
You can see what the default list of suffixes is by entering:
make -fp - 2>/dev/null < /dev/null | grep SUFFIX
Have fun.
--
Conor P. Cahill (703)430-9247 Virtual Technologies, Inc.
uunet!virtech!cpcahil 46030 Manekin Plaza, Suite 160
Sterling, VA 22170
More information about the Comp.unix.questions
mailing list