-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
132 lines (97 loc) · 3.9 KB
/
Copy pathMakefile
File metadata and controls
132 lines (97 loc) · 3.9 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Makefile for PHP Project
#
# Copyright (c) 2019 USAMI Kenta
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
# License: MIT
PHP ?= php
COMPOSER = tools/composer.phar
AUTOLOAD_PHP = vendor/autoload.php
RM = rm -f
APP_ENV =
.DEFAULT_GOAL := $(AUTOLOAD_PHP)
$(COMPOSER):
tools/setup-composer
composer.lock: $(COMPOSER) composer.json
$(PHP) $(COMPOSER) install --no-progress
$(AUTOLOAD_PHP): composer.lock
tools/.phan/vendor/bin/phan:
$(PHP) $(COMPOSER) install -d tools/.phan
tools/.php-cs-fixer/vendor/bin/php-cs-fixer:
$(PHP) $(COMPOSER) install -d tools/.php-cs-fixer
tools/.phpdocumentor/vendor/bin/phpdoc:
-$(RM) tools/.phpdocumentor/composer.lock # workaround
$(PHP) $(COMPOSER) install -d tools/.phpdocumentor
tools/.phpstan/vendor/bin/phpstan:
$(PHP) $(COMPOSER) install -d tools/.phpstan
tools/.psalm/vendor/bin/psalm:
$(PHP) $(COMPOSER) install -d tools/.psalm
tools/deptrac: tools/.deptrac/vendor/bin/deptrac
(cd tools; ln -sf .deptrac/vendor/bin/deptrac .)
tools/phan: tools/.phan/vendor/bin/phan
(cd tools; ln -sf .phan/vendor/bin/phan .)
tools/php-cs-fixer: tools/.php-cs-fixer/vendor/bin/php-cs-fixer
(cd tools; ln -sf .php-cs-fixer/vendor/bin/php-cs-fixer .)
tools/phpdoc: tools/.phpdocumentor/vendor/bin/phpdoc
(cd tools; ln -sf .phpdocumentor/vendor/bin/phpdoc .)
tools/phpstan: tools/.phpstan/vendor/bin/phpstan
(cd tools; ln -sf .phpstan/vendor/bin/phpstan .)
tools/psalm: tools/.psalm/vendor/bin/psalm
(cd tools; ln -sf .psalm/vendor/bin/psalm .)
.PHONY: analyse composer composer-no-dev clean clobber deptrac doc fix phan phpdoc phpstan-no-dev phpstan psalm setup setup-tools test
analyse-no-dev: phan phpstan-no-dev psalm-no-dev
analyse: phan phpstan psalm deptrac
composer: $(AUTOLOAD_PHP)
composer-no-dev:
$(PHP) $(COMPOSER) install --no-dev --optimize-autoloader --no-progress
clobber: clean
-$(RM) tools/*.phar tools/phan tools/php-cs-fixer tools/phpstan tools/psalm
-$(RM) -r tools/.phan/composer.lock tools/.phan/vendor
-$(RM) -r tools/.php-cs-fixer/composer.lock tools/.php-cs-fixer/vendor
-$(RM) -r tools/.phpdocumentor/composer.lock tools/.phpdocumentor/vendor
-$(RM) -r tools/.phpstan/composer.lock tools/.phpstan/vendor
-$(RM) -r tools/.psalm/composer.lock tools/.psalm/vendor
-$(RM) -r vendor
-$(RM) composer.lock
clean:
-$(RM) -r build
-$(RM) .php_cs.cache
deptrac: tools/deptrac
-$(PHP) tools/deptrac
doc: phpdoc
fix: tools/php-cs-fixer
$(PHP) tools/php-cs-fixer fix
phan: tools/phan
-$(PHP) tools/phan
phpdoc: tools/phpdoc
APP_ENV=$(APP_ENV) $(PHP) tools/phpdoc
phpstan-no-dev: tools/phpstan
-$(PHP) tools/phpstan analyse src/ --no-progress
phpstan: tools/phpstan
-$(PHP) tools/phpstan analyse --no-progress
psalm-no-dev: tools/psalm
-$(PHP) tools/psalm src/
psalm: tools/psalm
-$(PHP) tools/psalm
setup: $(COMPOSER)
setup-doc: setup tools/phpdoc
setup-tools: setup tools/php-cs-fixer tools/phan tools/phpstan tools/psalm
test: vendor/bin/phpunit
$(PHP) vendor/bin/phpunit