Merge "chan_sip.c: Prevent address change on unauthenticated SIP request."
[asterisk/asterisk.git] / third-party / Makefile.rules
1
2 ifeq ($(NOISY_BUILD),)
3 SUBMAKE?=$(MAKE) --quiet --no-print-directory
4 ECHO_PREFIX?=@
5 CMD_PREFIX?=@
6 QUIET_CONFIGURE=-q
7 REALLY_QUIET=>/dev/null 2>&1
8 else
9 SUBMAKE?=$(MAKE)
10 ECHO_PREFIX?=@\#
11 CMD_PREFIX?=
12 QUIET_CONFIGURE=
13 REALLY_QUIET=
14 endif
15
16 export SUBMAKE
17 export ECHO_PREFIX
18 export CMD_PREFIX
19 export QUIET_CONFIGURE
20 export REALLY_QUIET
21 export ASTTOPDIR
22 export ASTSBINDIR
23 export DESTDIR
24 export ASTDATADIR
25 export TAR
26 export PATCH
27 export SED
28 export NM
29 export MD5
30 export CAT
31 export CUT
32 export GREP
33 export DOWNLOAD
34 export DOWNLOAD_TO_STDOUT
35 export DOWNLOAD_TIMEOUT
36
37 DOWNLOAD_DIR := $(or $(EXTERNALS_CACHE_DIR),$(TMPDIR),$(wildcard /tmp),.)
38
39 # These depend on the subpackage defining TARBALL_FILE.
40 TARBALL_EXISTS = test -f $(DOWNLOAD_DIR)/$(TARBALL_FILE) -a -f $(TARBALL_MD5)
41
42 define TARBALL_VERIFY
43         ($(SHELL_ECHO_PREFIX) Verifying $(DOWNLOAD_DIR)/$(TARBALL_FILE) &&\
44         tarball_sum=$$($(CAT) $(DOWNLOAD_DIR)/$(TARBALL_FILE) | $(MD5) | $(CUT) -d' ' -f1) ;\
45         required_sum=$$($(GREP) -e $(TARBALL_FILE) $(TARBALL_MD5) | $(CUT) -d' ' -f1) ;\
46         if [ -z "$$required_sum" -o "$$tarball_sum" != "$$required_sum" ] ; then $(SHELL_ECHO_PREFIX) Verify failed ; exit 1 ;\
47         else $(SHELL_ECHO_PREFIX) Verify successful ; exit 0 ; fi; )
48 endef
49
50 define TARBALL_DOWNLOAD
51         ($(SHELL_ECHO_PREFIX) Downloading $(TARBALL_URL) to $(DOWNLOAD_DIR)/$(TARBALL_FILE) ;\
52         $(DOWNLOAD_TO_STDOUT) $(call DOWNLOAD_TIMEOUT,5,60) $(TARBALL_URL) > $(DOWNLOAD_DIR)/$(TARBALL_FILE) &&\
53         $(TARBALL_VERIFY))
54 endef
55
56 TARBALL_URL = $(PACKAGE_URL)/$(TARBALL_FILE)
57 TARBALL_MD5 = $(TARBALL_FILE).md5