I've been using automatic prerequisites for years (I noticed the
current documentation puts a set -e in front so command failures
will be treated as errors...

One of the problems is
        make clean
or      
        make -n
will start making the prerequisites...

What I've done is:

ifneq (,$(findstring clean,$(MAKECMDGOALS)))
NO_DEPENDS=1
endif

ifneq (,$(findstring n,$(MAKEFLAGS)))
NO_DEPENDS=1
endif


ifndef NO_DEPENDS
-include $(DEPS)
endif

depends:  $(DEPS)

%.d: %.cc
        set -e; $(CXX) -MM $(CXXFLAGS) $< > [EMAIL PROTECTED]; \
        sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < [EMAIL PROTECTED] > $@; \
        rm -f [EMAIL PROTECTED]

I've seen this annoying behavior for years...is there a better
wah t handle this?


Marty Leisner
[EMAIL PROTECTED]


_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to