Skip to contentSkip to conversation

rules.mk: make sure we always create a .depend file

PATCH New Wolfgang Denk 2 participants 3 messages Oct 5, 2010 – Oct 6, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rules.mk: make sure we always create a .depend file

There are some cases where "make depend" would always run when entering a directory. This happened when both the $(SRCS) and $(HOSTSRCS) lists were empty (which is for example typical for the examples/api/ directory). Avoid this by making sure that a ".depend" file gets always created, even if empty.

---
 rules.mk |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
rules.mk +1 -0
index c1670ac..c2860e5 100644
@@ -27,6 +27,7 @@ _depend:	$(obj).depend
 
 $(obj).depend:	$(src)Makefile $(TOPDIR)/config.mk $(SRCS) $(HOSTSRCS)
 		@rm -f $@
+		@touch $@
 		@for f in $(SRCS); do \
 			g=`basename $$f | sed -e 's/\(.*\)\.\w/\1.o/'`; \
 			$(CC) -M $(CPPFLAGS) -MQ $(obj)$$g $$f >> $@ ; \
Signature · 1 line
1.7.2.3
#1 lore raw

PATCH 1/1 rules.mk: make sure we always create a .depend file

Hi Wolfgang,

Quoted 7 lines

There are some cases where "make depend" would always run when entering a directory. This happened when both the $(SRCS) and $(HOSTSRCS) lists were empty (which is for example typical for the examples/api/ directory). Avoid this by making sure that a ".depend" file gets always created, even if empty.

Wants-half-of-the-credits: Detlev Zundel <[email protected]>

or to be more mundane

Cheers
Detlev

Signature · 8 lines
When you  loosen yourself from  all the obvious delusions  - religion,
ideology,  Communism - you're  still left  with the  myth of  your own
goodness. Which is the final delusion.
                                          -- Philip Roth
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
author Applied
#2 lore raw

PATCH 1/1 rules.mk: make sure we always create a .depend file

In reply to Wolfgang Denk
Quoted 10 lines · In message <[email protected]> you wrote:

There are some cases where "make depend" would always run when entering a directory. This happened when both the $(SRCS) and $(HOSTSRCS) lists were empty (which is for example typical for the examples/api/ directory). Avoid this by making sure that a ".depend" file gets always created, even if empty.

---
 rules.mk |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Applied.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"If the code and  the  comments  disagree,  then  both  are  probably
wrong."                                                - Norm Schryer