[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Non existing target not marked as new
From: |
Paul Smith |
Subject: |
Re: Non existing target not marked as new |
Date: |
Thu, 09 Feb 2017 10:54:29 -0500 |
On Thu, 2017-02-09 at 08:16 +0000, Raz Manor wrote:
> Unfortunately I can't send you my makefile as it gives up company IP.
I wasn't suggesting you send your makefile: we don't have the time or
energy to understand and debug an entire make environment :). I was
suggesting you create a small sample that reproduces the problem you're
seeing and send that.
I tried to create a repro case based on your description but it worked
fine for me with both GNU make 4.1 and 4.2.1:
$ mkdir -p build/common/tests ../common/tests
$ echo 'int main() { return 0; }' > ../common/tests/timer_test.cpp
$ cat Makefile
all: build/common/tests/timer_test
build/common/tests/timer_test: build/common/tests/timer_test.o
# -----
DEPFLAGS = -MT $@ -MMD -MP -MF $(@:.o=.Td)
COMPILE.cc = $(CXX) $(DEPFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
POSTCOMPILE = mv -f $(@:.o=.Td) $(@:.o=.d)
build/% : build/%.o
$(LINK.cc) -o $@ $^
build/common/%.o : ../common/%.cpp build/common/%.d
$(COMPILE.cc) $(OUTPUT_OPTION) $<
$(POSTCOMPILE)
build/common/%.d: ;
.PRECIOUS: build/common/%.d
-include build/common/tests/timer_test.d
$ make -r
g++ -MT build/common/tests/timer_test.o -MMD -MP -MF
build/common/tests/timer_test.Td \
-c -o build/common/tests/timer_test.o ../common/tests/timer_test.cpp
mv -f build/common/tests/timer_test.Td build/common/tests/timer_test.d
g++ -o build/common/tests/timer_test build/common/tests/timer_test.o
$ make -r
make: Nothing to be done for 'all'.
$ rm -f build/common/tests/timer_test.d
$ make -r
g++ -MT build/common/tests/timer_test.o -MMD -MP -MF
build/common/tests/timer_test.Td \
-c -o build/common/tests/timer_test.o ../common/tests/timer_test.cpp
mv -f build/common/tests/timer_test.Td build/common/tests/timer_test.d
g++ -o build/common/tests/timer_test build/common/tests/timer_test.o
Re: Non existing target not marked as new, Philip Guenther, 2017/02/09