Preprocessor dependencies in MAKE
Seth M Fuller
smfst2 at unix.cis.pitt.edu
Mon Jun 17 23:49:32 AEST 1991
In article <2331 at prodigal.dwrsun2.UUCP> perl at dwrsun2.UUCP (Robert Perlberg) writes:
> .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".
>
>I don't want to remove the `.c' file after compiling since it's needed
>if I want to debug the program with dbx. How do I do this?
The problem is that you have eliminate make's knowledge of how to create
a .o file from a .c file. You do this with the .SUFFIXES statement before
your rules statement. The empty .SUFFIXES statement eliminates make's
knowledge of all the suffixes it usually knows. I use the following for
4GL code and it works fine.
.SUFFIXES:
.SUFFIXES: .4gl .per .frm .c .o
If you have any purely C files you want to make in this directory you
will have to create a .c.o rule after your .sc.o rule.
Seth M. Fuller
More information about the Comp.unix.questions
mailing list