From: Russell Bryant Date: Thu, 22 Jun 2006 15:08:08 +0000 (+0000) Subject: - specify that 'depend' is a .PHONY target X-Git-Tag: 1.4.0-beta1~806 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55e8a6036358dff9cc884fc9df2bf55faa275085;p=thirdparty%2Fasterisk.git - 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: https://origsvn.digium.com/svn/asterisk/trunk@35501 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/Makefile b/Makefile index 1fd64faf7b..8b32683716 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) diff --git a/agi/Makefile b/agi/Makefile index 21c1d57992..d73f2382cc 100644 --- a/agi/Makefile +++ b/agi/Makefile @@ -11,7 +11,7 @@ # the GNU General Public License # -.PHONY: clean clean-depend all +.PHONY: clean clean-depend all depend AGIS=agi-test.agi eagi-test eagi-sphinx-test jukebox.agi diff --git a/apps/Makefile b/apps/Makefile index 7ceac360c8..0128582021 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -11,7 +11,7 @@ # the GNU General Public License # -.PHONY: clean clean-depend all +.PHONY: clean clean-depend all depend ifneq ($(wildcard ../menuselect.makeopts),) include ../menuselect.makeopts diff --git a/cdr/Makefile b/cdr/Makefile index ccefb060e3..1b4df79785 100644 --- a/cdr/Makefile +++ b/cdr/Makefile @@ -11,7 +11,7 @@ # the GNU General Public License # -.PHONY: clean clean-depend all +.PHONY: clean clean-depend all depend ifneq ($(wildcard ../menuselect.makeopts),) include ../menuselect.makeopts diff --git a/channels/Makefile b/channels/Makefile index c9b0fc36e5..93429b6b42 100644 --- a/channels/Makefile +++ b/channels/Makefile @@ -11,7 +11,7 @@ # the GNU General Public License # -.PHONY: clean clean-depend all +.PHONY: clean clean-depend all depend ifneq ($(wildcard ../menuselect.makeopts),) include ../menuselect.makeopts diff --git a/codecs/Makefile b/codecs/Makefile index 4ac7aa976d..1528ee374f 100644 --- a/codecs/Makefile +++ b/codecs/Makefile @@ -11,7 +11,7 @@ # the GNU General Public License # -.PHONY: clean clean-depend all +.PHONY: clean clean-depend all depend ifneq ($(wildcard ../menuselect.makeopts),) include ../menuselect.makeopts diff --git a/formats/Makefile b/formats/Makefile index ca2503d1d5..1a306d2f26 100644 --- a/formats/Makefile +++ b/formats/Makefile @@ -11,7 +11,7 @@ # the GNU General Public License # -.PHONY: clean clean-depend all +.PHONY: clean clean-depend all depend ifneq ($(wildcard ../menuselect.makeopts),) include ../menuselect.makeopts diff --git a/funcs/Makefile b/funcs/Makefile index 827458ba9a..b4310f9bf8 100644 --- a/funcs/Makefile +++ b/funcs/Makefile @@ -11,7 +11,7 @@ # the GNU General Public License # -.PHONY: clean clean-depend all +.PHONY: clean clean-depend all depend ifneq ($(wildcard ../menuselect.makeopts),) include ../menuselect.makeopts diff --git a/pbx/Makefile b/pbx/Makefile index a749115717..795911c94e 100644 --- a/pbx/Makefile +++ b/pbx/Makefile @@ -11,7 +11,7 @@ # the GNU General Public License # -.PHONY: clean clean-depend all +.PHONY: clean clean-depend all depend ifneq ($(wildcard ../menuselect.makeopts),) include ../menuselect.makeopts diff --git a/res/Makefile b/res/Makefile index 4b332194d2..6b7dd3b0c5 100644 --- a/res/Makefile +++ b/res/Makefile @@ -11,7 +11,7 @@ # the GNU General Public License # -.PHONY: clean clean-depend all +.PHONY: clean clean-depend all depend ifneq ($(wildcard ../menuselect.makeopts),) include ../menuselect.makeopts diff --git a/utils/Makefile b/utils/Makefile index 54e4d15acc..2432ad2feb 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -11,7 +11,7 @@ # the GNU General Public License # -.PHONY: clean clean-depend all +.PHONY: clean clean-depend all depend UTILS:=astman smsq stereorize streamplayer aelparse