Make doesn't understand .SUFFIXES: .b .c .s .i .o

Gilles COURCOUX gilles at diox.Convergent.COM
Wed Jun 12 02:22:16 AEST 1991


In article <23182 at shlump.lkg.dec.com> jc at 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 at Convergent.COM
Chorus Systems Inc                     Phone:  (408) 435-7692



More information about the Comp.unix.programmer mailing list