5 PHP_MIRROR ?
= http
://us1.php.net
/distributions
/
8 prefix += /job-
$(TRAVIS_JOB_NUMBER
)
9 exec_prefix ?
= $(prefix)
10 bindir = $(exec_prefix)/bin
11 srcdir := $(dir $(word $(words $(MAKEFILE_LIST
)),$(MAKEFILE_LIST
)))
13 enable_maintainer_zts ?
= no
16 with_config_file_scan_dir ?
= $(prefix)/etc
/php.d
18 with_php_config ?
= $(bindir)/php-config
19 extdir
= $(shell test -x
$(with_php_config
) && $(with_php_config
) --extension-dir
)
21 PECL_MIRROR ?
= http
://pecl.php.net
/get/
22 PECL_EXTENSION ?
= $(shell echo
$(PECL
) | cut
-d
: -f1
)
23 PECL_SONAME ?
= $(if
$(shell echo
$(PECL
) | cut
-d
: -f2
),$(shell echo
$(PECL
) | cut
-d
: -f2
),$(PECL_EXTENSION
))
24 PECL_VERSION ?
= $(shell echo
$(PECL
) | cut
-d
: -f3
-s
)
25 PECL_INI
= $(with_config_file_scan_dir
)/pecl.ini
27 PHP_VERSION ?
= $(shell test -e
$(srcdir)/php-versions.json
&& cat
$(srcdir)/php-versions.json |
/usr
/bin
/php
$(srcdir)/php-version.php
$(PHP
))
29 .PHONY
: all php
check clean reconf pecl ext
test
37 @if
test -d
$(srcdir)/php-
$(PHP_VERSION
); then cd
$(srcdir)/php-
$(PHP_VERSION
); make
distclean || true
; done
39 check: $(srcdir)/php-versions.json
40 @if
test -z
"$(PHP)"; then echo
"No php version specified, e.g. PHP=5.6"; exit
1; fi
42 reconf
: check $(srcdir)/php-
$(PHP_VERSION
)/configure
43 cd
$(srcdir)/php-
$(PHP_VERSION
) && .
/configure
-C
--prefix=$(prefix)
45 php
: check $(bindir)/php
47 $(srcdir)/php-versions.json
: $(srcdir)/php-version.php
48 curl
-Sso
$@ http
://php.net
/releases
/active.php
50 $(srcdir)/php-
$(PHP_VERSION
)/configure
: |
$(srcdir)/php-versions.json
51 curl
-Ss
$(PHP_MIRROR
)/php-
$(PHP_VERSION
).
tar.bz2 |
tar xj
-C
$(srcdir)
53 $(srcdir)/php-
$(PHP_VERSION
)/Makefile
: $(srcdir)/php-
$(PHP_VERSION
)/configure |
$(srcdir)/php-versions.json
54 cd
$(srcdir)/php-
$(PHP_VERSION
) && .
/configure
-C
--prefix=$(prefix)
56 $(srcdir)/php-
$(PHP_VERSION
)/sapi
/cli
/php
: $(srcdir)/php-
$(PHP_VERSION
)/Makefile |
$(srcdir)/php-versions.json
57 cd
$(srcdir)/php-
$(PHP_VERSION
) && make
-s
-j
$(JOBS
) V
=0 || make
59 $(bindir)/php
: $(srcdir)/php-
$(PHP_VERSION
)/sapi
/cli
/php |
$(srcdir)/php-versions.json
60 cd
$(srcdir)/php-
$(PHP_VERSION
) && make
-s
install V
=0
62 $(with_config_file_scan_dir
):
68 @if
test -z
"$(PECL)"; then echo
"No pecl extension specified, e.g. PECL=pecl_http:http"; exit
1; fi
70 $(PECL_INI
): |
$(with_config_file_scan_dir
)
73 $(srcdir)/pecl-
$(PECL_EXTENSION
):
74 test -e
$@ || ln
-s
$(CURDIR
) $@
76 $(srcdir)/pecl-
$(PECL_EXTENSION
)/config.m4
:
77 mkdir
-p
$(srcdir)/pecl-
$(PECL_EXTENSION
)
78 curl
-Ss
$(PECL_MIRROR
)/$(PECL_EXTENSION
)$(if
$(PECL_VERSION
),/$(PECL_VERSION
)) |
tar xz
--strip-components
1 -C
$(srcdir)/pecl-
$(PECL_EXTENSION
)
80 $(srcdir)/pecl-
$(PECL_EXTENSION
)/configure
: $(srcdir)/pecl-
$(PECL_EXTENSION
)/config.m4
81 cd
$(srcdir)/pecl-
$(PECL_EXTENSION
) && $(bindir)/phpize
83 $(srcdir)/pecl-
$(PECL_EXTENSION
)/Makefile
: $(srcdir)/pecl-
$(PECL_EXTENSION
)/configure
84 cd
$(srcdir)/pecl-
$(PECL_EXTENSION
) && .
/configure
-C
86 $(srcdir)/pecl-
$(PECL_EXTENSION
)/.libs
/$(PECL_SONAME
).so
: $(srcdir)/pecl-
$(PECL_EXTENSION
)/Makefile
87 cd
$(srcdir)/pecl-
$(PECL_EXTENSION
) && make
-s
-j
$(JOBS
) V
=0 || make
89 $(extdir
)/$(PECL_SONAME
).so
: $(srcdir)/pecl-
$(PECL_EXTENSION
)/.libs
/$(PECL_SONAME
).so
90 cd
$(srcdir)/pecl-
$(PECL_EXTENSION
) && make
-s
install V
=0
92 pecl
: pecl-check php
$(extdir
)/$(PECL_SONAME
).so |
$(PECL_INI
)
93 grep
-q extension
=$(PECL_SONAME
).so
$(PECL_INI
) || echo extension
=$(PECL_SONAME
).so
>> $(PECL_INI
)
95 ext
: pecl-check
$(srcdir)/pecl-
$(PECL_EXTENSION
) pecl
98 REPORT_EXIT_STATUS
=1 NO_INTERACTION
=1 $(bindir)/php run-tests.php
-p
$(bindir)/php
--show-diff tests