make SUFFIXES question.....

andre andre at targon.UUCP
Tue Aug 14 20:57:04 AEST 1990


In article <8212 at ncar.ucar.edu> morreale at bierstadt.scd.ucar.edu (Peter Morreale) writes:
 >Consider the following makefile:
 >
 >.pp.o:
 >       cp $*.pp $*.f
 >
 >.SUFFIXES:  $(SUFFIXES) .pp
 >FILES= f1.o
 >
 >compile: $(FILES)
 >       @echo "Why isn't .f.o  applied?"
 >
 >clean:
 >       -rm -f $(FILES)  *.f

 >You'll notice that the ".pp.o" rule is executed, and then the
 >compile rule.  The question is:  Why isn't the default ".f.o" rule
 >executed before the "compile" target?  (If you type make again, the
 >".f.o" rule is executed and all is well....)

This is because you told make how to make a .o file from a .pp file.
after the commands involved are executed, make goes on because it just
did what you told it to do to get an object out of an .pp file.
But! you created an .f file and no .o file. this means that you should
tell make that you make a .f file or make the .o file:

.pp.o:
	cp $< $*.f
	$(FCOMP) -o $*.o $*.f
	  ^-- whatever you need to go from .f to .o (fortran?)
OR

.pp.f:
	cp $< $*.f

In the second case make should add up both the .pp.f and .f.o rules
to make your .o out of .pp.

-- 
The mail|    AAA         DDDD  It's not the kill, but the thrill of the chase.
demon...|   AA AAvv   vvDD  DD        Ketchup is a vegetable.
hits!.@&|  AAAAAAAvv vvDD  DD                    {nixbur|nixtor}!adalen.via
--more--| AAA   AAAvvvDDDDDD    Andre van Dalen, uunet!hp4nl!targon!andre



More information about the Comp.unix.questions mailing list