chiark / gitweb /
Build system overhaul.
[misc] / Makefile.am
CommitLineData
b2ffb9b7
MW
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
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## not
44bin_PROGRAMS += not
45not_SOURCES = not.c
46dist_man_MANS += not.1
47
48## if-mtu
49bin_PROGRAMS += if-mtu
50if_mtu_SOURCES = if-mtu.c
51dist_man_MANS += if-mtu.1
52
53## xtitle
54bin_PROGRAMS += xtitle
55xtitle_SOURCES = xtitle.c
56## !UNDOCUMENTED
57
58## pause
59if HAVE_MLIB
60bin_PROGRAMS += pause
61pause_SOURCES = pause.c
62pause_LDADD = $(mLib_LIBS) $(MATH_LIBS)
63dist_man_MANS += pause.1
64endif
65
66## stamp
67if HAVE_MLIB
68bin_PROGRAMS += stamp
69stamp_SOURCES = stamp.c
70stamp_LDADD = $(mLib_LIBS)
71dist_man_MANS += stamp.1
72endif
73
74## locking
75if HAVE_MLIB
76bin_PROGRAMS += locking
77locking_SOURCES = locking.c
78locking_LDADD = $(mLib_LIBS)
79dist_man_MANS += locking.1
80endif
81
82## gorp
83if HAVE_CATACOMB
84bin_PROGRAMS += gorp
85gorp_SOURCES = gorp.c
86gorp_LDADD = $(catacomb_LIBS)
87dist_man_MANS += gorp.1
88endif
89
90## qmail-checkspam
91if HAVE_LIBSPAMC
92sbin_PROGRAMS += qmail-checkspam
93qmail_checkspam_SOURCES = qmail-checkspam.c
94qmail_checkspam_LDADD = -lspamc
95dist_man_MANS += qmail-checkspam.8
96endif
97
98## cdb tools
99if HAVE_LIBCDB
100bin_PROGRAMS += cdb-probe cdb-check-domain
101cdb_probe_SOURCES = cdb-probe.c
102cdb_probe_LDADD = -lcdb
103cdb_check_domain_SOURCES = cdb-check-domain.c
104cdb_check_domain_LDADD = -lcdb
105dist_man_MANS += cdb-probe.1 cdb-check-domain.1
106endif
107
108###--------------------------------------------------------------------------
109### Tools in scripts.
110
111bin_SCRIPTS =
112dist_bin_SCRIPTS =
113sbin_SCRIPTS =
114dist_sbin_SCRIPTS =
115
116## Making substitutions.
117confsubst = $(top_srcdir)/config/confsubst
118SUBSTITUTIONS = \
119 PACKAGE=$(PACKAGE) VERSION=$(VERSION) \
120 PYTHON=$(PYTHON) \
121 PERL=$(PERL) \
122 TCLSH=$(TCLSH)
123
124EXTRA_DIST += config/confsubst
125
126## Shell scripts.
127dist_bin_SCRIPTS += check-sender
128dist_man_MANS += check-sender.1
129
130dist_bin_SCRIPTS += buf
131dist_man_MANS += buf.1
132
133dist_bin_SCRIPTS += create
134dist_man_MANS += create.1
135
136dist_bin_SCRIPTS += z
137dist_man_MANS += z.1
138
139## bash scripts.
140if HAVE_BASH
141
142bin_SCRIPTS += inplace
143CLEANFILES += inplace
144EXTRA_DIST += inplace.in
145dist_man_MANS += inplace.1
146
147inplace: inplace.in Makefile
148 $(confsubst) $(srcdir)/inplace.in >$@.new $(SUBSTITUTIONS) && \
149 chmod +x $@.new && mv $@.new $@
150
151endif
152
153## Python scripts.
154if HAVE_PYTHON
155
156if HAVE_PYMOD_CDB
157bin_SCRIPTS += cdb-assign
158dist_man_MANS += cdb-assign.1
159endif
160
161CLEANFILES += cdb-assign
162EXTRA_DIST += cdb-assign.in
163
164cdb-assign: cdb-assign.in Makefile
165 $(confsubst) $(srcdir)/cdb-assign.in >$@.new $(SUBSTITUTIONS) && \
166 chmod +x $@.new && mv $@.new $@
167
168if HAVE_PYMOD_CDB
169bin_SCRIPTS += cdb-list
170dist_man_MANS += cdb-list.1
171endif
172
173CLEANFILES += cdb-list
174EXTRA_DIST += cdb-list.in
175
176cdb-list: cdb-list.in Makefile
177 $(confsubst) $(srcdir)/cdb-list.in >$@.new $(SUBSTITUTIONS) && \
178 chmod +x $@.new && mv $@.new $@
179
180if HAVE_PYMOD_CDB
181bin_SCRIPTS += cdb-map
182dist_man_MANS += cdb-map.1
183endif
184
185CLEANFILES += cdb-map
186EXTRA_DIST += cdb-map.in
187
188cdb-map: cdb-map.in Makefile
189 $(confsubst) $(srcdir)/cdb-map.in >$@.new $(SUBSTITUTIONS) && \
190 chmod +x $@.new && mv $@.new $@
191
192endif
193
194## Perl scripts.
195if HAVE_PERL
196
197sbin_SCRIPTS += shadowfix
198CLEANFILES += shadowfix
199EXTRA_DIST += shadowfix.in
200
201shadowfix: shadowfix.in Makefile
202 $(confsubst) $(srcdir)/shadowfix.in >$@.new $(SUBSTITUTIONS) && \
203 chmod +x $@.new && mv $@.new $@
204
205man_MANS += shadowfix.8
206CLEANFILES += shadowfix.8
207
208shadowfix.8: shadowfix.in
209 pod2man --section 8 $(srcdir)/shadowfix.in >$@.new && mv $@.new $@
210
211bin_SCRIPTS += unfwd
212CLEANFILES += unfwd
213EXTRA_DIST += unfwd.in
214dist_man_MANS += unfwd.1
215
216unfwd: unfwd.in Makefile
217 $(confsubst) $(srcdir)/unfwd.in >$@.new $(SUBSTITUTIONS) && \
218 chmod +x $@.new && mv $@.new $@
219
220endif
221
222## Perl modules.
223if HAVE_PERL
224dist_perlmod_DATA = MdwOpt.pm
225endif
226
227## Tcl scripts.
228if HAVE_TCLSH
229
230bin_SCRIPTS += splitconf
231CLEANFILES += splitconf
232EXTRA_DIST += splitconf.in
233dist_man_MANS += splitconf.1
234
235splitconf: splitconf.in Makefile
236 $(confsubst) $(srcdir)/splitconf.in >$@.new $(SUBSTITUTIONS) && \
237 chmod +x $@.new && mv $@.new $@
238
239endif
240
241###----- That's all, folks --------------------------------------------------