asterisk/third-party/Makefile.rules

65 lines
1.8 KiB
Makefile

ifeq ($(NOISY_BUILD),)
SUBMAKE?=$(MAKE) --quiet --no-print-directory
ECHO_PREFIX?=@
CMD_PREFIX?=@
QUIET_CONFIGURE=-q
REALLY_QUIET=>/dev/null 2>&1
else
SUBMAKE?=$(MAKE)
ECHO_PREFIX?=@\#
CMD_PREFIX?=
QUIET_CONFIGURE=
REALLY_QUIET=
endif
# The following exports are set during a configure but if
# it hasn't been run yet, we'll set some defaults
# to be able to still allow clean and distclean to run
export SUBMAKE
export ECHO_PREFIX
export CMD_PREFIX
export QUIET_CONFIGURE
export REALLY_QUIET
export ASTTOPDIR
export ASTSBINDIR
export DESTDIR
export ASTDATADIR
export TAR
export PATCH
export SED ?= sed
export NM
export MD5
export CAT
export CUT
export GREP ?= grep
export FIND ?= find
export REALPATH ?= realpath
export BASENAME ?= basename
export DIRNAME ?= dirname
export DOWNLOAD
export DOWNLOAD_TO_STDOUT
export DOWNLOAD_TIMEOUT
DOWNLOAD_DIR := $(or $(EXTERNALS_CACHE_DIR),$(TMPDIR),$(wildcard /tmp),.)
# These depend on the subpackage defining TARBALL_FILE.
TARBALL_EXISTS = test -f $(DOWNLOAD_DIR)/$(TARBALL_FILE) -a -f $(TARBALL_MD5)
define TARBALL_VERIFY
($(SHELL_ECHO_PREFIX) Verifying $(DOWNLOAD_DIR)/$(TARBALL_FILE) &&\
tarball_sum=$$($(CAT) $(DOWNLOAD_DIR)/$(TARBALL_FILE) | $(MD5) | $(CUT) -d' ' -f1) ;\
required_sum=$$($(GREP) -e $(TARBALL_FILE) $(TARBALL_MD5) | $(CUT) -d' ' -f1) ;\
if [ -z "$$required_sum" -o "$$tarball_sum" != "$$required_sum" ] ; then $(SHELL_ECHO_PREFIX) Verify failed ; exit 1 ;\
else $(SHELL_ECHO_PREFIX) Verify successful ; exit 0 ; fi; )
endef
define TARBALL_DOWNLOAD
($(SHELL_ECHO_PREFIX) Downloading $(TARBALL_URL) to $(DOWNLOAD_DIR)/$(TARBALL_FILE) ;\
$(DOWNLOAD_TO_STDOUT) $(call DOWNLOAD_TIMEOUT,5,60) $(TARBALL_URL) > $(DOWNLOAD_DIR)/$(TARBALL_FILE) &&\
$(TARBALL_VERIFY))
endef
TARBALL_URL = $(PACKAGE_URL)/$(TARBALL_FILE)
TARBALL_MD5 = $(TARBALL_FILE).md5