-Philip Guenther guent...@gmail.com schrieb: -
Betreff: Re: make doesn't complain if target cannot be built
In many cases, I've found it completely unnecessary to
list the source files. Just list the objects that should be built and
provide pattern rules for the source types, then let
On Tue, 2014-01-14 at 06:56 +0100, Christian Eggers wrote:
Am Montag, 13. Januar 2014, 17:20:43 schrieb Paul Smith:
On Mon, 2014-01-13 at 22:23 +0100, Christian Eggers wrote:
In Makefile 2 my intention was to state that foo.o depends on some
generated header which must be generated first
Am Dienstag, 14. Januar 2014, 08:12:38 schrieb Paul Smith:
Can you add the prerequisite to the pattern rules?
%.o : %.c generated.h
$(COMPILE.c) ...
%.o : %.cpp generated.h
$(COMPILE.cpp) ...
This has the definite potential downside that if generated.h changes
Hint: There's no file present from which foo.o can be built with implicit
rules.
Makefile 1:
--snip---
all: foo.o
--EOF---
# make foo.o
make: *** No rule to make target `foo.o'. Stop.
# echo $?
2
Makefile 2:
--snip---
all: foo.o
foo.o: generated.h
--EOF---
# touch generated.h
# make foo.o
On Mon, 2014-01-13 at 22:23 +0100, Christian Eggers wrote:
In Makefile 2 my intention was to state that foo.o depends on some
generated header which must be generated first (might be in another
rule). But I didn't want to change the be behaviour if foo.o cannot be
built because e.g. there's no
Am Montag, 13. Januar 2014, 17:20:43 schrieb Paul Smith:
On Mon, 2014-01-13 at 22:23 +0100, Christian Eggers wrote:
In Makefile 2 my intention was to state that foo.o depends on some
generated header which must be generated first (might be in another
rule). But I didn't want to change the
On Mon, Jan 13, 2014 at 9:56 PM, Christian Eggers cegg...@gmx.de wrote:
Is there a workaround for this? Using explicit rules seems to be difficult in
my case because some objects are built from .c sources, other from .cpp.
Is there a better way instead of this:
SOURCES_C := foo.c
SOURCES_CPP