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