]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Add dist-clean support for subdirs.
authorJason Parker <jparker@digium.com>
Mon, 1 Oct 2007 21:52:45 +0000 (21:52 +0000)
committerJason Parker <jparker@digium.com>
Mon, 1 Oct 2007 21:52:45 +0000 (21:52 +0000)
Change h323 to only remove the Makefile on a dist-clean, rather than a clean.

This fixes a bug I found with trying to run make after a make clean

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84291 65c4cc65-6c06-0410-ace0-fbb531ad65f3

Makefile
Makefile.rules
channels/Makefile

index 2c08688e4b9cb79870940eb595ef6531d8ed8da1..114c1656b95859ec1eba8699d2916542395be005 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -254,6 +254,7 @@ OTHER_SUBDIRS:=utils agi
 SUBDIRS:=$(OTHER_SUBDIRS) $(MOD_SUBDIRS)
 SUBDIRS_INSTALL:=$(SUBDIRS:%=%-install)
 SUBDIRS_CLEAN:=$(SUBDIRS:%=%-clean)
+SUBDIRS_DIST_CLEAN:=$(SUBDIRS:%=%-dist-clean)
 SUBDIRS_UNINSTALL:=$(SUBDIRS:%=%-uninstall)
 MOD_SUBDIRS_EMBED_LDSCRIPT:=$(MOD_SUBDIRS:%=%-embed-ldscript)
 MOD_SUBDIRS_EMBED_LDFLAGS:=$(MOD_SUBDIRS:%=%-embed-ldflags)
@@ -360,6 +361,9 @@ include/asterisk/buildopts.h: menuselect.makeopts
 $(SUBDIRS_CLEAN):
        @$(MAKE) --no-print-directory -C $(@:-clean=) clean
 
+$(SUBDIRS_DIST_CLEAN):
+       @$(MAKE) --no-print-directory -C $(@:-dist-clean=) dist-clean
+
 clean: $(SUBDIRS_CLEAN)
        rm -f defaults.h
        rm -f include/asterisk/build.h
@@ -369,7 +373,7 @@ clean: $(SUBDIRS_CLEAN)
 
 dist-clean: distclean
 
-distclean: clean
+distclean: $(SUBDIRS_DIST_CLEAN) clean
        @$(MAKE) -C menuselect dist-clean
        @$(MAKE) -C sounds dist-clean
        rm -f menuselect.makeopts makeopts menuselect-tree menuselect.makedeps
@@ -712,4 +716,4 @@ menuselect-tree: $(foreach dir,$(filter-out main,$(MOD_SUBDIRS)),$(wildcard $(di
        @echo "Generating input for menuselect ..."
        @build_tools/prep_moduledeps > $@
 
-.PHONY: menuselect main sounds clean dist-clean distclean all prereqs cleantest uninstall _uninstall uninstall-all dont-optimize $(SUBDIRS_INSTALL) $(SUBDIRS_CLEAN) $(SUBDIRS_UNINSTALL) $(SUBDIRS) $(MOD_SUBDIRS_EMBED_LDSCRIPT) $(MOD_SUBDIRS_EMBED_LDFLAGS) $(MOD_SUBDIRS_EMBED_LIBS) menuselect.makeopts
+.PHONY: menuselect main sounds clean dist-clean distclean all prereqs cleantest uninstall _uninstall uninstall-all dont-optimize $(SUBDIRS_INSTALL) $(SUBDIRS_DIST_CLEAN) $(SUBDIRS_CLEAN) $(SUBDIRS_UNINSTALL) $(SUBDIRS) $(MOD_SUBDIRS_EMBED_LDSCRIPT) $(MOD_SUBDIRS_EMBED_LDFLAGS) $(MOD_SUBDIRS_EMBED_LIBS) menuselect.makeopts
index 9d20c5a9149830a4dfc96311666ba69b7641d5f8..735ecf68b34bd8654a3ef0e7ba1eb7cf5b6eb904 100644 (file)
@@ -17,6 +17,8 @@
 
 -include $(ASTTOPDIR)/makeopts
 
+.PHONY: dist-clean
+
 ifeq ($(NOISY_BUILD),)
    ECHO_PREFIX=@
    CMD_PREFIX=@
@@ -79,3 +81,5 @@ endif
 %: %.o
        $(ECHO_PREFIX) echo "   [LD] $^ -> $@"
        $(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(PTHREAD_CFLAGS) $(ASTLDFLAGS) $^ $(PTHREAD_LIBS) $(LIBS)
+
+dist-clean::
index 8bb737ae936f8056430cfb684e47358f1347fe2f..94b324b96f90eda1a21ef701b706d7f9ad1c814b 100644 (file)
@@ -68,7 +68,6 @@ ifneq ($(wildcard h323/Makefile.ast),)
 H323LDFLAGS+=-Wl,--version-script=h323/noexport.map
 clean::
        $(MAKE) -C h323 clean
-       rm -f h323/Makefile
 else
 h323/libchanh323.a h323/Makefile.ast:
        $(CMD_PREFIX) $(MAKE) -C h323
@@ -81,6 +80,9 @@ h323/libchanh323.a h323/Makefile.ast:
        $(CMD_PREFIX) exit 1
 endif
 
+dist-clean::
+       rm -f h323/Makefile
+
 gentone: gentone.c
        $(ECHO_PREFIX) echo "   [LD] $^ -> $@"
        $(CMD_PREFIX) $(HOST_CC) $(STATIC_BUILD) -o $@ $(HOST_CFLAGS) $(HOST_LDFLAGS) $^ $(LIBS)