[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
automatic prerequisite problems
From: |
Marty Leisner |
Subject: |
automatic prerequisite problems |
Date: |
Thu, 10 Nov 2005 22:14:24 -0500 |
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) $< > address@hidden; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < address@hidden > $@; \
rm -f address@hidden
I've seen this annoying behavior for years...is there a better
wah t handle this?
Marty Leisner
address@hidden
- automatic prerequisite problems,
Marty Leisner <=