forked from flackem/check_multi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.in
176 lines (149 loc) · 4.51 KB
/
Makefile.in
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#---
#--- Top level Makefile for check_multi
#---
#--- $Id$
#---
#---
#--- Src directories
SRC_PLUGINS=@srcdir@/plugins
SRC_PL_TEST=@srcdir@/plugins/t
SRC_CONTRIB=@srcdir@/contrib
SRC_CONFIG=@srcdir@/sample_config
#---
#--- user settings
prefix=@prefix@
exec_prefix=@exec_prefix@
CFGDIR=@sysconfdir@
LIBEXECDIR=@libexecdir@
DATADIR=@datarootdir@
CGIDIR=@sbindir@
INSTALL=@INSTALL@
VERSION=$(shell cut -d'_' -f 3 CM_VERSION | tr -d v)
@SET_MAKE@
#---
#--- none: make without option shows help
none:
@echo ""
@echo " make"
@echo ""
@echo " all do all subsequent options except install"
@echo ""
@echo " plugins create plugins"
@echo " config sample configuration"
@echo " contrib generate all contrib files"
@echo " test test plugins"
@echo ""
@echo " test run test scripts for plugins"
@echo " test-all run test scripts for all"
@echo ""
@echo ""
@echo " install install check_multi plugin"
@echo " install-plugins install check_multi plugin"
@echo " install-contrib install contribution files"
@echo " install-config install sample config"
@echo ""
@echo " fullinstall install everything"
@echo ""
#---
#--- combination of all targets
all:
@ cd $(SRC_PLUGINS) && $(MAKE) -s -e $@
@ cd $(SRC_PL_TEST) && $(MAKE) -s -e $@
@ cd $(SRC_CONTRIB) && $(MAKE) -s -e $@
@ cd $(SRC_CONFIG) && $(MAKE) -s -e $@
$(MAKE) hook
@echo ""
@echo " Make process finished"
@echo ""
@echo " *** Next step: make test ***"
@echo ""
@echo " or: make test-all (for all tests)"
@echo " or: make test-checkresults"
@echo " or: make test-extreme (random tag and macro values)"
@echo " or: make test-feeds-passive (requires Perl module XML::Simple)"
@echo " or: make test-livestatus (requires livestatus module and Perl Module Monitoring::Livestatus)"
@echo " or: make test-history"
@echo " or: make test-macros"
@echo " or: make test-perfdata"
@echo " or: make test-statusdat"
@echo ""
@echo " *** and then: make install ***"
@echo ""
@echo " - This installs the check_multi plugin"
@echo ""
#---
#--- here the different subsections follow
contrib:
@ cd $(SRC_CONTRIB) && $(MAKE) -e $@
config:
@ cd $(SRC_CONFIG) && $(MAKE) -e $@
plugins:
@ cd $(SRC_PLUGINS) && $(MAKE) -e $@
test-all:
@ cd $(SRC_PL_TEST) && $(MAKE) -e $@
test:
@ cd $(SRC_PL_TEST) && $(MAKE) -e $@
test-standard:
@ cd $(SRC_PL_TEST) && $(MAKE) -e $@
test-history:
@ cd $(SRC_PL_TEST) && $(MAKE) -e $@
test-macros:
@ cd $(SRC_PL_TEST) && $(MAKE) -e $@
test-perfdata:
@ cd $(SRC_PL_TEST) && $(MAKE) -e $@
test-checkresults:
@ cd $(SRC_PL_TEST) && $(MAKE) -e $@
test-feeds-passive:
@ cd $(SRC_PL_TEST) && $(MAKE) -e $@
test-livestatus:
@ cd $(SRC_PL_TEST) && $(MAKE) -e $@
test-statusdat:
@ cd $(SRC_PL_TEST) && $(MAKE) -e $@
test-extreme:
@ cd $(SRC_PL_TEST) && $(MAKE) -e $@
test-timeout:
@ cd $(SRC_PL_TEST) && $(MAKE) -e $@
test-test:
@ cd $(SRC_PL_TEST) && $(MAKE) -e $@
hook:
@ test -d .git && test -h .git/hooks/pre-commit || ( cd .git/hooks; rm -f pre-commit; ln -s ../../mk_VERSION pre-commit )
#---
#--- install sections
install:
@ cd $(SRC_PLUGINS) && $(MAKE) -e $@
@echo ""
@echo "Please run 'make install-contrib' to install contrib files"
@echo "Please run 'make install-config' to install sample config files"
@echo ""
install-contrib:
@ cd $(SRC_CONTRIB) && $(MAKE) -e $@
install-config:
@ cd $(SRC_CONFIG) && $(MAKE) -e $@
install-plugins:
@ cd $(SRC_PLUGINS) && $(MAKE) -e $@
fullinstall: install-plugins install-contrib install-config
#---
#--- cleanup sections
clean:
@ cd $(SRC_PLUGINS) && $(MAKE) -e $@
@ cd $(SRC_PL_TEST) && $(MAKE) -e $@
@ cd $(SRC_CONTRIB) && $(MAKE) -e $@
@ cd $(SRC_CONFIG) && $(MAKE) -e $@
#-rm -f *.cfg core
#-rm -f *~ *.*~ */*~ */*.*~
@ -rm -rf autom4te.cache
@ $(MAKE) -e distclean
distclean:
@ cd $(SRC_PLUGINS) && $(MAKE) -e $@
@ cd $(SRC_PL_TEST) && $(MAKE) -e $@
@ cd $(SRC_CONTRIB) && $(MAKE) -e $@
@ cd $(SRC_CONFIG) && $(MAKE) -e $@
@ -rm -f Makefile config.status config.log subst
devclean: distclean
version:
NEWVERSION=$$(dialog --stdout --inputbox "New Version:" 0 0 "$(VERSION)"); \
if [ -n "$$NEWVERSION" ] && [ "$$NEWVERSION" != "$(VERSION)" ]; then \
sed -i "s/===== Changelog =====[\n\t]*/===== Changelog =====\n\n**$$NEWVERSION**\t$(shell date)/m" Changelog; \
sed -i "s/$(VERSION)/$$NEWVERSION/" CM_VERSION configure.ac ;\
fi
#$(MAKE) docs