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