-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
65 lines (48 loc) · 1.23 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
64
65
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
TARGET=src/Format/FormatFactory.php
DEV_FILES:=$(shell find dev/ -type f -name '*')
.DEFAULT_GOAL=all
.PHONY: all
all: build test analyze
.PHONY: clean
clean:
rm composer.lock
rm -rf vendor
rm -rf tools
.PHONY: build
build: $(TARGET)
$(TARGET): vendor/installed $(DEV_FILES)
php dev/build_formats.php
.PHONY: test
test: phpunit docs
.PHONY: phpunit
phpunit: vendor/installed $(PHPUNIT_CMD)
$(PHPUNIT_CMD)
.PHONY: docs
docs: 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)
composer.lock: composer.json
@echo composer.lock is not up to date
vendor/installed: composer.lock
$(COMPOSER_CMD) install
touch $@
tools/installed:
$(PHIVE_CMD) install --force-accept-unsigned --trust-gpg-keys 4AA394086372C20A,CF1A108D0E7AE720,31C7E470E2138192
touch $@
$(README_TESTER_CMD): tools/installed
$(PHPSTAN_CMD): tools/installed
$(PHPCS_CMD): tools/installed
$(PHPUNIT_CMD): vendor/installed