Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!voder!pyramid!ctnews!risky!gilles From: gilles@diox.Convergent.COM (Gilles COURCOUX) Newsgroups: comp.unix.programmer Subject: Re: Make doesn't understand .SUFFIXES: .b .c .s .i .o Message-ID: <5485@risky.Convergent.COM> Date: 11 Jun 91 16:22:16 GMT References: <23182@shlump.lkg.dec.com> Sender: root@risky.Convergent.COM Organization: Chorus Systems, Beaverton, OR Lines: 51 In article <23182@shlump.lkg.dec.com> jc@netrix.nac.dec.com writes: [I tried to answer directly by Email, but mails bounced back with: ----- Transcript of session follows ----- User "jc" is no longer employed here and has moved to a site that does not have electronic mail access. We therefore cannot forward the mail.] >This has bothered me for some time, and it sure seems that make oughta >know how to handle it, but it never does. What I've been doing is >using a local preprocessor to convert foo.b to foo.c, where foo.b is >basically C with a bunch of extra stuff that cpp can't handle. I've >written a simple translator b-c and told make: > .SUFFIXES: .b .c .s .i .o > .b.c: ;b-c 0-8t 9 <$*.b >$@ > .c.o: ;cc -c $(CFLAGS) $*.c You inverted the sequence of suffixes in the .SUFFIXES line. It must be .SUFFIXES: .o .i .s .c .b Note that to make 'make' forget all its previous prefixes you must 'erase' them with the line .SUFFIXES: Your makefile should now be: .SUFFIXES: .SUFFIXES: .o .i .s .c .b .b.c: ;b-c 0-8t 9 <$*.b >$@ .c.o: ;cc -c $(CFLAGS) $*.c From the SVR3.2 online manual: Additional suffixes are given as the dependency list for .SUFFIXES. Order is significant; the first possible name for which both a file and a rule exist is inferred as a prerequisite. The default list is: .SUFFIXES: .o .c .c~ .y .y~ .l .l~ .s .s~ .sh .sh~ .h .h~ .f .f~ Here again, the above command for printing the internal rules will display the list of suffixes implemented on the current machine. Multiple suffix lists accumulate; .SUFFIXES: with no dependencies clears the list of suffixes. I agree, it is not very explicit (as usual :-). But by looking closely at the default suffixes list, you could have noticed that. Makes you happy? -- Gilles Courcoux E-mail: gilles@Convergent.COM Chorus Systems Inc Phone: (408) 435-7692