There are times when you need to troubleshoot issues with bundled pjproject or add new features that need to be pushed upstream but... * The source directory created by extracting the pjproject tarball is not scanned for code changes so you have to keep forcing rebuilds. * The source directory isn't a git repo so you can't easily create patches, do git bisects, etc. * Accidentally doing a make distclean will ruin your day by wiping out the source directory, and your changes. * etc. This commit makes that easier. See third-party/pjproject/README-hacking.md for the details. ASTERISK-29824 Change-Id: Idb1251040affdab31d27cd272dda68676da9b268
65 lines
1.8 KiB
Makefile
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
|