-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
27 lines (21 loc) · 974 Bytes
/
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
#!/usr/bin/make
help:
@perl -e '$(HELP_ACTION)' $(MAKEFILE_LIST)
update: ##@update Update project from GIT
@echo Updating project from GIT
git pull
phpunit: ##@localhost Make tests
@./vendor/bin/phpunit
# ------------------------------------------------
# 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-