chiark / gitweb /
buf, buf.1: Allow the temporary file's extension to be set.
[misc] / Makefile.am
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
53 ## getpass
54 bin_PROGRAMS            += getpass
55 getpass_SOURCES          = getpass.c
56 dist_man_MANS           += getpass.1
57
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
71 ## mtimeout
72 if HAVE_MLIB
73 bin_PROGRAMS            += mtimeout
74 mtimeout_SOURCES         = mtimeout.c
75 mtimeout_LDADD           = $(mLib_LIBS) $(MATH_LIBS)
76 dist_man_MANS           += mtimeout.1
77 endif
78
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 ## prlimit
96 if HAVE_PRLIMIT
97 if HAVE_MLIB
98 bin_PROGRAMS            += prlimit
99 prlimit_SOURCES          = prlimit.c
100 prlimit_LDADD            = $(mLib_LIBS)
101 dist_man_MANS           += prlimit.1
102 endif
103 endif
104
105 ## gorp
106 if HAVE_CATACOMB
107 bin_PROGRAMS            += gorp
108 gorp_SOURCES             = gorp.c
109 gorp_LDADD               = $(catacomb_LIBS)
110 dist_man_MANS           += gorp.1
111 endif
112
113 ## cdb tools
114 if HAVE_LIBCDB
115 bin_PROGRAMS            += cdb-probe cdb-check-domain
116 cdb_probe_SOURCES        = cdb-probe.c
117 cdb_probe_LDADD          = -lcdb
118 cdb_check_domain_SOURCES = cdb-check-domain.c
119 cdb_check_domain_LDADD   = -lcdb
120 dist_man_MANS           += cdb-probe.1 cdb-check-domain.1
121 endif
122
123 ## x86 model identification
124 if X86
125 bin_PROGRAMS            += x86-model
126 x86_model_SOURCES        = x86-model.c
127 x86_model_LDADD          = $(mLib_LIBS)
128 dist_man_MANS           += x86-model.1
129 endif
130
131 ###--------------------------------------------------------------------------
132 ### Tools in scripts.
133
134 bin_SCRIPTS              =
135 dist_bin_SCRIPTS         =
136 sbin_SCRIPTS             =
137 dist_sbin_SCRIPTS        =
138
139 ## Making substitutions.
140 confsubst = $(top_srcdir)/config/confsubst
141 V_SUBST = $(V_SUBST_$(V))
142 V_SUBST_ = $(V_SUBST_$(AM_DEFAULT_VERBOSITY))
143 V_SUBST_0 = @echo "  SUBST  $@";
144 SUBST = $(V_SUBST)$(confsubst)
145 SUBSTITUTIONS = \
146         PACKAGE=$(PACKAGE) VERSION=$(VERSION) \
147         PYTHON=$(PYTHON) \
148         PERL=$(PERL) \
149         TCLSH=$(TCLSH) \
150         BASH=$(BASH) \
151         logdir=$(logdir)
152
153 EXTRA_DIST              += config/confsubst
154
155 ## Shell scripts.
156 dist_bin_SCRIPTS        += check-sender
157 dist_man_MANS           += check-sender.1
158
159 dist_bin_SCRIPTS        += buf
160 dist_man_MANS           += buf.1
161
162 dist_bin_SCRIPTS        += create
163 dist_man_MANS           += create.1
164
165 dist_bin_SCRIPTS        += z
166 dist_man_MANS           += z.1
167
168 bin_SCRIPTS             += hush
169 man_MANS                += hush.1
170 CLEANFILES              += hush hush.1
171 EXTRA_DIST              += hush.in hush.1.in
172
173 hush: hush.in Makefile
174         $(SUBST) $(srcdir)/hush.in >$@.new $(SUBSTITUTIONS) && \
175                 chmod +x $@.new && mv $@.new $@
176
177 hush.1: hush.1.in Makefile
178         $(SUBST) $(srcdir)/hush.1.in >$@.new $(SUBSTITUTIONS) && \
179                 mv $@.new $@
180
181 ## bash scripts.
182 if HAVE_BASH
183
184 bin_SCRIPTS             += inplace
185 CLEANFILES              += inplace
186 EXTRA_DIST              += inplace.in
187 dist_man_MANS           += inplace.1
188
189 inplace: inplace.in Makefile
190         $(SUBST) $(srcdir)/inplace.in >$@.new $(SUBSTITUTIONS) && \
191                 chmod +x $@.new && mv $@.new $@
192
193 endif
194
195 ## Python scripts.
196 if HAVE_PYTHON
197
198 if HAVE_PYMOD_CDB
199 bin_SCRIPTS             += cdb-assign
200 dist_man_MANS           += cdb-assign.1
201 endif
202
203 CLEANFILES              += cdb-assign
204 EXTRA_DIST              += cdb-assign.in
205
206 cdb-assign: cdb-assign.in Makefile
207         $(SUBST) $(srcdir)/cdb-assign.in >$@.new $(SUBSTITUTIONS) && \
208                 chmod +x $@.new && mv $@.new $@
209
210 if HAVE_PYMOD_CDB
211 bin_SCRIPTS             += cdb-list
212 dist_man_MANS           += cdb-list.1
213 endif
214
215 CLEANFILES              += cdb-list
216 EXTRA_DIST              += cdb-list.in
217
218 cdb-list: cdb-list.in Makefile
219         $(SUBST) $(srcdir)/cdb-list.in >$@.new $(SUBSTITUTIONS) && \
220                 chmod +x $@.new && mv $@.new $@
221
222 if HAVE_PYMOD_CDB
223 bin_SCRIPTS             += cdb-map
224 dist_man_MANS           += cdb-map.1
225 endif
226
227 CLEANFILES              += cdb-map
228 EXTRA_DIST              += cdb-map.in
229
230 cdb-map: cdb-map.in Makefile
231         $(SUBST) $(srcdir)/cdb-map.in >$@.new $(SUBSTITUTIONS) && \
232                 chmod +x $@.new && mv $@.new $@
233
234 endif
235
236 ## Perl scripts.
237 if HAVE_PERL
238
239 sbin_SCRIPTS            += shadowfix
240 CLEANFILES              += shadowfix
241 EXTRA_DIST              += shadowfix.in
242
243 shadowfix: shadowfix.in Makefile
244         $(SUBST) $(srcdir)/shadowfix.in >$@.new $(SUBSTITUTIONS) && \
245                 chmod +x $@.new && mv $@.new $@
246
247 man_MANS                += shadowfix.8
248 CLEANFILES              += shadowfix.8
249
250 shadowfix.8: shadowfix.in
251         $(AM_V_GEN)pod2man --section 8 $(srcdir)/shadowfix.in >$@.new && \
252                 mv $@.new $@
253
254 bin_SCRIPTS             += unfwd
255 CLEANFILES              += unfwd
256 EXTRA_DIST              += unfwd.in
257 dist_man_MANS           += unfwd.1
258
259 unfwd: unfwd.in Makefile
260         $(SUBST) $(srcdir)/unfwd.in >$@.new $(SUBSTITUTIONS) && \
261                 chmod +x $@.new && mv $@.new $@
262
263 endif
264
265 ## Perl modules.
266 if HAVE_PERL
267 dist_perlmod_DATA        = MdwOpt.pm
268 endif
269
270 ## Tcl scripts.
271 if HAVE_TCLSH
272
273 bin_SCRIPTS             += splitconf
274 CLEANFILES              += splitconf
275 EXTRA_DIST              += splitconf.in
276 dist_man_MANS           += splitconf.1
277
278 splitconf: splitconf.in Makefile
279         $(SUBST) $(srcdir)/splitconf.in >$@.new $(SUBSTITUTIONS) && \
280                 chmod +x $@.new && mv $@.new $@
281
282 endif
283
284 ###--------------------------------------------------------------------------
285 ### Other administrivia.
286
287 dist-hook:
288         echo $(VERSION) >$(distdir)/RELEASE
289
290 EXTRA_DIST              += config/auto-version
291
292 ###--------------------------------------------------------------------------
293 ### Debian.
294
295 ## Standard files.
296 EXTRA_DIST              += debian/rules
297 EXTRA_DIST              += debian/copyright
298 EXTRA_DIST              += debian/changelog
299 EXTRA_DIST              += debian/control
300 EXTRA_DIST              += debian/compat
301
302 ## What to install where.
303 EXTRA_DIST              += debian/inst
304
305 ###----- That's all, folks --------------------------------------------------