help-make
[Top][All Lists]
Advanced

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

Problem with Make 3.82 and wilcard in prerequisite for directories


From: Bastian Beischer
Subject: Problem with Make 3.82 and wilcard in prerequisite for directories
Date: Fri, 9 Nov 2012 16:40:30 +0100

We are trying to achieve the following: For a list of object file
targets our source files reside in many different directories. So we
used a rule like this one:

%.o: ./*/%.c
        COMPILE...

to compile all of those object files. This worked fine with Make 3.81
but does not work anymore with Make 3.82. It seems the source file
corresponding to the %.o is not found anymore. I simplified the case
and reproduced it with the following directory structure:

~/test
~/test/a
~/test/a/a.c
~/test/b
~/test/b/b.c
~/test/Makefile

Makefile looks like this:

~/test/$ cat Makefile
all: a.o b.o

%.o: ./*/%.c
        cat $<

Now if I run "make" with 3.81 I get the following:

~/test$ make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for x86_64-unknown-linux-gnu

~/test/$ make
cat a/a.c
cat b/b.c
a
b

I then simply upgrade make on my system to 3.82 (no further changes!)
and try the same again:

~/test/$ make --version
GNU Make 3.82
Built for x86_64-unknown-linux-gnu
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

~/test/$ make
make: *** No rule to make target `a.o', needed by `all'.  Stop.

Is this a bug in make? Or is this sort of rule not supported by make
anymore? Any ideas on how to write something nice which would work
with both 3.81 and 3.82?

Cheers
Bastian

-- 
Bastian Beischer
RWTH Aachen University of Technology

@CERN
Office: Bdg 32-4-B12
Phone: +41-22-76-75750
E-mail: address@hidden
Address: CERN, CH-1211 Geneve 23

@RWTH Aachen
Office: 28 C 203
Phone: +49-241-80-27205
E-mail: address@hidden
Address: I. Physikalisches Institut B, Sommerfeldstr. 14, D-52074 Aachen



reply via email to

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