[asterisk-commits] trunk r35481 - /trunk/Makefile

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Jun 22 07:31:53 MST 2006


Author: russell
Date: Thu Jun 22 09:31:52 2006
New Revision: 35481

URL: http://svn.digium.com/view/asterisk?rev=35481&view=rev
Log:
use separate targets instead of for loops to process sub directories for the
'clean' and 'clean-depend' targets

Modified:
    trunk/Makefile

Modified: trunk/Makefile
URL: http://svn.digium.com/view/asterisk/trunk/Makefile?rev=35481&r1=35480&r2=35481&view=diff
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Thu Jun 22 09:31:52 2006
@@ -268,6 +268,8 @@
 OTHER_SUBDIRS=utils agi
 SUBDIRS:=$(MOD_SUBDIRS) $(OTHER_SUBDIRS)
 SUBDIRS_INSTALL:=$(SUBDIRS:%=%-install)
+SUBDIRS_CLEAN:=$(SUBDIRS:%=%-clean)
+SUBDIRS_CLEAN_DEPEND:=$(SUBDIRS:%=%-clean-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 \
@@ -366,6 +368,12 @@
 
 all: cleantest config.status menuselect.makeopts depend asterisk $(SUBDIRS)
 
+$(MOD_SUBDIRS): FORCE
+	@CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C $@
+
+$(OTHER_SUBDIRS): FORCE 
+	@CFLAGS="$(OTHER_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C $@
+
 config.status: configure
 	@CFLAGS="" ./configure
 	@echo "****"
@@ -476,33 +484,31 @@
 muted: muted.o
 	$(CC) $(AUDIO_LIBS) -o muted muted.o
 
-$(MOD_SUBDIRS): FORCE
-	@CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C $@
-
-$(OTHER_SUBDIRS): FORCE 
-	@CFLAGS="$(OTHER_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C $@
-
-clean-depend:
-	@for x in $(SUBDIRS); do $(MAKE) -C $$x clean-depend || exit 1 ; done
-	rm -f .depend .tags-depend
-
-clean: clean-depend
-	@for x in $(SUBDIRS); do $(MAKE) -C $$x clean || exit 1 ; done
+$(SUBDIRS_CLEAN_DEPEND):
+	@$(MAKE) -C $(@:-clean-depend=) clean-depend
+
+$(SUBDIRS_CLEAN):
+	@$(MAKE) -C $(@:-clean=) clean
+
+clean-depend: $(SUBDIRS_CLEAN_DEPEND)
+
+clean: $(SUBDIRS_CLEAN) clean-depend
 	rm -f *.o *.so asterisk
 	rm -f defaults.h
 	rm -f include/asterisk/build.h
 	rm -f include/asterisk/version.h
 	rm -f .tags-sources tags TAGS
+	rm -f .depend .tags-depend
 	@if [ -f editline/Makefile ]; then $(MAKE) -C editline distclean ; fi
-	$(MAKE) -C db1-ast clean
-	$(MAKE) -C stdtime clean
+	@$(MAKE) -C db1-ast clean
+	@$(MAKE) -C stdtime clean
 
 distclean: dist-clean
 
 dist-clean: clean
-	$(MAKE) -C mxml clean
-	$(MAKE) -C build_tools dist-clean
-	$(MAKE) -C sounds dist-clean
+	@$(MAKE) -C mxml clean
+	@$(MAKE) -C build_tools dist-clean
+	@$(MAKE) -C sounds dist-clean
 	rm -f menuselect.makeopts makeopts makeopts.xml
 	rm -f config.log config.status
 	rm -f include/autoconfig.h



More information about the asterisk-commits mailing list