[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to automatically update a automatically generated dependence fil
From: |
Peng Yu |
Subject: |
Re: How to automatically update a automatically generated dependence file? |
Date: |
Sat, 25 Oct 2008 09:24:59 -0500 |
> Here's a correct, *tested* makefile:
> --------
> .PHONY: all clean
>
> SRC = main.cpp
> COMPILE.cpp += -MMD -MP
>
> all: main.exe
>
> main.exe : main.o
> $(LINK.cpp) $< $(LOADLIBES) $(LDLIBS) -o $@
>
> -include $(SRC:.cpp=.d)
>
> clean:
> @$(RM) *.o *.exe *.d
> --------
This works. But I want to understand how this works. 'main.d' is the following.
-------------------------------------------------
main.o: main.cpp print.hpp nothing1.hpp nothing3.hpp
print.hpp:
nothing1.hpp:
nothing3.hpp:
---------------------------------------------
How do the last three rules come into play?
Suppose I nothing1.cpp so that it includes nothing2.hpp, and I rename
nothing3.hpp to nothing2.hpp. Why remake would be success?
Thanks,
Peng
- Re: How to automatically update a automatically generated dependence file?, (continued)
- Re: How to automatically update a automatically generated dependence file?, Greg Chicares, 2008/10/23
- Re: How to automatically update a automatically generated dependence file?, Peng Yu, 2008/10/24
- Re: How to automatically update a automatically generated dependence file?, Philip Guenther, 2008/10/24
- Re: How to automatically update a automatically generated dependence file?, Peng Yu, 2008/10/25
- Re: How to automatically update a automatically generated dependence file?, Philip Guenther, 2008/10/25
- Re: How to automatically update a automatically generated dependence file?,
Peng Yu <=
- Re: How to automatically update a automatically generated dependence file?, Philip Guenther, 2008/10/25