From: Corey Farrell Date: Mon, 23 Jul 2018 18:49:33 +0000 (-0400) Subject: Build System: Create 'make install-configs' target. X-Git-Tag: 15.6.0-rc1~45^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86e93c537c3f53c3ac654df5a3dce4580bef1d57;p=thirdparty%2Fasterisk.git Build System: Create 'make install-configs' target. This target requires specifying CONFIG_SRC=path_to_configs. This can be used to install custom configs for the Asterisk build while still performing directory replacements on asterisk.conf. Modify internal INSTALL_CONFIGS so first argument requires full path to the config sources relative to Asterisk source root. Change-Id: Idcd841df3c8d5bfe23d566bb9e2e448e9df4f8ab --- diff --git a/Makefile b/Makefile index 1cd96650f7..af1083dcce 100644 --- a/Makefile +++ b/Makefile @@ -766,7 +766,7 @@ upgrade: bininstall # (1) the configuration directory to install from # (2) the extension to strip off define INSTALL_CONFIGS - @for x in configs/$(1)/*$(2); do \ + @for x in $(1)/*$(2); do \ dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x $(2)`"; \ if [ -f "$${dst}" ]; then \ if [ "$(OVERWRITE)" = "y" ]; then \ @@ -802,6 +802,14 @@ define INSTALL_CONFIGS fi endef +install-configs: + @if test -z "$(CONFIG_SRC)" -o ! -d "$(CONFIG_SRC)"; then \ + >&2 echo "CONFIG_SRC must be set to a directory."; \ + exit 1; \ + fi + @echo "Installing config files from $(CONFIG_SRC)/*$(CONFIG_EXTEN)" + $(call INSTALL_CONFIGS,$(CONFIG_SRC),$(CONFIG_EXTEN)) + # XXX why *.adsi is installed first ? adsi: @echo Installing adsi config files... @@ -818,7 +826,7 @@ adsi: samples: adsi @echo Installing other config files... - $(call INSTALL_CONFIGS,samples,.sample) + $(call INSTALL_CONFIGS,configs/samples,.sample) $(INSTALL) -d "$(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX" build_tools/make_sample_voicemail "$(DESTDIR)/$(ASTDATADIR)" "$(DESTDIR)/$(ASTSPOOLDIR)" @for x in phoneprov/*; do \ @@ -841,7 +849,7 @@ samples: adsi basic-pbx: @echo Installing basic-pbx config files... - $(call INSTALL_CONFIGS,basic-pbx) + $(call INSTALL_CONFIGS,configs/basic-pbx) webvmail: @[ -d "$(DESTDIR)$(HTTP_DOCSDIR)/" ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 ) @@ -1111,6 +1119,7 @@ check-alembic: makeopts @find contrib/ast-db-manage/ -name '*.pyc' -delete @ALEMBIC=$(ALEMBIC) build_tools/make_check_alembic config cdr voicemail >&2 +.PHONY: install-configs .PHONY: menuselect .PHONY: main .PHONY: sounds