Commit | Line | Data |
---|---|---|
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 | ||
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 | ||
e3e2681b MW |
53 | ## getpass |
54 | bin_PROGRAMS += getpass | |
55 | getpass_SOURCES = getpass.c | |
56 | dist_man_MANS += getpass.1 | |
57 | ||
b2ffb9b7 MW |
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 | ## stamp | |
72 | if HAVE_MLIB | |
73 | bin_PROGRAMS += stamp | |
74 | stamp_SOURCES = stamp.c | |
75 | stamp_LDADD = $(mLib_LIBS) | |
76 | dist_man_MANS += stamp.1 | |
77 | endif | |
78 | ||
79 | ## locking | |
80 | if HAVE_MLIB | |
81 | bin_PROGRAMS += locking | |
82 | locking_SOURCES = locking.c | |
83 | locking_LDADD = $(mLib_LIBS) | |
84 | dist_man_MANS += locking.1 | |
85 | endif | |
86 | ||
87 | ## gorp | |
88 | if HAVE_CATACOMB | |
89 | bin_PROGRAMS += gorp | |
90 | gorp_SOURCES = gorp.c | |
91 | gorp_LDADD = $(catacomb_LIBS) | |
92 | dist_man_MANS += gorp.1 | |
93 | endif | |
94 | ||
95 | ## qmail-checkspam | |
96 | if HAVE_LIBSPAMC | |
97 | sbin_PROGRAMS += qmail-checkspam | |
98 | qmail_checkspam_SOURCES = qmail-checkspam.c | |
99 | qmail_checkspam_LDADD = -lspamc | |
100 | dist_man_MANS += qmail-checkspam.8 | |
101 | endif | |
102 | ||
103 | ## cdb tools | |
104 | if HAVE_LIBCDB | |
105 | bin_PROGRAMS += cdb-probe cdb-check-domain | |
106 | cdb_probe_SOURCES = cdb-probe.c | |
107 | cdb_probe_LDADD = -lcdb | |
108 | cdb_check_domain_SOURCES = cdb-check-domain.c | |
109 | cdb_check_domain_LDADD = -lcdb | |
110 | dist_man_MANS += cdb-probe.1 cdb-check-domain.1 | |
111 | endif | |
112 | ||
92f7c002 MW |
113 | ## x86 model identification |
114 | if X86 | |
115 | bin_PROGRAMS += x86-model | |
116 | x86_model_SOURCES = x86-model.c | |
117 | x86_model_LDADD = $(mLib_LIBS) | |
118 | dist_man_MANS += x86-model.1 | |
119 | endif | |
120 | ||
b2ffb9b7 MW |
121 | ###-------------------------------------------------------------------------- |
122 | ### Tools in scripts. | |
123 | ||
124 | bin_SCRIPTS = | |
125 | dist_bin_SCRIPTS = | |
126 | sbin_SCRIPTS = | |
127 | dist_sbin_SCRIPTS = | |
128 | ||
129 | ## Making substitutions. | |
130 | confsubst = $(top_srcdir)/config/confsubst | |
8653d1c3 | 131 | SUBST = $(AM_V_GEN)$(confsubst) |
b2ffb9b7 MW |
132 | SUBSTITUTIONS = \ |
133 | PACKAGE=$(PACKAGE) VERSION=$(VERSION) \ | |
134 | PYTHON=$(PYTHON) \ | |
135 | PERL=$(PERL) \ | |
b1492ec0 MW |
136 | TCLSH=$(TCLSH) \ |
137 | BASH=$(BASH) | |
b2ffb9b7 MW |
138 | |
139 | EXTRA_DIST += config/confsubst | |
140 | ||
141 | ## Shell scripts. | |
142 | dist_bin_SCRIPTS += check-sender | |
143 | dist_man_MANS += check-sender.1 | |
144 | ||
145 | dist_bin_SCRIPTS += buf | |
146 | dist_man_MANS += buf.1 | |
147 | ||
148 | dist_bin_SCRIPTS += create | |
149 | dist_man_MANS += create.1 | |
150 | ||
151 | dist_bin_SCRIPTS += z | |
152 | dist_man_MANS += z.1 | |
153 | ||
154 | ## bash scripts. | |
155 | if HAVE_BASH | |
156 | ||
157 | bin_SCRIPTS += inplace | |
158 | CLEANFILES += inplace | |
159 | EXTRA_DIST += inplace.in | |
160 | dist_man_MANS += inplace.1 | |
161 | ||
162 | inplace: inplace.in Makefile | |
8653d1c3 | 163 | $(SUBST) $(srcdir)/inplace.in >$@.new $(SUBSTITUTIONS) && \ |
b2ffb9b7 MW |
164 | chmod +x $@.new && mv $@.new $@ |
165 | ||
166 | endif | |
167 | ||
168 | ## Python scripts. | |
169 | if HAVE_PYTHON | |
170 | ||
171 | if HAVE_PYMOD_CDB | |
172 | bin_SCRIPTS += cdb-assign | |
173 | dist_man_MANS += cdb-assign.1 | |
174 | endif | |
175 | ||
176 | CLEANFILES += cdb-assign | |
177 | EXTRA_DIST += cdb-assign.in | |
178 | ||
179 | cdb-assign: cdb-assign.in Makefile | |
8653d1c3 | 180 | $(SUBST) $(srcdir)/cdb-assign.in >$@.new $(SUBSTITUTIONS) && \ |
b2ffb9b7 MW |
181 | chmod +x $@.new && mv $@.new $@ |
182 | ||
183 | if HAVE_PYMOD_CDB | |
184 | bin_SCRIPTS += cdb-list | |
185 | dist_man_MANS += cdb-list.1 | |
186 | endif | |
187 | ||
188 | CLEANFILES += cdb-list | |
189 | EXTRA_DIST += cdb-list.in | |
190 | ||
191 | cdb-list: cdb-list.in Makefile | |
8653d1c3 | 192 | $(SUBST) $(srcdir)/cdb-list.in >$@.new $(SUBSTITUTIONS) && \ |
b2ffb9b7 MW |
193 | chmod +x $@.new && mv $@.new $@ |
194 | ||
195 | if HAVE_PYMOD_CDB | |
196 | bin_SCRIPTS += cdb-map | |
197 | dist_man_MANS += cdb-map.1 | |
198 | endif | |
199 | ||
200 | CLEANFILES += cdb-map | |
201 | EXTRA_DIST += cdb-map.in | |
202 | ||
203 | cdb-map: cdb-map.in Makefile | |
8653d1c3 | 204 | $(SUBST) $(srcdir)/cdb-map.in >$@.new $(SUBSTITUTIONS) && \ |
b2ffb9b7 MW |
205 | chmod +x $@.new && mv $@.new $@ |
206 | ||
207 | endif | |
208 | ||
209 | ## Perl scripts. | |
210 | if HAVE_PERL | |
211 | ||
212 | sbin_SCRIPTS += shadowfix | |
213 | CLEANFILES += shadowfix | |
214 | EXTRA_DIST += shadowfix.in | |
215 | ||
216 | shadowfix: shadowfix.in Makefile | |
8653d1c3 | 217 | $(SUBST) $(srcdir)/shadowfix.in >$@.new $(SUBSTITUTIONS) && \ |
b2ffb9b7 MW |
218 | chmod +x $@.new && mv $@.new $@ |
219 | ||
220 | man_MANS += shadowfix.8 | |
221 | CLEANFILES += shadowfix.8 | |
222 | ||
223 | shadowfix.8: shadowfix.in | |
8653d1c3 MW |
224 | $(AM_V_GEN)pod2man --section 8 $(srcdir)/shadowfix.in \ |
225 | >$@.new && mv $@.new $@ | |
b2ffb9b7 MW |
226 | |
227 | bin_SCRIPTS += unfwd | |
228 | CLEANFILES += unfwd | |
229 | EXTRA_DIST += unfwd.in | |
230 | dist_man_MANS += unfwd.1 | |
231 | ||
232 | unfwd: unfwd.in Makefile | |
8653d1c3 | 233 | $(SUBST) $(srcdir)/unfwd.in >$@.new $(SUBSTITUTIONS) && \ |
b2ffb9b7 MW |
234 | chmod +x $@.new && mv $@.new $@ |
235 | ||
236 | endif | |
237 | ||
238 | ## Perl modules. | |
239 | if HAVE_PERL | |
240 | dist_perlmod_DATA = MdwOpt.pm | |
241 | endif | |
242 | ||
243 | ## Tcl scripts. | |
244 | if HAVE_TCLSH | |
245 | ||
246 | bin_SCRIPTS += splitconf | |
247 | CLEANFILES += splitconf | |
248 | EXTRA_DIST += splitconf.in | |
249 | dist_man_MANS += splitconf.1 | |
250 | ||
251 | splitconf: splitconf.in Makefile | |
8653d1c3 | 252 | $(SUBST) $(srcdir)/splitconf.in >$@.new $(SUBSTITUTIONS) && \ |
b2ffb9b7 MW |
253 | chmod +x $@.new && mv $@.new $@ |
254 | ||
255 | endif | |
256 | ||
d87cfc24 MW |
257 | ###-------------------------------------------------------------------------- |
258 | ### Other administrivia. | |
259 | ||
260 | dist-hook: | |
261 | echo $(VERSION) >$(distdir)/RELEASE | |
262 | ||
a027e0e5 MW |
263 | EXTRA_DIST += config/auto-version |
264 | ||
d87cfc24 MW |
265 | ###-------------------------------------------------------------------------- |
266 | ### Debian. | |
267 | ||
268 | ## Standard files. | |
269 | EXTRA_DIST += debian/rules | |
270 | EXTRA_DIST += debian/copyright | |
271 | EXTRA_DIST += debian/changelog | |
272 | EXTRA_DIST += debian/control | |
273 | ||
274 | ## What to install where. | |
275 | EXTRA_DIST += debian/inst | |
276 | ||
b2ffb9b7 | 277 | ###----- That's all, folks -------------------------------------------------- |