[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: |
Philip Guenther |
Subject: |
Re: How to automatically update a automatically generated dependence file? |
Date: |
Fri, 24 Oct 2008 22:34:49 -0700 |
On Fri, Oct 24, 2008 at 5:10 PM, Peng Yu <address@hidden> wrote:
> On Fri, Oct 24, 2008 at 4:58 PM, Philip Guenther <address@hidden> wrote:
...
>> Indeed, you don't even need the separate MAKEDEPEND line: you can mix
>> -MM and -c and gcc/g++ will generate the dependency output *and*
>> compile the file in one pass.
Argh, there's egg on my face: the above is false. -MM can't be
combined (usefully) with -c; it's the -MMD option which can.
> I'm doing C++. I couldn't reproduce what you told me. Would you please
> send me the Makefile that incorporates what you said?
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
--------
Note the use of LINK.cpp to guarantee linking happens with the correct
compilation driver and options.
Philip Guenther
- How to automatically update a automatically generated dependence file?, Peng Yu, 2008/10/23
- 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 <=
- 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