forked from TheFox/phpchat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
105 lines (80 loc) · 2.27 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
97
98
99
100
101
102
103
104
105
RM = rm -rf
MKDIR = mkdir -p
GZIP = gzip
MV = mv -i
CP = cp -rp
CHMOD = chmod
MKDIR = mkdir -p
VENDOR = vendor
PHPUNIT = vendor/bin/phpunit
PHPDOX = vendor/bin/phpdox
PHPLOC = vendor/bin/phploc
PHPMD = vendor/bin/phpmd
COMPOSER = ./composer.phar
COMPOSER_DEV ?=
COMPOSER_INTERACTION ?= --no-interaction
COMPOSER_PREFER_SOURCE ?=
SECURITY_CHECKER = vendor/bin/security-checker
.PHONY: all update install_release release test test_phpcs test_phpunit test_phpunit_cc test_security test_phpmd test_clean clean clean_nodes clean_data clean_release clean_all docs
all: install test_phpunit
install: $(VENDOR)
$(CHMOD) 700 ./application.php
install_release: $(COMPOSER)
./composer.phar selfupdate
$(MAKE) install COMPOSER_DEV=--no-dev
php bootstrap.php
composer.phar:
curl -sS https://getcomposer.org/installer | php
$(CHMOD) 700 ./composer.phar
./composer.phar install
php bootstrap.php
release: release.sh
./release.sh
test: test_phpunit
test_phpunit: $(PHPUNIT) phpunit.xml test_data
TEST=true $(PHPUNIT) $(PHPUNIT_COVERAGE_HTML) $(PHPUNIT_COVERAGE_XML) $(PHPUNIT_COVERAGE_CLOVER)
$(MAKE) test_clean
test_phpunit_cc: build
$(MAKE) test_phpunit PHPUNIT_COVERAGE_HTML="--coverage-html build/report"
test_clean:
$(RM) tests/testdir_*
$(RM) tests/testfile_*
$(RM) tests/*.yml
test_phpmd:
$(PHPMD) src,tests text phpmd.xml
test_clean:
$(RM) test_data
clean: test_clean
$(RM) composer.lock $(COMPOSER)
$(RM) vendor/*
$(RM) vendor
clean_nodes:
$(RM) data/table.yml
$(RM) data/node_*.yml
$(RM) data/nodesnewdb.yml
$(RM) data/addressbook.yml
clean_data:
$(RM) data/*
$(RM) data
clean_release: clean_data
$(CHMOD) a-rwx,u+rw id_rsa.prv id_rsa.pub
$(RM) id_rsa.prv id_rsa.pub
$(RM) settings.yml
$(RM) composer.lock $(COMPOSER)
$(RM) log pid
clean_all: clean clean_data clean_release
docs: build test_phpcs
$(MAKE) test_phpunit PHPUNIT_COVERAGE_XML="--coverage-xml build/coverage"
$(PHPLOC) --count-tests --progress --log-xml=build/logs/phploc.xml src
$(VENDOR): $(COMPOSER)
$(COMPOSER) install $(COMPOSER_PREFER_SOURCE) $(COMPOSER_INTERACTION) $(COMPOSER_DEV)
$(COMPOSER):
curl -sS https://getcomposer.org/installer | php
$(CHMOD) u=rwx,go=rx $(COMPOSER)
$(PHPUNIT): $(VENDOR)
test_data:
$(MKDIR) test_data
build:
$(MKDIR) build
$(MKDIR) build/logs
$(CHMOD) u=rwx,go-rwx build