<p>George Joseph <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11573">View Change</a></p><div style="white-space:pre-wrap">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
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Build: Add separate header install/uninstall targets<br><br>Two new Makefile targets have been added... "install-headers" and<br>"uninstall-headers" to separately control header installation.<br>The existing behavior has not changed so "make install" and<br>"make uninstall" will continue to also install/uninstall the headers.<br>The new targets were added for forward compatibility with Asterisk 17<br>in which the headers are no longer installed/uninstalled with the<br>"install" and "uninstall" targets.<br><br>Also corrects an issue where /usr/include/asterisk.h was never<br>being removed at all.<br><br>Change-Id: Ia7399f3a0203a4825fc4a9f43b9034dae9a2b643<br>---<br>M Makefile<br>A doc/CHANGES-staging/install_headers.txt<br>2 files changed, 28 insertions(+), 11 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/Makefile b/Makefile</span><br><span>index 0a83cf1..6a3e251 100644</span><br><span>--- a/Makefile</span><br><span>+++ b/Makefile</span><br><span>@@ -559,7 +559,6 @@</span><br><span> "$(ASTSPOOLDIR)" "$(ASTSPOOLDIR)/dictate" "$(ASTSPOOLDIR)/meetme" \</span><br><span> "$(ASTSPOOLDIR)/monitor" "$(ASTSPOOLDIR)/system" "$(ASTSPOOLDIR)/tmp" \</span><br><span> "$(ASTSPOOLDIR)/voicemail" "$(ASTSPOOLDIR)/recording" \</span><br><span style="color: hsl(0, 100%, 40%);">- "$(ASTHEADERDIR)" "$(ASTHEADERDIR)/doxygen" \</span><br><span> "$(ASTLOGDIR)" "$(ASTLOGDIR)/cdr-csv" "$(ASTLOGDIR)/cdr-custom" \</span><br><span> "$(ASTLOGDIR)/cel-custom" "$(ASTDATADIR)" "$(ASTDATADIR)/documentation" \</span><br><span> "$(ASTDATADIR)/documentation/thirdparty" "$(ASTDATADIR)/firmware" \</span><br><span>@@ -578,19 +577,13 @@</span><br><span> main-bininstall:</span><br><span> +@DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" ASTLIBDIR="$(ASTLIBDIR)" $(SUBMAKE) -C main bininstall</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-bininstall: _all installdirs $(SUBDIRS_INSTALL) main-bininstall</span><br><span style="color: hsl(120, 100%, 40%);">+bininstall: _all installdirs $(SUBDIRS_INSTALL) main-bininstall install-headers</span><br><span> $(INSTALL) -m 755 contrib/scripts/astversion "$(DESTDIR)$(ASTSBINDIR)/"</span><br><span> $(INSTALL) -m 755 contrib/scripts/astgenkey "$(DESTDIR)$(ASTSBINDIR)/"</span><br><span> $(INSTALL) -m 755 contrib/scripts/autosupport "$(DESTDIR)$(ASTSBINDIR)/"</span><br><span> if [ ! -f /sbin/launchd ]; then \</span><br><span> ./build_tools/install_subst contrib/scripts/safe_asterisk "$(DESTDIR)$(ASTSBINDIR)/safe_asterisk"; \</span><br><span> fi</span><br><span style="color: hsl(0, 100%, 40%);">- $(INSTALL) -m 644 include/asterisk.h "$(DESTDIR)$(includedir)"</span><br><span style="color: hsl(0, 100%, 40%);">- $(INSTALL) -m 644 include/asterisk/*.h "$(DESTDIR)$(ASTHEADERDIR)"</span><br><span style="color: hsl(0, 100%, 40%);">- $(INSTALL) -m 644 include/asterisk/doxygen/*.h "$(DESTDIR)$(ASTHEADERDIR)/doxygen"</span><br><span style="color: hsl(0, 100%, 40%);">- if [ -n "$(OLDHEADERS)" ]; then \</span><br><span style="color: hsl(0, 100%, 40%);">- for h in $(OLDHEADERS); do rm -f "$(DESTDIR)$(ASTHEADERDIR)/$$h"; done \</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span> </span><br><span> ifneq ($(DISABLE_XMLDOC),yes)</span><br><span> $(INSTALL) -m 644 doc/core-*.xml "$(DESTDIR)$(ASTDATADIR)/documentation"</span><br><span>@@ -803,6 +796,16 @@</span><br><span> fi</span><br><span> endef</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+install-headers:</span><br><span style="color: hsl(120, 100%, 40%);">+# Will create all components of "$(DESTDIR)$(ASTHEADERDIR)/doxygen" including "$(DESTDIR)$(includedir)"</span><br><span style="color: hsl(120, 100%, 40%);">+ $(INSTALL) -d "$(DESTDIR)$(ASTHEADERDIR)/doxygen"</span><br><span style="color: hsl(120, 100%, 40%);">+ $(INSTALL) -m 644 include/asterisk.h "$(DESTDIR)$(includedir)"</span><br><span style="color: hsl(120, 100%, 40%);">+ $(INSTALL) -m 644 include/asterisk/*.h "$(DESTDIR)$(ASTHEADERDIR)"</span><br><span style="color: hsl(120, 100%, 40%);">+ $(INSTALL) -m 644 include/asterisk/doxygen/*.h "$(DESTDIR)$(ASTHEADERDIR)/doxygen"</span><br><span style="color: hsl(120, 100%, 40%);">+ if [ -n "$(OLDHEADERS)" ]; then \</span><br><span style="color: hsl(120, 100%, 40%);">+ for h in $(OLDHEADERS); do rm -f "$(DESTDIR)$(ASTHEADERDIR)/$$h"; done \</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> install-configs:</span><br><span> @if test -z "$(CONFIG_SRC)" -o ! -d "$(CONFIG_SRC)"; then \</span><br><span> >&2 echo "CONFIG_SRC must be set to a directory."; \</span><br><span>@@ -992,12 +995,15 @@</span><br><span> main-binuninstall:</span><br><span> +@DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" ASTLIBDIR="$(ASTLIBDIR)" $(SUBMAKE) -C main binuninstall</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-_uninstall: $(SUBDIRS_UNINSTALL) main-binuninstall</span><br><span style="color: hsl(120, 100%, 40%);">+uninstall-headers:</span><br><span style="color: hsl(120, 100%, 40%);">+ rm -rf "$(DESTDIR)$(ASTHEADERDIR)"</span><br><span style="color: hsl(120, 100%, 40%);">+ rm -f "$(DESTDIR)$(includedir)/asterisk.h"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+_uninstall: $(SUBDIRS_UNINSTALL) main-binuninstall uninstall-headers</span><br><span> rm -f "$(DESTDIR)$(ASTMODDIR)/"*</span><br><span> test -n "$(_oldmoddir)" -a -d "$(_oldmoddir)" && rm -f "$(_oldmoddir)/"* || :</span><br><span> rm -f "$(DESTDIR)$(ASTSBINDIR)/astgenkey"</span><br><span> rm -f "$(DESTDIR)$(ASTSBINDIR)/autosupport"</span><br><span style="color: hsl(0, 100%, 40%);">- rm -rf "$(DESTDIR)$(ASTHEADERDIR)"</span><br><span> rm -rf "$(DESTDIR)$(ASTDATADIR)/firmware"</span><br><span> rm -f "$(DESTDIR)$(ASTMANDIR)/man8/asterisk.8"</span><br><span> rm -f "$(DESTDIR)$(ASTMANDIR)/man8/astgenkey.8"</span><br><span>@@ -1027,7 +1033,7 @@</span><br><span> @echo " + $(mK) uninstall-all +"</span><br><span> @echo " +-------------------------------------------+"</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-uninstall-all: _uninstall</span><br><span style="color: hsl(120, 100%, 40%);">+uninstall-all: _uninstall uninstall-headers</span><br><span> rm -rf "$(DESTDIR)$(ASTMODDIR)"</span><br><span> test -n "$(_oldmoddir)" -a -d "$(_oldmoddir)" && rm -rf "$(_oldmoddir)" || :</span><br><span> rm -rf "$(DESTDIR)$(ASTVARLIBDIR)"</span><br><span>@@ -1121,6 +1127,7 @@</span><br><span> @ALEMBIC=$(ALEMBIC) build_tools/make_check_alembic config cdr voicemail >&2</span><br><span> </span><br><span> .PHONY: install-configs</span><br><span style="color: hsl(120, 100%, 40%);">+.PHONY: install-headers</span><br><span> .PHONY: menuselect</span><br><span> .PHONY: main</span><br><span> .PHONY: sounds</span><br><span>@@ -1134,6 +1141,7 @@</span><br><span> .PHONY: uninstall</span><br><span> .PHONY: _uninstall</span><br><span> .PHONY: uninstall-all</span><br><span style="color: hsl(120, 100%, 40%);">+.PHONY: uninstall-headers</span><br><span> .PHONY: badshell</span><br><span> .PHONY: installdirs</span><br><span> .PHONY: validate-docs</span><br><span>diff --git a/doc/CHANGES-staging/install_headers.txt b/doc/CHANGES-staging/install_headers.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..0957193</span><br><span>--- /dev/null</span><br><span>+++ b/doc/CHANGES-staging/install_headers.txt</span><br><span>@@ -0,0 +1,9 @@</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: Build</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+Two new Makefile targets have been added... "install-headers" and</span><br><span style="color: hsl(120, 100%, 40%);">+"uninstall-headers" to separately control header installation.</span><br><span style="color: hsl(120, 100%, 40%);">+The existing behavior has not changed so "make install" and</span><br><span style="color: hsl(120, 100%, 40%);">+"make uninstall" will continue to also install/uninstall the headers.</span><br><span style="color: hsl(120, 100%, 40%);">+The new targets were added for forward compatibility with Asterisk 17</span><br><span style="color: hsl(120, 100%, 40%);">+in which the headers are no longer installed/uninstalled with the</span><br><span style="color: hsl(120, 100%, 40%);">+"install" and "uninstall" targets.</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11573">change 11573</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/11573"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-Change-Id: Ia7399f3a0203a4825fc4a9f43b9034dae9a2b643 </div>
<div style="display:none"> Gerrit-Change-Number: 11573 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>