-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
66 lines (47 loc) · 1.33 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
COMPOSER_CMD=composer
PHIVE_CMD=phive
BOX_CMD=tools/box
PHPSTAN_CMD=tools/phpstan
PHPCS_CMD=tools/phpcs
GIROAPP_INSTALLED:=$(shell command -v giroapp 2> /dev/null)
.DEFAULT_GOAL=all
TARGET=giroapp-mailer-plugin.phar
SRC_FILES:=$(shell find src/ -type f -name '*.php')
$(TARGET): stub.php $(SRC_FILES) box.json composer.lock $(BOX_CMD)
$(COMPOSER_CMD) install --prefer-dist --no-dev
$(BOX_CMD) compile
$(COMPOSER_CMD) install
.PHONY: all build clean
all: phpstan phpcs build
build: $(TARGET)
clean:
rm -f $(TARGET)
rm -rf vendor
rm -rf tools
.PHONY: install uninstall
install: $(TARGET)
ifndef GIROAPP_INSTALLED
$(error "giroapp is not available, please install to continue")
endif
cp $< $(shell giroapp conf plugins_dir)
uninstall:
ifndef GIROAPP_INSTALLED
$(error "giroapp is not available, please install to continue")
endif
rm -f $(shell giroapp conf plugins_dir)/$(TARGET)
.PHONY: phpstan phpcs
phpstan: vendor/installed $(PHPSTAN_CMD)
$(PHPSTAN_CMD) analyze -l 8 src stub.php
phpcs: vendor/installed $(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
touch $@
$(BOX_CMD): tools/installed
$(PHPSTAN_CMD): tools/installed
$(PHPCS_CMD): tools/installed