Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!mcsun!hp4nl!targon!andre From: andre@targon.UUCP (andre) Newsgroups: comp.unix.questions Subject: Re: make SUFFIXES question..... Message-ID: <1446@targon.UUCP> Date: 14 Aug 90 10:57:04 GMT References: <8212@ncar.ucar.edu> Reply-To: andre@targon.UUCP (andre) Organization: Nixdorf Computer BV., DO, P.O. Box 29,Vianen, The Netherlands Lines: 43 In article <8212@ncar.ucar.edu> morreale@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