forked from munin-monitoring/munin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
101 lines (76 loc) · 2.35 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# This Makefile provides convenience targets for common build/test/install cases, as well as rules
# for the release manager.
# In the interest of keeping this Makefile simple, it does not attempt to provide the flexibility
# provided by using Build.PL directly. (See perldoc Module::Build).
# Defaults/paths. Allows $(CONFIG) to be overridden by
# make command line
DEFAULTS = Makefile.config
CONFIG = Makefile.config
include $(DEFAULTS)
include $(CONFIG)
# the perl script is used for most perl related activities
BUILD_SCRIPT = ./Build
.PHONY: default
default: build
.PHONY: help
help:
@echo "Build targets:"
@echo " build"
@echo " clean"
@echo " doc"
@echo " install"
@echo " tar"
@echo
@echo "Test targets:"
@echo " test"
@echo " testcover"
@echo " testpod"
@echo " testpodcoverage"
@echo
.PHONY: build
build: $(BUILD_SCRIPT)
.PHONY: doc
doc:
$(MAKE) -C doc html
.PHONY: install
install: $(BUILD_SCRIPT)
"$(BUILD_SCRIPT)" install --destdir=$(DESTDIR) --verbose
@# various directory placeholders (e.g. "@@SPOOLDIR@@") need to be replaced
grep -rl --null "@@" "$(DESTDIR)" | xargs -0 sed -i \
-e "$$(perl -I lib -M"Munin::Common::Defaults" \
-e "Munin::Common::Defaults->print_as_sed_substitutions();")"
.PHONY: clean
clean: $(BUILD_SCRIPT)
"$(BUILD_SCRIPT)" realclean
rm -rf _stage
rm -f MANIFEST META.json META.yml
$(MAKE) -C doc clean
##############################
# perl module
$(BUILD_SCRIPT): Build.PL
$(PERL) Build.PL --destdir=$(DESTDIR) --installdirs=$(INSTALLDIRS) --verbose
######################################################################
# testing
.PHONY: test
test: $(BUILD_SCRIPT)
"$(BUILD_SCRIPT)" test
.PHONY: testcover
testcover: $(BUILD_SCRIPT)
"$(BUILD_SCRIPT)" testcover
.PHONY: testpod
testpod: $(BUILD_SCRIPT)
"$(BUILD_SCRIPT)" testpod
.PHONY: testpodcoverage
testpodcoverage: $(BUILD_SCRIPT)
"$(BUILD_SCRIPT)" testpodcoverage
######################################################################
# Rules for the release manager
RELEASE := $(shell $(CURDIR)/getversion)
.PHONY: tar
tar:
git archive --prefix=munin-$(RELEASE)/ --format=tar --output ../munin-$(RELEASE).tar HEAD
mkdir -p munin-$(RELEASE)/
echo $(RELEASE) > munin-$(RELEASE)/RELEASE
tar rf ../munin-$(RELEASE).tar --owner=root --group=root munin-$(RELEASE)/RELEASE
rm -rf munin-$(RELEASE)
gzip -f -9 ../munin-$(RELEASE).tar