-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
63 lines (46 loc) · 1.54 KB
/
Makefile
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
58
59
60
61
62
63
define find_tool
$(abspath $(shell PATH=.:$$PATH; which $1.phar 2>/dev/null || which $1 2>/dev/null || echo false))
endef
define fetch_tool
curl -sSLf $1 -o $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
endef
PHPCS_FIXER_VERSION := 2.5.0
box := $(call find_tool, box)
ifeq ($(PHP),)
php := $(call find_tool, php)
else
php := $(PHP)
endif
composer := $(call find_tool, composer)
composer_options :=
all:
@echo 'Run "make eventum.phar" to build standalone eventum cli phar.'
vendor/autoload.php: composer.lock
$(composer) install --prefer-dist $(composer_options)
eventum.phar: vendor/autoload.php box.json
$(php) -d phar.readonly=0 $(box) build -v
XMLRPC.md: Makefile vendor/autoload.php
$(php) eventum.php --no-ansi dump > $@.tmp && mv $@.tmp $@
deps:
$(box) --version || $(MAKE) box.phar
$(composer) --version || $(MAKE) composer.phar
composer.phar:
curl -sS https://getcomposer.org/installer | php
box.phar:
curl -LSs https://box-project.github.io/box2/installer.php | php
php-cs-fixer.phar:
$(call fetch_tool,https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v$(PHPCS_FIXER_VERSION)/php-cs-fixer.phar)
clean:
rm -vf eventum.phar
dist:
rm -rf build
git clone . build
$(MAKE) -C build eventum.phar box=$(box) composer=$(composer) composer_options="--no-dev --classmap-authoritative"
manifest: dist
./eventum.php create-manifest -o dist/manifest.json dist/eventum.phar
dist/.git:
git_url=`git config remote.origin.url`; \
git clone "$$git_url" dist -b gh-pages --depth=1
distclean: clean
rm -rf vendor *.phar
.PHONY: deps dist