-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
59 lines (42 loc) · 1.02 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
COMPOSER_CMD=composer
PHIVE_CMD=phive
PHPUNIT_CMD=vendor/bin/phpunit
README_TESTER_CMD=tools/readme-tester
PHPSTAN_CMD=tools/phpstan
PHPCS_CMD=tools/phpcs
.DEFAULT_GOAL=all
.PHONY: all
all: test analyze
.PHONY: clean
clean:
rm -f composer.lock
rm -rf vendor
rm -rf tools
.PHONY: test
test: phpunit examples
.PHONY: phpunit
phpunit: vendor/installed $(PHPUNIT_CMD)
$(PHPUNIT_CMD)
.PHONY: examples
examples: vendor/installed $(README_TESTER_CMD)
$(README_TESTER_CMD) README.md
.PHONY: analyze
analyze: phpstan phpcs
.PHONY: phpstan
phpstan: vendor/installed $(PHPSTAN_CMD)
$(PHPSTAN_CMD) analyze -l 8 src
.PHONY: phpcs
phpcs: $(PHPCS_CMD)
$(PHPCS_CMD) src tests --standard=PSR2
composer.lock: composer.json
@echo composer.lock is not up to date
vendor/installed: composer.lock
$(COMPOSER_CMD) install
touch $@
$(PHPUNIT_CMD): vendor/installed
tools/installed:
$(PHIVE_CMD) install --force-accept-unsigned
touch $@
$(README_TESTER_CMD): tools/installed
$(PHPSTAN_CMD): tools/installed
$(PHPCS_CMD): tools/installed