Daniel Dilts wrote: > One more problem occured to me with the rule I made: > > $(OBJECT_PATH)/%.o : $(SOURCE_PATH)/%.cpp > $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $< > > This does not make any of the header files a dependency. Any ideas > for how > to add that without hardcoding each of the heading file names (and > only have > as dependencies the header files that are actually used)? That is the point of the "g++ -MM ..." stuff you had before.
The -MM rules and the %.o:%.c rules are solving different halves of the problem. The first is used to detect what the dependencies are, while the second specifies how a dependency of a particular form is used. They are compatible with each other, and you will often want to use both. (The second rule also happens to add the .c dependency, but that is redundant and harmless if you use them together.) -------------------- BYU Unix Users Group http://uug.byu.edu/ The opinions expressed in this message are the responsibility of their author. They are not endorsed by BYU, the BYU CS Department or BYU-UUG. ___________________________________________________________________ List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list
