forked from yeti-switch/yeti-lb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (39 loc) · 1.13 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
pkg_name = yeti-lb
lintian_flag := $(if $(lintian),--lintian,--no-lintian)
debian_host_release != lsb_release -sc
#Logging functions
define info
echo -e '\n\e[33m> msg \e[39m\n'
endef
define err
echo -e '\n\e[31m> msg \e[39m\n'
endef
all:
@echo "make all"
install:
@$(info:msg=Installging)
@echo "DESTDIR = '$(DESTDIR)'"
make -C src install
@$(info:msg=install rsyslogd cfg file)
@install -v -m0644 -D debian/$(pkg_name).rsyslog $(DESTDIR)/etc/rsyslog.d/$(pkg_name).conf
clean:
make -C debian clean
.PHONY: package
package: chlog
@$(info:msg=Building package)
dpkg-buildpackage -us -uc -b
.PHONY: chlog
chlog: clean-chlog
ifeq "$(auto_chlog)" "no"
@$(info:msg=Skipping changelog generation)
else
@$(info:msg=Generating changelog Supply auto_chlog=no to skip.)
@which changelog-gen || { $(err:msg=Failed to generate changelog. Did you install git-changelog package?) && false; }
changelog-gen -p "$(pkg_name)" -d "$(debian_host_release)" -A "s/_/~/g" "s/-master/~master/" "s/-rc/~rc/"
endif
.PHONY: clean-chlog
clean-chlog:
ifneq "$(auto_chlog)" "no"
@$(info:msg=Removing changelog)
@rm -vf debian/changelog
endif