aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-06-22 15:08:08 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-06-22 15:08:08 +0000
commitddb0e59eb041414bdcc5c5fe1d514d2423163f66 (patch)
treeb87bcf0d39d762c78c13572e696f6b9df6bc940f /Makefile
parent60c04446dbd1b34cd6fbef1ed877df460a328fcd (diff)
- specify that 'depend' is a .PHONY target
- use separate targets instead of a for loop for doing 'make depend' for each sub directory git-svn-id: http://svn.digium.com/svn/asterisk/trunk@35501 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 13 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 1fd64faf7..8b3268371 100644
--- a/Makefile
+++ b/Makefile
@@ -13,7 +13,7 @@
.EXPORT_ALL_VARIABLES:
-.PHONY: sounds clean clean-depend dist-clean all
+.PHONY: sounds clean clean-depend dist-clean all depend
# Create OPTIONS variable
OPTIONS=
@@ -264,12 +264,15 @@ endif
ASTCFLAGS+=$(MALLOC_DEBUG)$(BUSYDETECT)$(OPTIONS)
-MOD_SUBDIRS=res channels pbx apps codecs formats cdr funcs
-OTHER_SUBDIRS=utils agi
+MOD_SUBDIRS:=res channels pbx apps codecs formats cdr funcs
+OTHER_SUBDIRS:=utils agi
SUBDIRS:=$(MOD_SUBDIRS) $(OTHER_SUBDIRS)
SUBDIRS_INSTALL:=$(SUBDIRS:%=%-install)
SUBDIRS_CLEAN:=$(SUBDIRS:%=%-clean)
SUBDIRS_CLEAN_DEPEND:=$(SUBDIRS:%=%-clean-depend)
+MOD_SUBDIRS_DEPEND:=$(MOD_SUBDIRS:%=%-depend)
+OTHER_SUBDIRS_DEPEND:=$(OTHER_SUBDIRS:%=%-depend)
+SUBDIRS_DEPEND:=$(MOD_SUBDIRS_DEPEND) $(OTHER_SUBDIRS_DEPEND)
OBJS=io.o sched.o logger.o frame.o loader.o config.o channel.o \
translate.o file.o pbx.o cli.o md5.o term.o \
@@ -775,9 +778,13 @@ dont-optimize: _all
valgrind: dont-optimize
-depend: include/asterisk/version.h include/asterisk/buildopts.h .depend defaults.h
- @for x in $(MOD_SUBDIRS); do CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C $$x depend || exit 1 ; done
- @for x in $(OTHER_SUBDIRS); do CFLAGS="$(OTHER_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C $$x depend || exit 1 ; done
+$(MOD_SUBDIRS_DEPEND):
+ @CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C $(@:-depend=) depend
+
+$(OTHER_SUBDIRS_DEPEND):
+ @CFLAGS="$(OTHER_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C $(@:-depend=) depend
+
+depend: include/asterisk/version.h include/asterisk/buildopts.h .depend defaults.h $(SUBDIRS_DEPEND)
.depend: include/asterisk/version.h include/asterisk/buildopts.h defaults.h
build_tools/mkdep $(CFLAGS) $(wildcard *.c)