-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (46 loc) · 1.4 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
BEHAT:=$(shell command -v behat 2> /dev/null)
PHPSPEC:=$(shell command -v phpspec 2> /dev/null)
PHPSTAN:=$(shell command -v phpstan 2> /dev/null)
PHPCS:=$(shell command -v phpcs 2> /dev/null)
PHPEG:=$(shell command -v phpeg 2> /dev/null)
COMPOSER_CMD:=$(shell command -v composer 2> /dev/null)
.DEFAULT_GOAL=all
GRAMMAR=src/LineParser/Grammar.php
$(GRAMMAR): src/LineParser/Grammar.peg composer.lock
ifndef PHPEG
$(error "phpeg is not available, please install to continue")
endif
phpeg generate $<
.PHONY: all clean
all: phpspec behat phpstan phpcs
clean:
rm -f $(GRAMMAR)
rm -rf vendor
rm -f composer.lock
.PHONY: phpspec behat phpstan phpcs
phpspec: composer.lock $(GRAMMAR)
ifndef PHPSPEC
$(error "phpspec is not available, please install to continue")
endif
phpspec run
behat: composer.lock $(GRAMMAR)
ifndef BEHAT
$(error "behat is not available, please install to continue")
endif
behat --stop-on-failure
phpstan: composer.lock
ifndef PHPSTAN
$(error "phpstan is not available, please install to continue")
endif
phpstan analyze -c phpstan.neon -l 7 src
phpcs: composer.lock
ifndef PHPCS
$(error "phpcs is not available, please install to continue")
endif
phpcs src --standard=PSR2 --ignore=$(GRAMMAR)
phpcs spec --standard=spec/ruleset.xml
composer.lock: composer.json
ifndef COMPOSER_CMD
$(error "composer is not available, please install to continue")
endif
composer install