-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
22 lines (18 loc) · 927 Bytes
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/make
help:
@perl -e '$(HELP_ACTION)' $(MAKEFILE_LIST)
test: ##@test PHPUnit tests
@php ./vendor/bin/phpunit --bootstrap vendor/autoload.php --testdox tests
# ------------------------------------------------
# Add the following 'help' target to your makefile, add help text after each target name starting with '\#\#'
# A category can be added with @category
GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
WHITE := $(shell tput -Txterm setaf 7)
RESET := $(shell tput -Txterm sgr0)
HELP_ACTION = \
%help; while(<>) { push @{$$help{$$2 // 'options'}}, [$$1, $$3] if /^([a-zA-Z\-_]+)\s*:.*\#\#(?:@([a-zA-Z\-]+))?\s(.*)$$/ }; \
print "usage: make [target]\n\n"; for (sort keys %help) { print "${WHITE}$$_:${RESET}\n"; \
for (@{$$help{$$_}}) { $$sep = " " x (32 - length $$_->[0]); print " ${YELLOW}$$_->[0]${RESET}$$sep${GREEN}$$_->[1]${RESET}\n"; }; \
print "\n"; }
# -eof-