-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
48 lines (39 loc) · 1.78 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
#!/usr/bin/make
PROJECT = nginx-site
PATH_PROJECT = $(DESTDIR)/usr/local/bin
help:
@perl -e '$(HELP_ACTION)' $(MAKEFILE_LIST)
install: ##@system Install package. Don't run it manually!!!
@echo Installing...
install -d $(PATH_PROJECT)
cp src/nginx_site.sh $(PATH_PROJECT)/nginx_site
chmod +x $(PATH_PROJECT)/nginx_site
update: ##@build Update project from GIT
@echo Updating project from GIT
git pull --no-rebase
build: ##@build Build project to DEB Package
@echo Building project to DEB-package
@dpkg-buildpackage -rfakeroot --no-sign
dchr: ##@development Publish release
@dch --controlmaint --release --distribution unstable
dchv: ##@development Append release
@export DEBEMAIL="karel.wintersky@yandex.ru" && \
export DEBFULLNAME="Karel Wintersky" && \
echo "$(YELLOW)------------------ Previous version header: ------------------$(GREEN)" && \
head -n 3 debian/changelog && \
echo "$(YELLOW)--------------------------------------------------------------$(RESET)" && \
read -p "Next version: " VERSION && \
dch --controlmaint -v $$VERSION
# ------------------------------------------------
# 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-