Skip to content

Commit 77c2d69

Browse files
authored
Various Makefile tweaks (#112)
- More robust rules to ensure any command works properly in any situation - Do not rebuild the PHAR if already exists - Do not erase PHPStorm settings when doing a `make clean`
1 parent 2e86270 commit 77c2d69

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

Makefile

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ PHPUNIT=vendor/bin/phpunit
33
PHPSCOPER=bin/php-scoper.phar
44
BLACKFIRE=blackfire
55

6+
67
.DEFAULT_GOAL := help
7-
.PHONY: build test tu tc e2e tb
8+
.PHONY: build test
89

910

1011
help:
@@ -17,7 +18,7 @@ help:
1718

1819
clean: ## Clean all created artifacts
1920
clean:
20-
git clean -fdx
21+
git clean --exclude=.idea/ -fdx
2122

2223
build: ## Build the PHAR
2324
build: bin/php-scoper src vendor vendor-bin/box/vendor scoper.inc.php
@@ -49,11 +50,11 @@ test: ## Run all the tests
4950
test: tu e2e
5051

5152
tu: ## Run PHPUnit tests
52-
tu: vendor
53+
tu: vendor/bin/phpunit
5354
php -d zend.enable_gc=0 $(PHPUNIT)
5455

5556
tc: ## Run PHPUnit tests with test coverage
56-
tc: vendor
57+
tc: vendor/bin/phpunit
5758
phpdbg -qrr -d zend.enable_gc=0 $(PHPUNIT) --coverage-html=dist/coverage --coverage-text
5859

5960
e2e: ## Run end-to-end tests
@@ -108,7 +109,13 @@ tb: vendor
108109
vendor: composer.lock
109110
composer install
110111

111-
vendor-bin/box/vendor: vendor-bin/box/composer.lock
112+
vendor/bamarni: composer.lock
113+
composer install
114+
115+
vendor/bin/phpunit: composer.lock
116+
composer install
117+
118+
vendor-bin/box/vendor: vendor-bin/box/composer.lock vendor/bamarni
112119
composer bin all install
113120

114121
fixtures/set005/vendor: fixtures/set005/composer.lock
@@ -120,11 +127,14 @@ fixtures/set011/vendor: fixtures/set011/vendor
120127
composer.lock: composer.json
121128
@echo composer.lock is not up to date.
122129

130+
vendor-bin/box/composer.lock: composer.lock
131+
composer install
132+
123133
fixtures/set005/composer.lock: fixtures/set005/composer.json
124134
@echo fixtures/set005/composer.lock is not up to date.
125135

126136
fixtures/set011/composer.lock: fixtures/set011/composer.json
127137
@echo fixtures/set011/composer.lock is not up to date.
128138

129-
bin/php-scoper.phar: bin/php-scoper src vendor vendor-bin/box/vendor scoper.inc.php
139+
bin/php-scoper.phar:
130140
$(MAKE) build

0 commit comments

Comments
 (0)