[Asterisk-code-review] Build: Add separate header install/uninstall targets (...asterisk[13])
George Joseph
asteriskteam at digium.com
Fri Jul 19 07:34:40 CDT 2019
George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/c/asterisk/+/11573 )
Change subject: Build: Add separate header install/uninstall targets
......................................................................
Build: Add separate header install/uninstall targets
Two new Makefile targets have been added... "install-headers" and
"uninstall-headers" to separately control header installation.
The existing behavior has not changed so "make install" and
"make uninstall" will continue to also install/uninstall the headers.
The new targets were added for forward compatibility with Asterisk 17
in which the headers are no longer installed/uninstalled with the
"install" and "uninstall" targets.
Also corrects an issue where /usr/include/asterisk.h was never
being removed at all.
Change-Id: Ia7399f3a0203a4825fc4a9f43b9034dae9a2b643
---
M Makefile
A doc/CHANGES-staging/install_headers.txt
2 files changed, 28 insertions(+), 11 deletions(-)
Approvals:
Corey Farrell: Looks good to me, but someone else must approve
Benjamin Keith Ford: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved; Approved for Submit
diff --git a/Makefile b/Makefile
index 0a83cf1..6a3e251 100644
--- a/Makefile
+++ b/Makefile
@@ -559,7 +559,6 @@
"$(ASTSPOOLDIR)" "$(ASTSPOOLDIR)/dictate" "$(ASTSPOOLDIR)/meetme" \
"$(ASTSPOOLDIR)/monitor" "$(ASTSPOOLDIR)/system" "$(ASTSPOOLDIR)/tmp" \
"$(ASTSPOOLDIR)/voicemail" "$(ASTSPOOLDIR)/recording" \
- "$(ASTHEADERDIR)" "$(ASTHEADERDIR)/doxygen" \
"$(ASTLOGDIR)" "$(ASTLOGDIR)/cdr-csv" "$(ASTLOGDIR)/cdr-custom" \
"$(ASTLOGDIR)/cel-custom" "$(ASTDATADIR)" "$(ASTDATADIR)/documentation" \
"$(ASTDATADIR)/documentation/thirdparty" "$(ASTDATADIR)/firmware" \
@@ -578,19 +577,13 @@
main-bininstall:
+ at DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" ASTLIBDIR="$(ASTLIBDIR)" $(SUBMAKE) -C main bininstall
-bininstall: _all installdirs $(SUBDIRS_INSTALL) main-bininstall
+bininstall: _all installdirs $(SUBDIRS_INSTALL) main-bininstall install-headers
$(INSTALL) -m 755 contrib/scripts/astversion "$(DESTDIR)$(ASTSBINDIR)/"
$(INSTALL) -m 755 contrib/scripts/astgenkey "$(DESTDIR)$(ASTSBINDIR)/"
$(INSTALL) -m 755 contrib/scripts/autosupport "$(DESTDIR)$(ASTSBINDIR)/"
if [ ! -f /sbin/launchd ]; then \
./build_tools/install_subst contrib/scripts/safe_asterisk "$(DESTDIR)$(ASTSBINDIR)/safe_asterisk"; \
fi
- $(INSTALL) -m 644 include/asterisk.h "$(DESTDIR)$(includedir)"
- $(INSTALL) -m 644 include/asterisk/*.h "$(DESTDIR)$(ASTHEADERDIR)"
- $(INSTALL) -m 644 include/asterisk/doxygen/*.h "$(DESTDIR)$(ASTHEADERDIR)/doxygen"
- if [ -n "$(OLDHEADERS)" ]; then \
- for h in $(OLDHEADERS); do rm -f "$(DESTDIR)$(ASTHEADERDIR)/$$h"; done \
- fi
ifneq ($(DISABLE_XMLDOC),yes)
$(INSTALL) -m 644 doc/core-*.xml "$(DESTDIR)$(ASTDATADIR)/documentation"
@@ -803,6 +796,16 @@
fi
endef
+install-headers:
+# Will create all components of "$(DESTDIR)$(ASTHEADERDIR)/doxygen" including "$(DESTDIR)$(includedir)"
+ $(INSTALL) -d "$(DESTDIR)$(ASTHEADERDIR)/doxygen"
+ $(INSTALL) -m 644 include/asterisk.h "$(DESTDIR)$(includedir)"
+ $(INSTALL) -m 644 include/asterisk/*.h "$(DESTDIR)$(ASTHEADERDIR)"
+ $(INSTALL) -m 644 include/asterisk/doxygen/*.h "$(DESTDIR)$(ASTHEADERDIR)/doxygen"
+ if [ -n "$(OLDHEADERS)" ]; then \
+ for h in $(OLDHEADERS); do rm -f "$(DESTDIR)$(ASTHEADERDIR)/$$h"; done \
+ fi
+
install-configs:
@if test -z "$(CONFIG_SRC)" -o ! -d "$(CONFIG_SRC)"; then \
>&2 echo "CONFIG_SRC must be set to a directory."; \
@@ -992,12 +995,15 @@
main-binuninstall:
+ at DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" ASTLIBDIR="$(ASTLIBDIR)" $(SUBMAKE) -C main binuninstall
-_uninstall: $(SUBDIRS_UNINSTALL) main-binuninstall
+uninstall-headers:
+ rm -rf "$(DESTDIR)$(ASTHEADERDIR)"
+ rm -f "$(DESTDIR)$(includedir)/asterisk.h"
+
+_uninstall: $(SUBDIRS_UNINSTALL) main-binuninstall uninstall-headers
rm -f "$(DESTDIR)$(ASTMODDIR)/"*
test -n "$(_oldmoddir)" -a -d "$(_oldmoddir)" && rm -f "$(_oldmoddir)/"* || :
rm -f "$(DESTDIR)$(ASTSBINDIR)/astgenkey"
rm -f "$(DESTDIR)$(ASTSBINDIR)/autosupport"
- rm -rf "$(DESTDIR)$(ASTHEADERDIR)"
rm -rf "$(DESTDIR)$(ASTDATADIR)/firmware"
rm -f "$(DESTDIR)$(ASTMANDIR)/man8/asterisk.8"
rm -f "$(DESTDIR)$(ASTMANDIR)/man8/astgenkey.8"
@@ -1027,7 +1033,7 @@
@echo " + $(mK) uninstall-all +"
@echo " +-------------------------------------------+"
-uninstall-all: _uninstall
+uninstall-all: _uninstall uninstall-headers
rm -rf "$(DESTDIR)$(ASTMODDIR)"
test -n "$(_oldmoddir)" -a -d "$(_oldmoddir)" && rm -rf "$(_oldmoddir)" || :
rm -rf "$(DESTDIR)$(ASTVARLIBDIR)"
@@ -1121,6 +1127,7 @@
@ALEMBIC=$(ALEMBIC) build_tools/make_check_alembic config cdr voicemail >&2
.PHONY: install-configs
+.PHONY: install-headers
.PHONY: menuselect
.PHONY: main
.PHONY: sounds
@@ -1134,6 +1141,7 @@
.PHONY: uninstall
.PHONY: _uninstall
.PHONY: uninstall-all
+.PHONY: uninstall-headers
.PHONY: badshell
.PHONY: installdirs
.PHONY: validate-docs
diff --git a/doc/CHANGES-staging/install_headers.txt b/doc/CHANGES-staging/install_headers.txt
new file mode 100644
index 0000000..0957193
--- /dev/null
+++ b/doc/CHANGES-staging/install_headers.txt
@@ -0,0 +1,9 @@
+Subject: Build
+
+Two new Makefile targets have been added... "install-headers" and
+"uninstall-headers" to separately control header installation.
+The existing behavior has not changed so "make install" and
+"make uninstall" will continue to also install/uninstall the headers.
+The new targets were added for forward compatibility with Asterisk 17
+in which the headers are no longer installed/uninstalled with the
+"install" and "uninstall" targets.
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11573
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: Ia7399f3a0203a4825fc4a9f43b9034dae9a2b643
Gerrit-Change-Number: 11573
Gerrit-PatchSet: 4
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190719/9b5ac6d9/attachment.html>
More information about the asterisk-code-review
mailing list