Sending to the list.

Hi,

> Then I wanted make to automatically create the ".dep/" and ".obj/" subdirs
> for me if they don't exist, and that doesn't work.  It seems like make
> wants to build my .d files first, though I thought I told it to make
> $(DEPDIR) first.

Add an explicit dependency here

> $(DEPDIR)%.d: %.cpp $(DEPDIR)

Then make will create the directory before trying to create the dependencies.

The reason it wasn't woprking before is that make had an implicit
dependency on any included files (i.e. your dep files) and it will try
to build those before building your all target.

> Also, if I start with a clean directory, just containing main.cpp and
> Makefile, 'make clean' fails; it's like it won't clean stuff until the .d
> files exist, and it can't create them because ".dep/" doesn't exist.

I normally include my dep files using something like this:

ifeq ($(strip $(filter clean%, $(MAKECMDGOALS))),)
-include $(DEP_FILES)
endif

That way it won't bother inlucding the dependcy files for targets
which don't need them.

--
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to