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