[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

make problem with multiple character matching (%) operator

From: Crni Gorac
Subject: make problem with multiple character matching (%) operator
Date: Fri, 11 Jan 2002 10:40:35 -0800 (PST)

Project foo has following directory hierarchy:
    |-- Makefile
    |-- ab
    |   `-- foo.a
    `-- c

File foo/ab/foo.b should be generated from
foo/ab/foo.a and then file foo/c/foo.c from
foo/ab/foo.b. Following Makefile is used:
ABDIR = ab
CDIR  = c

all: $(CDIR)/foo.c

$(ABDIR)/%.b: %.a
        cp $< $@

$(CDIR)/%.c: %.b
        cp $< $@

.PHONY: clean

        -rm -rf $(ABDIR)/*.b $(CDIR)/*.c

However, after launching make, following error is
  make: *** No rule to make target `c/foo.c', needed
by `all'.  Stop.

Where I am wrong? Why it is not possible for make to
accomplish two successive multiple character matching
and conclude that it should first generate .b file,
then .c file? When all files are in same directory as
Makefile, everything goes well.

Above problem is simplification of actual problem,
that appears with (as you may already supposed) Yacc
and Lex files.


Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]