Commit | Line | Data |
---|---|---|
b2ffb9b7 MW |
1 | ### -*-makefile-*- |
2 | ### | |
3 | ### Build script for nsict-utils | |
4 | ### | |
5 | ### (c) 2008 Mark Wooding | |
6 | ### | |
7 | ||
8 | ###----- Licensing notice --------------------------------------------------- | |
9 | ### | |
10 | ### This program is free software; you can redistribute it and/or modify | |
11 | ### it under the terms of the GNU General Public License as published by | |
12 | ### the Free Software Foundation; either version 2 of the License, or | |
13 | ### (at your option) any later version. | |
14 | ### | |
15 | ### This program is distributed in the hope that it will be useful, | |
16 | ### but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | ### GNU General Public License for more details. | |
19 | ### | |
20 | ### You should have received a copy of the GNU General Public License | |
21 | ### along with this program; if not, write to the Free Software Foundation, | |
22 | ### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
23 | ||
24 | EXTRA_DIST = | |
25 | CLEANFILES = | |
26 | ||
27 | man_MANS = | |
28 | dist_man_MANS = | |
29 | ||
30 | ###-------------------------------------------------------------------------- | |
31 | ### Tools in C. | |
32 | ||
33 | bin_PROGRAMS = | |
34 | sbin_PROGRAMS = | |
35 | ||
36 | AM_CFLAGS = $(mLib_CFLAGS) $(catacomb_CFLAGS) | |
37 | ||
38 | ## space | |
39 | bin_PROGRAMS += space | |
40 | space_SOURCES = space.c | |
41 | dist_man_MANS += space.1 | |
42 | ||
43 | ## not | |
44 | bin_PROGRAMS += not | |
45 | not_SOURCES = not.c | |
46 | dist_man_MANS += not.1 | |
47 | ||
48 | ## if-mtu | |
49 | bin_PROGRAMS += if-mtu | |
50 | if_mtu_SOURCES = if-mtu.c | |
51 | dist_man_MANS += if-mtu.1 | |
52 | ||
e3e2681b MW |
53 | ## getpass |
54 | bin_PROGRAMS += getpass | |
55 | getpass_SOURCES = getpass.c | |
56 | dist_man_MANS += getpass.1 | |
57 | ||
b2ffb9b7 MW |
58 | ## xtitle |
59 | bin_PROGRAMS += xtitle | |
60 | xtitle_SOURCES = xtitle.c | |
61 | ## !UNDOCUMENTED | |
62 | ||
63 | ## pause | |
64 | if HAVE_MLIB | |
65 | bin_PROGRAMS += pause | |
66 | pause_SOURCES = pause.c | |
67 | pause_LDADD = $(mLib_LIBS) $(MATH_LIBS) | |
68 | dist_man_MANS += pause.1 | |
69 | endif | |
70 | ||
e825e5a9 MW |
71 | ## timeout |
72 | if HAVE_MLIB | |
73 | bin_PROGRAMS += timeout | |
74 | timeout_SOURCES = timeout.c | |
75 | timeout_LDADD = $(mLib_LIBS) $(MATH_LIBS) | |
76 | dist_man_MANS += timeout.1 | |
77 | endif | |
78 | ||
b2ffb9b7 MW |
79 | ## stamp |
80 | if HAVE_MLIB | |
81 | bin_PROGRAMS += stamp | |
82 | stamp_SOURCES = stamp.c | |
83 | stamp_LDADD = $(mLib_LIBS) | |
84 | dist_man_MANS += stamp.1 | |
85 | endif | |
86 | ||
87 | ## locking | |
88 | if HAVE_MLIB | |
89 | bin_PROGRAMS += locking | |
90 | locking_SOURCES = locking.c | |
91 | locking_LDADD = $(mLib_LIBS) | |
92 | dist_man_MANS += locking.1 | |
93 | endif | |
94 | ||
95 | ## gorp | |
96 | if HAVE_CATACOMB | |
97 | bin_PROGRAMS += gorp | |
98 | gorp_SOURCES = gorp.c | |
99 | gorp_LDADD = $(catacomb_LIBS) | |
100 | dist_man_MANS += gorp.1 | |
101 | endif | |
102 | ||
103 | ## qmail-checkspam | |
104 | if HAVE_LIBSPAMC | |
105 | sbin_PROGRAMS += qmail-checkspam | |
106 | qmail_checkspam_SOURCES = qmail-checkspam.c | |
107 | qmail_checkspam_LDADD = -lspamc | |
108 | dist_man_MANS += qmail-checkspam.8 | |
109 | endif | |
110 | ||
111 | ## cdb tools | |
112 | if HAVE_LIBCDB | |
113 | bin_PROGRAMS += cdb-probe cdb-check-domain | |
114 | cdb_probe_SOURCES = cdb-probe.c | |
115 | cdb_probe_LDADD = -lcdb | |
116 | cdb_check_domain_SOURCES = cdb-check-domain.c | |
117 | cdb_check_domain_LDADD = -lcdb | |
118 | dist_man_MANS += cdb-probe.1 cdb-check-domain.1 | |
119 | endif | |
120 | ||
92f7c002 MW |
121 | ## x86 model identification |
122 | if X86 | |
123 | bin_PROGRAMS += x86-model | |
124 | x86_model_SOURCES = x86-model.c | |
125 | x86_model_LDADD = $(mLib_LIBS) | |
126 | dist_man_MANS += x86-model.1 | |
127 | endif | |
128 | ||
b2ffb9b7 MW |
129 | ###-------------------------------------------------------------------------- |
130 | ### Tools in scripts. | |
131 | ||
132 | bin_SCRIPTS = | |
133 | dist_bin_SCRIPTS = | |
134 | sbin_SCRIPTS = | |
135 | dist_sbin_SCRIPTS = | |
136 | ||
137 | ## Making substitutions. | |
138 | confsubst = $(top_srcdir)/config/confsubst | |
1c54bc06 MW |
139 | V_SUBST = $(V_SUBST_$(V)) |
140 | V_SUBST_ = $(V_SUBST_$(AM_DEFAULT_VERBOSITY)) | |
141 | V_SUBST_0 = @echo " SUBST $@"; | |
142 | SUBST = $(V_SUBST)$(confsubst) | |
b2ffb9b7 MW |
143 | SUBSTITUTIONS = \ |
144 | PACKAGE=$(PACKAGE) VERSION=$(VERSION) \ | |
145 | PYTHON=$(PYTHON) \ | |
146 | PERL=$(PERL) \ | |
b1492ec0 MW |
147 | TCLSH=$(TCLSH) \ |
148 | BASH=$(BASH) | |
b2ffb9b7 MW |
149 | |
150 | EXTRA_DIST += config/confsubst | |
151 | ||
152 | ## Shell scripts. | |
153 | dist_bin_SCRIPTS += check-sender | |
154 | dist_man_MANS += check-sender.1 | |
155 | ||
156 | dist_bin_SCRIPTS += buf | |
157 | dist_man_MANS += buf.1 | |
158 | ||
159 | dist_bin_SCRIPTS += create | |
160 | dist_man_MANS += create.1 | |
161 | ||
162 | dist_bin_SCRIPTS += z | |
163 | dist_man_MANS += z.1 | |
164 | ||
165 | ## bash scripts. | |
166 | if HAVE_BASH | |
167 | ||
168 | bin_SCRIPTS += inplace | |
169 | CLEANFILES += inplace | |
170 | EXTRA_DIST += inplace.in | |
171 | dist_man_MANS += inplace.1 | |
172 | ||
173 | inplace: inplace.in Makefile | |
8653d1c3 | 174 | $(SUBST) $(srcdir)/inplace.in >$@.new $(SUBSTITUTIONS) && \ |
b2ffb9b7 MW |
175 | chmod +x $@.new && mv $@.new $@ |
176 | ||
177 | endif | |
178 | ||
179 | ## Python scripts. | |
180 | if HAVE_PYTHON | |
181 | ||
182 | if HAVE_PYMOD_CDB | |
183 | bin_SCRIPTS += cdb-assign | |
184 | dist_man_MANS += cdb-assign.1 | |
185 | endif | |
186 | ||
187 | CLEANFILES += cdb-assign | |
188 | EXTRA_DIST += cdb-assign.in | |
189 | ||
190 | cdb-assign: cdb-assign.in Makefile | |
8653d1c3 | 191 | $(SUBST) $(srcdir)/cdb-assign.in >$@.new $(SUBSTITUTIONS) && \ |
b2ffb9b7 MW |
192 | chmod +x $@.new && mv $@.new $@ |
193 | ||
194 | if HAVE_PYMOD_CDB | |
195 | bin_SCRIPTS += cdb-list | |
196 | dist_man_MANS += cdb-list.1 | |
197 | endif | |
198 | ||
199 | CLEANFILES += cdb-list | |
200 | EXTRA_DIST += cdb-list.in | |
201 | ||
202 | cdb-list: cdb-list.in Makefile | |
8653d1c3 | 203 | $(SUBST) $(srcdir)/cdb-list.in >$@.new $(SUBSTITUTIONS) && \ |
b2ffb9b7 MW |
204 | chmod +x $@.new && mv $@.new $@ |
205 | ||
206 | if HAVE_PYMOD_CDB | |
207 | bin_SCRIPTS += cdb-map | |
208 | dist_man_MANS += cdb-map.1 | |
209 | endif | |
210 | ||
211 | CLEANFILES += cdb-map | |
212 | EXTRA_DIST += cdb-map.in | |
213 | ||
214 | cdb-map: cdb-map.in Makefile | |
8653d1c3 | 215 | $(SUBST) $(srcdir)/cdb-map.in >$@.new $(SUBSTITUTIONS) && \ |
b2ffb9b7 MW |
216 | chmod +x $@.new && mv $@.new $@ |
217 | ||
218 | endif | |
219 | ||
220 | ## Perl scripts. | |
221 | if HAVE_PERL | |
222 | ||
223 | sbin_SCRIPTS += shadowfix | |
224 | CLEANFILES += shadowfix | |
225 | EXTRA_DIST += shadowfix.in | |
226 | ||
227 | shadowfix: shadowfix.in Makefile | |
8653d1c3 | 228 | $(SUBST) $(srcdir)/shadowfix.in >$@.new $(SUBSTITUTIONS) && \ |
b2ffb9b7 MW |
229 | chmod +x $@.new && mv $@.new $@ |
230 | ||
231 | man_MANS += shadowfix.8 | |
232 | CLEANFILES += shadowfix.8 | |
233 | ||
234 | shadowfix.8: shadowfix.in | |
d7c9f389 MW |
235 | $(AM_V_GEN)pod2man --section 8 $(srcdir)/shadowfix.in >$@.new && \ |
236 | mv $@.new $@ | |
b2ffb9b7 MW |
237 | |
238 | bin_SCRIPTS += unfwd | |
239 | CLEANFILES += unfwd | |
240 | EXTRA_DIST += unfwd.in | |
241 | dist_man_MANS += unfwd.1 | |
242 | ||
243 | unfwd: unfwd.in Makefile | |
8653d1c3 | 244 | $(SUBST) $(srcdir)/unfwd.in >$@.new $(SUBSTITUTIONS) && \ |
b2ffb9b7 MW |
245 | chmod +x $@.new && mv $@.new $@ |
246 | ||
247 | endif | |
248 | ||
249 | ## Perl modules. | |
250 | if HAVE_PERL | |
251 | dist_perlmod_DATA = MdwOpt.pm | |
252 | endif | |
253 | ||
254 | ## Tcl scripts. | |
255 | if HAVE_TCLSH | |
256 | ||
257 | bin_SCRIPTS += splitconf | |
258 | CLEANFILES += splitconf | |
259 | EXTRA_DIST += splitconf.in | |
260 | dist_man_MANS += splitconf.1 | |
261 | ||
262 | splitconf: splitconf.in Makefile | |
8653d1c3 | 263 | $(SUBST) $(srcdir)/splitconf.in >$@.new $(SUBSTITUTIONS) && \ |
b2ffb9b7 MW |
264 | chmod +x $@.new && mv $@.new $@ |
265 | ||
266 | endif | |
267 | ||
d87cfc24 MW |
268 | ###-------------------------------------------------------------------------- |
269 | ### Other administrivia. | |
270 | ||
271 | dist-hook: | |
272 | echo $(VERSION) >$(distdir)/RELEASE | |
273 | ||
a027e0e5 MW |
274 | EXTRA_DIST += config/auto-version |
275 | ||
d87cfc24 MW |
276 | ###-------------------------------------------------------------------------- |
277 | ### Debian. | |
278 | ||
279 | ## Standard files. | |
280 | EXTRA_DIST += debian/rules | |
281 | EXTRA_DIST += debian/copyright | |
282 | EXTRA_DIST += debian/changelog | |
283 | EXTRA_DIST += debian/control | |
284 | ||
285 | ## What to install where. | |
286 | EXTRA_DIST += debian/inst | |
287 | ||
b2ffb9b7 | 288 | ###----- That's all, folks -------------------------------------------------- |