delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/20/07:17:08

Date: Tue, 20 Oct 1998 13:17:13 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Vladimir Taltos <draco AT ttlc DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: "No rule to make target..." makefile problem
In-Reply-To: <362AB588.1D3F978F@ttlc.net>
Message-ID: <Pine.SUN.3.91.981020131632.16812N-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Sun, 18 Oct 1998, Vladimir Taltos wrote:

> However, when I try to run this, I get the error message:
>     "No rule to make target 'act_comm.o', needed by rom. Stop."

Your problem is the following line:

> .c.o: merc.h

Remove the merc.h part after the colon, and it will all start working
as you'd expect.  If you need the dependency on merc.h, write it
separately, like this:

$(O_FILES): merc.h

and don't write any commands under this line, so Make will know this
is only a dependency, not a rule.

> This makefile was part of the stock release, and the developer seems to
> have expected it to work.

IMHO, your developer needs to learn about Make ;-).

> I have indulged in a number of lengthy hair-tairing sessions trying to
> figure this out.

The most effective way to avoid lengthy hair-tearing sessions is to
run for the docs.  From the DOS prompt, type "info make", go to the
"Concept Index" chapter, look for "suffix rules" and you will find a
pointer to a section called "Old-Fashioned Suffix Rules" with this
passage:

       Suffix rules cannot have any dependencies of their own.  If they
    have any, they are treated as normal files with funny names, not as
    suffix rules.  Thus, the rule:

	 .c.o: foo.h
		 $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<

    tells how to make the file `.c.o' from the dependency file `foo.h'

- Raw text -


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