-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
96 lines (73 loc) · 2.14 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
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
.PHONY: all config-files setup setup-db resources clean
RESOURCES := \
resources/js/fakedata.js \
resources/js/mynumber.js \
resources/js/zipsearch.js \
web/favicon \
web/favicon.ico
.PHONY: all
all: setup
.PHONY: config-files
config-files: config/cookie-secret.php config/git-revision.php
.PHONY: setup
setup: composer.phar config-files vendor node_modules setup-db resources
.PHONY: setup-db
setup-db: composer.phar config-files vendor
./yii migrate/up --interactive=0
composer.phar:
ifeq (, $(shell which composer 2>/dev/null))
curl -fsSL 'https://getcomposer.org/installer' | php -- --stable
else
ln -sf `which composer` $@
endif
vendor: composer.lock composer.phar
php composer.phar install --prefer-dist
@touch $@
node_modules: package-lock.json
npm clean-install
@touch $@
.PHONY: clean
clean:
rm -rf \
$(RESOURCES) \
.browserslistrc \
composer.phar \
node_modules \
vendor
.PHONY: resources
resources: $(RESOURCES)
%.js: %.es node_modules .browserslistrc
npx babel $< | npx terser -c -m -f ascii_only=true -o $@
web/favicon: node_modules
ln -sf ../node_modules/@fetus-hina/fetus.css/dist/favicon $@
@touch $@
web/favicon.ico: web/favicon
ln -sf favicon/favicon.ico $@
@touch $@
config/cookie-secret.php:
php setup/config-cookie.php > $@
.PHONY: config/git-revision.php
config/git-revision.php:
php setup/git-revison.php > $@
.PHONY: check-style
check-style: check-style-php check-style-js
.PHONY: check-style-php
check-style-php: check-style-phpcs check-style-phpstan
.PHONY: check-style-phpcs
check-style-phpcs: vendor
./vendor/bin/phpcs -p
.PHONY: check-style-phpstan
check-style-phpstan: config-files vendor
./vendor/bin/phpstan analyze --memory-limit=1G || true
.PHONY: check-style-js
check-style-js: node_modules
npx semistandard 'resources/**/*.es'
.PHONY: test
test: composer.phar config-files vendor node_modules resources
./tests/bin/yii migrate/fresh --interactive=0 --compact=1
./vendor/bin/codecept run unit
.browserslistrc:
curl -fsSL -o $@ 'https://raw.githubusercontent.com/twbs/bootstrap/v5.1.0/.browserslistrc'
bin/dep:
curl -fsSL -o $@ 'https://deployer.org/releases/v6.8.0/deployer.phar'
chmod +x $@