Commit | Line | Data |
---|---|---|
b2ffb9b7 MW |
1 | ### -*-makefile-*- |
2 | ### | |
c1749034 | 3 | ### Build script for distorted-utils |
b2ffb9b7 MW |
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 | ||
2379936b MW |
43 | ## cdb tools |
44 | if HAVE_LIBCDB | |
45 | bin_PROGRAMS += cdb-probe cdb-check-domain | |
46 | cdb_probe_SOURCES = cdb-probe.c | |
47 | cdb_probe_LDADD = -lcdb | |
48 | cdb_check_domain_SOURCES = cdb-check-domain.c | |
49 | cdb_check_domain_LDADD = -lcdb | |
50 | dist_man_MANS += cdb-probe.1 cdb-check-domain.1 | |
51 | endif | |
b2ffb9b7 | 52 | |
e3e2681b MW |
53 | ## getpass |
54 | bin_PROGRAMS += getpass | |
55 | getpass_SOURCES = getpass.c | |
56 | dist_man_MANS += getpass.1 | |
57 | ||
d3fafed3 MW |
58 | ## gai |
59 | bin_PROGRAMS += gai | |
60 | gai_SOURCES = gai.c | |
61 | dist_man_MANS += gai.1 | |
62 | ||
2379936b MW |
63 | ## gorp |
64 | if HAVE_CATACOMB | |
65 | bin_PROGRAMS += gorp | |
66 | gorp_SOURCES = gorp.c | |
67 | gorp_LDADD = $(catacomb_LIBS) | |
68 | dist_man_MANS += gorp.1 | |
69 | endif | |
b2ffb9b7 | 70 | |
2379936b MW |
71 | ## if-mtu |
72 | bin_PROGRAMS += if-mtu | |
73 | if_mtu_SOURCES = if-mtu.c | |
74 | dist_man_MANS += if-mtu.1 | |
75 | ||
76 | ## locking | |
b2ffb9b7 | 77 | if HAVE_MLIB |
2379936b MW |
78 | bin_PROGRAMS += locking |
79 | locking_SOURCES = locking.c | |
80 | locking_LDADD = $(mLib_LIBS) | |
81 | dist_man_MANS += locking.1 | |
b2ffb9b7 MW |
82 | endif |
83 | ||
58b43082 | 84 | ## mtimeout |
e825e5a9 | 85 | if HAVE_MLIB |
58b43082 MW |
86 | bin_PROGRAMS += mtimeout |
87 | mtimeout_SOURCES = mtimeout.c | |
88 | mtimeout_LDADD = $(mLib_LIBS) $(MATH_LIBS) | |
89 | dist_man_MANS += mtimeout.1 | |
e825e5a9 MW |
90 | endif |
91 | ||
2379936b MW |
92 | ## not |
93 | bin_PROGRAMS += not | |
94 | not_SOURCES = not.c | |
95 | dist_man_MANS += not.1 | |
b2ffb9b7 | 96 | |
2379936b | 97 | ## pause |
b2ffb9b7 | 98 | if HAVE_MLIB |
2379936b MW |
99 | bin_PROGRAMS += pause |
100 | pause_SOURCES = pause.c | |
101 | pause_LDADD = $(mLib_LIBS) $(MATH_LIBS) | |
102 | dist_man_MANS += pause.1 | |
b2ffb9b7 MW |
103 | endif |
104 | ||
e55151af | 105 | ## mprlimit |
2e169b7e MW |
106 | if HAVE_PRLIMIT |
107 | if HAVE_MLIB | |
e55151af MW |
108 | bin_PROGRAMS += mprlimit |
109 | mprlimit_SOURCES = mprlimit.c | |
110 | mprlimit_LDADD = $(mLib_LIBS) | |
111 | dist_man_MANS += mprlimit.1 | |
2e169b7e MW |
112 | endif |
113 | endif | |
114 | ||
300a556d MW |
115 | ## sema |
116 | if HAVE_MLIB | |
117 | bin_PROGRAMS += sema | |
118 | sema_SOURCES = sema.c | |
119 | sema_SOURCES += fence.c fence.h | |
120 | sema_SOURCES += timemax.cc timemax.h | |
121 | sema_LDADD = $(mLib_LIBS) | |
122 | sema_LINK = $(LINK) # don't need C++ libraries here | |
123 | dist_man_MANS += sema.1 | |
124 | endif | |
125 | ||
2379936b MW |
126 | ## stamp |
127 | if HAVE_MLIB | |
128 | bin_PROGRAMS += stamp | |
129 | stamp_SOURCES = stamp.c | |
130 | stamp_LDADD = $(mLib_LIBS) | |
131 | dist_man_MANS += stamp.1 | |
b2ffb9b7 MW |
132 | endif |
133 | ||
92f7c002 MW |
134 | ## x86 model identification |
135 | if X86 | |
04178dd3 | 136 | if HAVE_MLIB |
92f7c002 MW |
137 | bin_PROGRAMS += x86-model |
138 | x86_model_SOURCES = x86-model.c | |
139 | x86_model_LDADD = $(mLib_LIBS) | |
140 | dist_man_MANS += x86-model.1 | |
141 | endif | |
04178dd3 | 142 | endif |
92f7c002 | 143 | |
2379936b MW |
144 | ## xtitle |
145 | bin_PROGRAMS += xtitle | |
146 | xtitle_SOURCES = xtitle.c | |
147 | dist_man_MANS += xtitle.1 | |
148 | ||
b2ffb9b7 MW |
149 | ###-------------------------------------------------------------------------- |
150 | ### Tools in scripts. | |
151 | ||
152 | bin_SCRIPTS = | |
153 | dist_bin_SCRIPTS = | |
154 | sbin_SCRIPTS = | |
155 | dist_sbin_SCRIPTS = | |
156 | ||
157 | ## Making substitutions. | |
158 | confsubst = $(top_srcdir)/config/confsubst | |
99acf5cd MW |
159 | V_SUBST = $(V_SUBST_@AM_V@) |
160 | V_SUBST_ = $(V_SUBST_@AM_DEFAULT_V@) | |
161 | V_SUBST_0 = @echo " SUBST $@"; | |
1c54bc06 | 162 | SUBST = $(V_SUBST)$(confsubst) |
b2ffb9b7 MW |
163 | SUBSTITUTIONS = \ |
164 | PACKAGE=$(PACKAGE) VERSION=$(VERSION) \ | |
165 | PYTHON=$(PYTHON) \ | |
166 | PERL=$(PERL) \ | |
b1492ec0 | 167 | TCLSH=$(TCLSH) \ |
c818aced MW |
168 | BASH=$(BASH) \ |
169 | logdir=$(logdir) | |
b2ffb9b7 MW |
170 | |
171 | EXTRA_DIST += config/confsubst | |
172 | ||
173 | ## Shell scripts. | |
b2ffb9b7 MW |
174 | dist_bin_SCRIPTS += buf |
175 | dist_man_MANS += buf.1 | |
176 | ||
2379936b MW |
177 | dist_bin_SCRIPTS += check-sender |
178 | dist_man_MANS += check-sender.1 | |
179 | ||
b2ffb9b7 MW |
180 | dist_bin_SCRIPTS += create |
181 | dist_man_MANS += create.1 | |
182 | ||
c818aced MW |
183 | bin_SCRIPTS += hush |
184 | man_MANS += hush.1 | |
185 | CLEANFILES += hush hush.1 | |
186 | EXTRA_DIST += hush.in hush.1.in | |
187 | ||
188 | hush: hush.in Makefile | |
189 | $(SUBST) $(srcdir)/hush.in >$@.new $(SUBSTITUTIONS) && \ | |
190 | chmod +x $@.new && mv $@.new $@ | |
191 | ||
192 | hush.1: hush.1.in Makefile | |
193 | $(SUBST) $(srcdir)/hush.1.in >$@.new $(SUBSTITUTIONS) && \ | |
194 | mv $@.new $@ | |
195 | ||
2379936b MW |
196 | dist_bin_SCRIPTS += sshsvc-mkauthkeys |
197 | dist_man_MANS += sshsvc-mkauthkeys.1 | |
198 | ||
3dd40cc8 MW |
199 | dist_bin_SCRIPTS += with-umask |
200 | dist_man_MANS += with-umask.1 | |
201 | ||
2379936b MW |
202 | dist_bin_SCRIPTS += z |
203 | dist_man_MANS += z.1 | |
b9ee4e83 | 204 | |
b2ffb9b7 MW |
205 | ## bash scripts. |
206 | if HAVE_BASH | |
207 | ||
208 | bin_SCRIPTS += inplace | |
209 | CLEANFILES += inplace | |
210 | EXTRA_DIST += inplace.in | |
211 | dist_man_MANS += inplace.1 | |
212 | ||
213 | inplace: inplace.in Makefile | |
8653d1c3 | 214 | $(SUBST) $(srcdir)/inplace.in >$@.new $(SUBSTITUTIONS) && \ |
b2ffb9b7 MW |
215 | chmod +x $@.new && mv $@.new $@ |
216 | ||
217 | endif | |
218 | ||
219 | ## Python scripts. | |
220 | if HAVE_PYTHON | |
221 | ||
222 | if HAVE_PYMOD_CDB | |
223 | bin_SCRIPTS += cdb-assign | |
224 | dist_man_MANS += cdb-assign.1 | |
225 | endif | |
226 | ||
227 | CLEANFILES += cdb-assign | |
228 | EXTRA_DIST += cdb-assign.in | |
229 | ||
230 | cdb-assign: cdb-assign.in Makefile | |
8653d1c3 | 231 | $(SUBST) $(srcdir)/cdb-assign.in >$@.new $(SUBSTITUTIONS) && \ |
b2ffb9b7 MW |
232 | chmod +x $@.new && mv $@.new $@ |
233 | ||
234 | if HAVE_PYMOD_CDB | |
235 | bin_SCRIPTS += cdb-list | |
236 | dist_man_MANS += cdb-list.1 | |
237 | endif | |
238 | ||
239 | CLEANFILES += cdb-list | |
240 | EXTRA_DIST += cdb-list.in | |
241 | ||
242 | cdb-list: cdb-list.in Makefile | |
8653d1c3 | 243 | $(SUBST) $(srcdir)/cdb-list.in >$@.new $(SUBSTITUTIONS) && \ |
b2ffb9b7 MW |
244 | chmod +x $@.new && mv $@.new $@ |
245 | ||
246 | if HAVE_PYMOD_CDB | |
247 | bin_SCRIPTS += cdb-map | |
248 | dist_man_MANS += cdb-map.1 | |
249 | endif | |
250 | ||
251 | CLEANFILES += cdb-map | |
252 | EXTRA_DIST += cdb-map.in | |
253 | ||
254 | cdb-map: cdb-map.in Makefile | |
8653d1c3 | 255 | $(SUBST) $(srcdir)/cdb-map.in >$@.new $(SUBSTITUTIONS) && \ |
b2ffb9b7 MW |
256 | chmod +x $@.new && mv $@.new $@ |
257 | ||
258 | endif | |
259 | ||
260 | ## Perl scripts. | |
261 | if HAVE_PERL | |
262 | ||
263 | sbin_SCRIPTS += shadowfix | |
264 | CLEANFILES += shadowfix | |
265 | EXTRA_DIST += shadowfix.in | |
266 | ||
267 | shadowfix: shadowfix.in Makefile | |
8653d1c3 | 268 | $(SUBST) $(srcdir)/shadowfix.in >$@.new $(SUBSTITUTIONS) && \ |
b2ffb9b7 MW |
269 | chmod +x $@.new && mv $@.new $@ |
270 | ||
271 | man_MANS += shadowfix.8 | |
272 | CLEANFILES += shadowfix.8 | |
273 | ||
274 | shadowfix.8: shadowfix.in | |
d7c9f389 MW |
275 | $(AM_V_GEN)pod2man --section 8 $(srcdir)/shadowfix.in >$@.new && \ |
276 | mv $@.new $@ | |
b2ffb9b7 | 277 | |
e2590393 | 278 | dist_bin_SCRIPTS += unfwd |
b2ffb9b7 MW |
279 | dist_man_MANS += unfwd.1 |
280 | ||
b2ffb9b7 MW |
281 | endif |
282 | ||
283 | ## Perl modules. | |
284 | if HAVE_PERL | |
285 | dist_perlmod_DATA = MdwOpt.pm | |
286 | endif | |
287 | ||
288 | ## Tcl scripts. | |
289 | if HAVE_TCLSH | |
290 | ||
291 | bin_SCRIPTS += splitconf | |
292 | CLEANFILES += splitconf | |
293 | EXTRA_DIST += splitconf.in | |
294 | dist_man_MANS += splitconf.1 | |
295 | ||
296 | splitconf: splitconf.in Makefile | |
8653d1c3 | 297 | $(SUBST) $(srcdir)/splitconf.in >$@.new $(SUBSTITUTIONS) && \ |
b2ffb9b7 MW |
298 | chmod +x $@.new && mv $@.new $@ |
299 | ||
300 | endif | |
301 | ||
d87cfc24 MW |
302 | ###-------------------------------------------------------------------------- |
303 | ### Other administrivia. | |
304 | ||
305 | dist-hook: | |
306 | echo $(VERSION) >$(distdir)/RELEASE | |
307 | ||
a027e0e5 MW |
308 | EXTRA_DIST += config/auto-version |
309 | ||
d87cfc24 MW |
310 | ###-------------------------------------------------------------------------- |
311 | ### Debian. | |
312 | ||
313 | ## Standard files. | |
314 | EXTRA_DIST += debian/rules | |
315 | EXTRA_DIST += debian/copyright | |
316 | EXTRA_DIST += debian/changelog | |
317 | EXTRA_DIST += debian/control | |
b88c529e | 318 | EXTRA_DIST += debian/compat |
4d99f2de | 319 | EXTRA_DIST += debian/source/format |
d87cfc24 MW |
320 | |
321 | ## What to install where. | |
322 | EXTRA_DIST += debian/inst | |
323 | ||
b2ffb9b7 | 324 | ###----- That's all, folks -------------------------------------------------- |