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