-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (43 loc) · 1.32 KB
/
Makefile
File metadata and controls
59 lines (43 loc) · 1.32 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
.DELETE_ON_ERROR :
PHP74 = docker run -v $(shell pwd):/data -w /data $(shell cat docker/php74.image)
JSMIN_SOURCES := $(wildcard vendor/kiboit/jsmin-php/src/JSMin/*.php)
JSMIN_TARGETS := $(patsubst vendor/kiboit/jsmin-php/src/%,src/%,$(JSMIN_SOURCES))
ifdef FILTER
PHPUNIT_ARGS := --filter="$(FILTER)"
endif
.PHONY : all
all : build/phast.php
.PHONY : watch
watch :
git ls-files src test | entr -c -r $(MAKE) -s test74
.PHONY : test
test : test74
.PHONY : test74
test74 : all docker/php74.image
$(PHP74) vendor/bin/phpunit $(PHPUNIT_ARGS)
.PHONY : test-local
test-local : all
vendor/bin/phpunit
.PHONY : dist
dist : all
bin/package
.PHONY : clean
clean :
rm -rf build docker/php74.image
.PHONY : format
format : node_modules
fd -g '*.js' -t f --ignore-file .format_exclude -X node_modules/.bin/prettier -w
build/phast.php : vendor/autoload.php node_modules $(JSMIN_TARGETS) $(shell git ls-files src)
bin/compile $(dir $@)
src/JSMin/% : vendor/kiboit/jsmin-php/src/JSMin/% | vendor/autoload.php
@mkdir -p $(dir $@)
cat $< | perl -p -e 's~(\bnamespace\s+)(?=JSMin\b)~$$1Kibo\\Phast\\~g' > $@
vendor/autoload.php : composer.json composer.lock
composer install
touch vendor/autoload.php
docker/%.image : docker/% docker/entrypoint
docker build --pull --iidfile $@~ -f $< docker
mv $@~ $@
node_modules : yarn.lock
yarn
touch $@