Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - How to create dependencies for .cpp files?: (2 Items)
   
How to create dependencies for .cpp files?  
Need to create dependencies for .cpp files for different modules.
Re: How to create dependencies for .cpp files?  
I'm using an additional make target. You must call `make depends` to update the dependencies. It is possible to add 
depends as an additional make target.

# automatic dependencies - copied from qdepfile.mk; .cpp added
DEPFILE=depends.mk

-include $(DEPFILE)

DEPLIST=$(subst .o,.depends,$(OBJS))

.PHONY: initdepend depends

depends: initdepend $(DEPLIST)

initdepend:
	$(RM_HOST) $(DEPFILE)
	
%.depends: %.c
	$(CCPREF) -Wp,-MM -E $(CCFLAGS) $(FLAGS) $(CCVFLAGS) $(CCOPTS) $< >>$(DEPFILE)

%.depends: %.cpp
	$(CCPREF) -Wp,-MM -E $(CCFLAGS) $(FLAGS) $(CCVFLAGS) $(CCOPTS) $< >>$(DEPFILE)


If you find a better way, please let me hear.

Bye
Christian