Skip to content

Commit

Permalink
rules.mk: make sure we always create a .depend file
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Detlev Zundel <dzu@denx.de>
  • Loading branch information
wdenx committed Oct 6, 2010
1 parent d628866 commit b15fbd4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions rules.mk
Expand Up @@ -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 >> $@ ; \
Expand Down

0 comments on commit b15fbd4

Please sign in to comment.