during 'make install', remove any headers from the destination include/asterisk direc...
authorKevin P. Fleming <kpfleming@digium.com>
Wed, 27 Apr 2005 05:46:32 +0000 (05:46 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Wed, 27 Apr 2005 05:46:32 +0000 (05:46 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5517 65c4cc65-6c06-0410-ace0-fbb531ad65f3

Makefile

index 79bb3b2..c004c6b 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -466,6 +466,9 @@ update:
                echo "Not CVS";  \
        fi
 
+NEWHEADERS=$(subst include/asterisk/,,$(wildcard include/asterisk/*.h))
+OLDHEADERS=$(filter-out $(NEWHEADERS),$(subst $(DESTDIR)$(ASTHEADERDIR)/,,$(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
+
 bininstall: all
        mkdir -p $(DESTDIR)$(MODULES_DIR)
        mkdir -p $(DESTDIR)$(ASTSBINDIR)
@@ -486,6 +489,9 @@ bininstall: all
        for x in $(SUBDIRS); do $(MAKE) -C $$x install || exit 1 ; done
        install -d $(DESTDIR)$(ASTHEADERDIR)
        install -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
+       if [ -n "$(OLDHEADERS)" ]; then \
+               rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
+       fi
        rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail
        mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds
        mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv