~singpolyma/asterisk

asterisk/third-party/Makefile.rules -rw-r--r-- 1.5 KiB
51af79b4Christopher Vollick Content Created By Initiator 2: Electric Boogaloo 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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

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
export NM
export MD5
export CAT
export CUT
export GREP
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