delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/11/01/04:49:25

Date: Wed, 1 Nov 2000 10:30:15 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Jerzy Klejnowski <dziabol AT polbox DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Make, suffix rules and pattern rules.
In-Reply-To: <39FF8D41.BB16E9F6@polbox.com>
Message-ID: <Pine.SUN.3.91.1001101102948.7517K-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Wed, 1 Nov 2000, Jerzy Klejnowski wrote:

> The documentation says:
>    "Suffix rules cannot have any prerequisites of their own.  If they
> have any, they are treated as normal files with funny names, not as
> suffix rules."

This seems to be incorrect: suffix rules with prerequisites do work
for me, at least in simple test cases such as yours.  I've forwarded
your report to the mailing list where GNU Make bugs (including bugs in
documentation) should be reported.

> But pattern rule does not work for me, while suffix rule does...
> Here's part of my makefile:
> 
> --<begin>--
> SHELL = bash
> CFLAGS = -many -many -options
> .SUFFIXES :
> .SUFFIXES : .o .c .h
> 
> {various rules}
>        @echo $<
>         @$(CC) -c $(CFLAGS) $< -o $@
> --<end>--
> 
> The results are:
> 
>   {various rules}          what 'make' does
>   ------------------       -----------------
> 1  %.o : %.c                uses my rule
> 2  %.o : %.c header.h       uses predefined rule
> 3  .c.o :                   uses my rule
> 4  .c.o :  header.h         uses my rule

I cannot reproduce this: all of the above variants work for me, using
what you call ``my rule''.  Perhaps you omitted something from this
Makefile snippet, and that omitted part is responsible for the
problem.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019