-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.am
241 lines (208 loc) · 11 KB
/
Makefile.am
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# top-level Makefile for NUT
# include directory for aclocal
ACLOCAL_AMFLAGS = -I m4
# subdirectories to build and distribute. The order matters, as
# several subdirectories depend on stuff in "common" or tools being built first
SUBDIRS = include common clients conf data drivers tools docs \
lib scripts server tests
# COPYING is included automatically.
EXTRA_DIST = INSTALL.nut LICENSE-GPL2 LICENSE-GPL3 MAINTAINERS UPGRADING
# ----------------------------------------------------------------------
# flags to pass to ./configure when calling "make distcheck" and "make
# distcheck-light". Try to check as many features as possible! Also
# need to give augeas-lenses-dir, hotplug-dir and udev-dir, so that
# staged install does not fail.
DISTCHECK_FLAGS = --with-all --with-ssl --with-doc=auto
DISTCHECK_LIGHT_FLAGS = --with-all=auto --with-ssl=auto --with-doc=auto
DISTCHECK_LIGHT_MAN_FLAGS = --with-all=auto --with-ssl=auto --with-doc=man
DISTCHECK_VALGRIND_FLAGS = --with-all=auto --with-ssl=auto --with-doc=skip --with-valgrind CXXFLAGS='$(CXXFLAGS) -g' CFLAGS='$(CFLAGS) -g'
# The checks for DMF builds involve several distinct combinations of options
# that the recipes should accept as valid. We generally skip items tested
# previously, since the rebuild-tests take a lot of time even so.
DISTCHECK_DMF_COMMON_FLAGS = --with-all=no --with-dmf=yes --with-snmp=yes --with-neon=yes --with-dev=yes --with-snmp_dmf=yes --with-doc=skip -C
DISTCHECK_DMF_NOREGEN_FLAGS = --with-dmfsnmp-regenerate=no --with-dmfnutscan-regenerate=no --with-dmfsnmp-validate=no --with-dmfnutscan-validate=no
DISTCHECK_DMF_WITH_LTDL_YES_FLAGS = $(DISTCHECK_DMF_COMMON_FLAGS) $(DISTCHECK_DMF_NOREGEN_FLAGS) --with-libltdl=yes
DISTCHECK_DMF_WITH_LTDL_NO_FLAGS = $(DISTCHECK_DMF_COMMON_FLAGS) $(DISTCHECK_DMF_NOREGEN_FLAGS) --with-libltdl=no
DISTCHECK_DMF_WITH_LUA_YES_FLAGS = $(DISTCHECK_DMF_COMMON_FLAGS) $(DISTCHECK_DMF_NOREGEN_FLAGS) --with-lua=yes --with-snmp_dmf_lua=yes
DISTCHECK_DMF_WITH_LUA_YESNO_FLAGS = $(DISTCHECK_DMF_COMMON_FLAGS) $(DISTCHECK_DMF_NOREGEN_FLAGS) --with-lua=yes --with-snmp_dmf_lua=no --with-dmf_lua=no
DISTCHECK_DMF_WITH_LUA_NO_FLAGS = $(DISTCHECK_DMF_COMMON_FLAGS) $(DISTCHECK_DMF_NOREGEN_FLAGS) --with-lua=no --with-snmp_dmf_lua=no
DISTCHECK_DMF_WITH_REGEN_NO_FLAGS = $(DISTCHECK_DMF_COMMON_FLAGS) $(DISTCHECK_DMF_NOREGEN_FLAGS)
DISTCHECK_DMF_WITH_REGEN_YES_FLAGS = $(DISTCHECK_DMF_COMMON_FLAGS) --with-dmfsnmp-regenerate=yes --with-dmfnutscan-regenerate=yes --with-dmfsnmp-validate=yes --with-dmfnutscan-validate=yes
# Enable all DMF-related options, including again generation and
# validation of DMF files from C sources
DISTCHECK_DMF_ALL = $(DISTCHECK_DMF_WITH_REGEN_YES_FLAGS) --with-snmp_dmf_lua=yes --with-libltdl=yes
# Also have a way to test legacy code structure with no DMF support built in
DISTCHECK_DMF_NO = --with-all=auto --with-dmf=no --with-doc=skip --with-dev=yes -C
DISTCHECK_CONFIGURE_FLAGS = ${DISTCHECK_FLAGS} \
--with-systemdsystemunitdir='$${prefix}/lib/systemd/system' \
--with-augeas-lenses-dir='$${prefix}/usr/share/augeas/lenses' \
--with-hotplug-dir='$${prefix}/etc/hotplug' \
--with-udev-dir='$${prefix}/etc/udev' \
--with-devd-dir='$${prefix}/etc/devd'
distcheck-light:
$(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_LIGHT_FLAGS)" distcheck
distcheck-light-man:
$(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_LIGHT_MAN_FLAGS)" distcheck
# Make a distcheck (and check in particular) with enabled valgrind and debug info
memcheck distcheck-valgrind:
$(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_VALGRIND_FLAGS)" distcheck
distcheck-dmf-features-REGEN_NO:
$(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_DMF_WITH_REGEN_NO_FLAGS)" distcheck || { RES=$$? ; echo "FAILED with DISTCHECK_DMF_WITH_REGEN_NO_FLAGS" >&2; exit $$RES; }
echo "PASSED $@ suite!"
distcheck-dmf-features-LTDL_YES:
$(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_DMF_WITH_LTDL_YES_FLAGS)" distcheck || { RES=$$? ; echo "FAILED with DISTCHECK_DMF_WITH_LTDL_YES_FLAGS" >&2; exit $$RES; }
echo "PASSED $@ suite!"
distcheck-dmf-features-LTDL_NO:
$(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_DMF_WITH_LTDL_NO_FLAGS)" distcheck || { RES=$$? ; echo "FAILED with DISTCHECK_DMF_WITH_LTDL_NO_FLAGS" >&2; exit $$RES; }
echo "PASSED $@ suite!"
distcheck-dmf-features-LUA_YES:
$(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_DMF_WITH_LUA_YES_FLAGS)" distcheck || { RES=$$? ; echo "FAILED with DISTCHECK_DMF_WITH_LUA_YES_FLAGS" >&2; exit $$RES; }
echo "PASSED $@ suite!"
distcheck-dmf-features-LUA_YESNO:
$(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_DMF_WITH_LUA_YESNO_FLAGS)" distcheck || { RES=$$? ; echo "FAILED with DISTCHECK_DMF_WITH_LUA_YESNO_FLAGS" >&2; exit $$RES; }
echo "PASSED $@ suite!"
distcheck-dmf-features-LUA_NO:
$(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_DMF_WITH_LUA_NO_FLAGS)" distcheck || { RES=$$? ; echo "FAILED with DISTCHECK_DMF_WITH_LUA_NO_FLAGS" >&2; exit $$RES; }
echo "PASSED $@ suite!"
distcheck-dmf-features-REGEN_YES:
$(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_DMF_WITH_REGEN_YES_FLAGS)" distcheck || { RES=$$? ; echo "FAILED with DISTCHECK_DMF_WITH_REGEN_YES_FLAGS" >&2; exit $$RES; }
echo "PASSED $@ suite!"
# Intentionally done as one rule, to avoid parallelization and conflicts
distcheck-dmf-features:
$(MAKE) $(AM_MAKEFLAGS) distcheck-dmf-features-REGEN_NO
$(MAKE) $(AM_MAKEFLAGS) distcheck-dmf-features-LTDL_YES
$(MAKE) $(AM_MAKEFLAGS) distcheck-dmf-features-LTDL_NO
$(MAKE) $(AM_MAKEFLAGS) distcheck-dmf-features-LUA_YES
$(MAKE) $(AM_MAKEFLAGS) distcheck-dmf-features-LUA_YESNO
$(MAKE) $(AM_MAKEFLAGS) distcheck-dmf-features-LUA_NO
$(MAKE) $(AM_MAKEFLAGS) distcheck-dmf-features-REGEN_YES
echo "PASSED $@ suite!"
# Just test the common useful case of enabling (requiring) everything
# related to DMF at once
distcheck-dmf-all-yes:
$(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_DMF_ALL)" distcheck || { RES=$$? ; echo "FAILED with DISTCHECK_DMF_ALL" >&2; exit $$RES; }
echo "PASSED $@ suite!"
distcheck-dmf-no:
$(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_DMF_NO)" distcheck || { RES=$$? ; echo "FAILED with DISTCHECK_DMF_NO" >&2; exit $$RES; }
echo "PASSED $@ suite!"
distcheck-dmf-warnings:
$(MAKE) $(AM_MAKEFLAGS) CFLAGS="$(CFLAGS) -Werror -Wall" DISTCHECK_FLAGS="$(DISTCHECK_DMF_ALL)" distcheck
echo "PASSED $@ suite!"
distcheck-dmf:
$(MAKE) $(AM_MAKEFLAGS) distcheck-light-man
$(MAKE) $(AM_MAKEFLAGS) distcheck-dmf-features
$(MAKE) $(AM_MAKEFLAGS) distcheck-dmf-warnings
echo "PASSED $@ suite!"
# workaround the dist generated files that are also part of the distribution
# Note that distcleancheck is disabled for now, while waiting for a proper
# solution, that do not break older unix systems
#distcleancheck_listfiles = \
# find . -type f -exec sh -c 'test -f $(srcdir)/{} || echo {}' ';'
distcleancheck:
@:
# Hook the documentation building and validating recipes
# Note: these are optionally available (as determined during configure runs)
spellcheck spellcheck-interactive:
@RES=0; \
(cd $(srcdir)/docs && $(MAKE) $@) || RES=$$? ; \
(cd $(srcdir)/docs/man && $(MAKE) $@) || RES=$$? ; \
(cd $(srcdir)/conf && $(MAKE) $@) || RES=$$? ; \
(cd $(srcdir)/data && $(MAKE) $@) || RES=$$? ; \
exit $$RES
doc spellcheck-sortdict:
cd $(srcdir)/docs && $(MAKE) $@
# ----------------------------------------------------------------------
# Automatically generate the ChangeLog from Git logs:
MAINTAINERCLEAN_FILES = ChangeLog
# Older boundary of the ChangeLog commits range
# It can be a tag ('v2.2.0'), a commit hash, a date, ...
# See gitrevisions for more information on specifying ranges
#GITLOG_START_POINT=v2.6.0
# For the FTY NUT fork, the interesting list is differences from common master
GITLOG_START_POINT=master
# Force ChangeLog regeneration upon make dist (due to nonexistant 'dummy-stamp'),
# in case it has already been generated previously
dummy-stamp:
ChangeLog: tools/gitlog2changelog.py dummy-stamp
$(top_srcdir)/tools/gitlog2changelog.py $(GITLOG_START_POINT) || \
echo "gitlog2changelog.py failed to generate the ChangeLog. See https://github.com/networkupstools/nut/commits/master" > $@
# ----------------------------------------------------------------------
# Maintainers targets: distribution signature and hashes
dist-sig:
rm -f nut-@[email protected]
gpg --detach-sign nut-@[email protected]
dist-hash:
md5sum nut-@[email protected] > nut-@[email protected]
sha256sum nut-@[email protected] > nut-@[email protected]
# ----------------------------------------------------------------------
# targets from old build system (pre-automake).
# supported for a period of time for backward "compatibility".
WARN="----------------------------------------------------------------------"
build:
@echo $(WARN)
@echo "Warning: 'make build' is deprecated. Use 'make all' instead."
@echo $(WARN)
$(MAKE) $(AM_MAKEFLAGS) all
install-bin:
@echo $(WARN)
@echo "Warning: 'make install-bin' is deprecated."
@echo "Use 'make install-exec' instead for a similar effect."
@echo $(WARN)
cd common; $(MAKE) $(AM_MAKEFLAGS) install
cd drivers; $(MAKE) $(AM_MAKEFLAGS) install
cd server; $(MAKE) $(AM_MAKEFLAGS) install
cd clients; $(MAKE) $(AM_MAKEFLAGS) install
install-man: install-data-recursive
@echo $(WARN)
@echo "Warning: 'make install-man' is deprecated."
@echo "Use 'cd man; make install' instead."
@echo $(WARN)
cd man; $(MAKE) $(AM_MAKEFLAGS) install
install-conf:
@echo $(WARN)
@echo "Warning: 'make install-conf' is deprecated."
@echo "Use 'cd conf; make install' instead."
@echo $(WARN)
cd conf; $(MAKE) $(AM_MAKEFLAGS) install
# The target install-data already has a standardized meaning under automake
install-dirs:
@echo $(WARN)
@echo "Warning: 'make install-dirs' is deprecated."
@echo "Use 'make installdirs' instead."
@echo $(WARN)
make installdirs
cgi build-cgi install-cgi install-cgi-dir install-cgi-bin \
install-cgi-man install-cgi-conf install-cgi-html:
@echo "Error: 'make $@' no longer exists."
@echo "Use './configure --with-cgi' instead."
install-lib:
@echo "Error: 'make $@' no longer exists."
@echo "Use './configure --with-dev' instead."
usb build-usb install-usb:
@echo "Error: 'make $@' no longer exists."
@echo "Use './configure --with-usb' instead."
snmp build-snmp install-snmp install-snmp-mgr install-snmp-man:
@echo "Error: 'make $@' no longer exists."
@echo "Use './configure --with-snmp' instead."
setver:
@echo "Error: 'make setver' no longer exists."
@echo "Edit configure.in to set version number."
package:
if test `uname -s` = "HP-UX"; then \
cd scripts/HP-UX; \
make package; \
mv NUT_HPUX_package.depot NUT_HPUX_package@[email protected]; \
elif test `uname -s` = "SunOS"; then \
make; \
rm -rf @prefix@; \
make install; \
cd scripts/Solaris; \
make package; \
make uninstall; \
rm -rf @prefix@; \
elif test `uname -s` = "AIX"; then \
make dist; \
cp scripts/Aix/nut-aix.spec /usr/src/packages/SPECS; \
cp scripts/Aix/nut.init nut-@[email protected] /usr/src/packages/SOURCES; \
rpm -ba /usr/src/packages/SPECS/nut-aix.spec; \
fi;