]> diplodocus.org Git - nmh/blob - Makefile.am
Add some diagnostics to determine what is going wrong.
[nmh] / Makefile.am
1 ##
2 ## Our Makefile.am template for Makefile.in (and, eventually, Makefile)
3 ##
4 ## Process this with automake to generate Makefile.in
5 ##
6
7 ## We set this to get our autoconf macros in the m4 directory
8 ACLOCAL_AMFLAGS = -I m4
9
10 ##
11 ## This is the default set of libraries all programs link against. Some
12 ## programs add extra libraries to this set, so they override this with
13 ## a program-specific LDADD variable. Note that in all of the cases today
14 ## LDADD is included in the program-specific LDADD since we want to add
15 ## to this list of libraries, not replace it.
16 ##
17 LDADD = sbr/libmh.a sbr/libdtimep.a
18
19 ##
20 ## These are used to create the default mhn.defaults config file
21 ## MHNSEARCHPATH is the default path to look for MIME content handlers
22 ## MHNSEARCHPROG is the script used to find the support programs
23 ##
24 MHNSEARCHPATH = "$(PATH):/usr/demo/SOUND"
25 MHNSEARCHPROG = $(srcdir)/etc/mhn.find.sh
26
27 ##
28 ## Automake doesn't let us install programs in $(libdir), so we create our
29 ## own directory prefix to use in the primary variable.
30 ##
31 auxexecdir = @libdir@
32
33 ##
34 ## nmh _does_ have a test suite!
35 ##
36 TESTS_ENVIRONMENT = MH_OBJ_DIR="@abs_builddir@" \
37 MH_TEST_DIR="@abs_builddir@/test/testdir" \
38 auxexecdir="$(auxexecdir)" bindir="$(bindir)" \
39 mandir="$(mandir)" sysconfdir="$(sysconfdir)" \
40 MULTIBYTE_ENABLED=$(MULTIBYTE_ENABLED) \
41 ICONV_ENABLED=$(ICONV_ENABLED) \
42 $(TESTS_SHELL) ## Keep at end of TESTS_ENVIRONMENT.
43 ##
44 ## Important note: the "cleanup" test should always be last
45 ##
46 TESTS = test/ali/test-ali test/anno/test-anno \
47 test/bad-input/test-header \
48 test/burst/test-burst \
49 test/comp/test-comp-format test/dist/test-dist \
50 test/folder/test-create test/folder/test-packf \
51 test/folder/test-recurse test/folder/test-sortm \
52 test/folder/test-total \
53 test/format/test-dp test/format/test-fmtdump \
54 test/format/test-localmbox test/format/test-myname \
55 test/format/test-myhost test/format/test-mymbox \
56 test/format/test-rightjustify \
57 test/forw/test-forw-digest test/forw/test-forw-format \
58 test/inc/test-deb359167 test/inc/test-eom-align \
59 test/inc/test-inc-scanout test/inc/test-msgchk \
60 test/inc/test-pop \
61 test/install-mh/test-install-mh test/manpages/test-manpages \
62 test/mhbuild/test-forw test/mhbuild/test-utf8-body \
63 test/mhlist/test-mhlist test/mhmail/test-mhmail \
64 test/mhparam/test-mhparam test/mhpath/test-mhpath \
65 test/mhshow/test-cte-binary test/mhshow/test-qp \
66 test/mhshow/test-subpart test/mhshow/test-msg-buffer-boundaries \
67 test/mhstore/test-mhstore test/new/test-basic \
68 test/pick/test-pick test/pick/test-stderr \
69 test/post/test-post-aliases test/post/test-post-basic \
70 test/post/test-post-multiple test/post/test-post-bcc \
71 test/post/test-post-dcc test/post/test-post-fcc \
72 test/post/test-post-multifrom test/post/test-post-envelope \
73 test/post/test-post-group test/post/test-mts test/post/test-messageid \
74 test/post/test-sendfiles test/prompter/test-prompter \
75 test/rcv/test-rcvdist test/rcv/test-rcvpack test/rcv/test-rcvstore \
76 test/rcv/test-rcvtty test/refile/test-refile \
77 test/repl/test-if-str test/repl/test-trailing-newline \
78 test/repl/test-multicomp test/repl/test-repl \
79 test/scan/test-scan test/scan/test-scan-multibyte \
80 test/sequences/test-flist test/sequences/test-mark \
81 test/sequences/test-out-of-range \
82 test/slocal/test-slocal \
83 test/whatnow/test-attach-detach test/whatnow/test-cd \
84 test/whatnow/test-ls test/whom/test-whom \
85 test/cleanup ## The "cleanup" test should always be last.
86
87 check_SCRIPTS = test/common.sh
88 check_PROGRAMS = test/getfullname test/getfqdn test/fakepop test/fakesmtp \
89 test/getcwidth
90 DISTCHECK_CONFIGURE_FLAGS = DISABLE_SETGID_MAIL=1
91
92 ##
93 ## Stuff that should be cleaned via "make clean"
94 ##
95 CLEANFILES = config/version.c sbr/sigmsg.h etc/mts.conf \
96 etc/mhn.defaults man/man.sed man/mh-chart.man $(man_MANS)
97 clean-local:
98 @rm -rf RPM a.out.dSYM uip/a.out.dSYM
99 @rm -rf test/testdir
100
101 ##
102 ## Stuff that should be cleaned via "make maintainer-clean"
103 ##
104 MAINTAINERCLEANFILES = cscope.files cscope.out cscope.in.out cscope.po.out
105
106 ##
107 ## And our own superclean, to get everything left by maintainer-clean.
108 ##
109 SUPERCLEANFILES = ChangeLog Makefile.in aclocal.m4 compile config.guess \
110 config.h.in config.h.in~ config.sub configure depcomp \
111 install-sh missing ylwrap nmh-*.tar.gz nmh-*.tar.gz.sig
112 superclean: maintainer-clean
113 @rm -f $(SUPERCLEANFILES)
114 .PHONY: superclean
115
116 ##
117 ## Files that need to be built before everything else
118 ##
119 BUILT_SOURCES = sbr/sigmsg.h
120
121 ##
122 ## This is a list of all programs that get installed in the "bin" directory
123 ## Note that primary difference between "PROGRAMS" and "SCRIPTS" is that
124 ## the latter do not have $(EXEEXT) added on the end.
125 ##
126 bin_PROGRAMS = uip/ali uip/anno uip/burst uip/comp uip/dist uip/flist \
127 uip/folder uip/forw uip/inc uip/install-mh uip/mark \
128 uip/mhbuild uip/mhlist uip/mhn uip/mhparam \
129 uip/mhpath uip/mhshow uip/mhstore uip/msgchk uip/msh uip/new \
130 uip/packf uip/pick uip/prompter uip/refile uip/repl uip/rmf \
131 uip/rmm uip/scan uip/send uip/show uip/sortm uip/whatnow \
132 uip/whom
133
134 bin_SCRIPTS = uip/mhmail etc/sendfiles
135
136 ##
137 ## This is all programs that get installed in the "lib" directory
138 ##
139 auxexec_PROGRAMS = uip/ap uip/conflict uip/dp uip/fmtdump uip/mhl uip/post \
140 uip/rcvdist uip/rcvpack uip/rcvstore uip/rcvtty uip/slocal \
141 uip/viamail uip/mhtest
142
143 auxexec_SCRIPTS = uip/spost
144
145 ##
146 ## Internal libraries that we create as part of the build process
147 ## but do not install
148 ##
149 noinst_LIBRARIES = sbr/libmh.a sbr/libdtimep.a mts/libmts.a
150
151 ##
152 ## These are all of our header files. Right now we don't install any of
153 ## them, but that might change in the future.
154 ##
155 noinst_HEADERS = h/addrsbr.h h/aliasbr.h h/crawl_folders.h h/dropsbr.h \
156 h/fmt_compile.h h/fmt_scan.h h/md5.h h/mf.h \
157 h/mh.h h/mhcachesbr.h h/mhparse.h h/mime.h h/msh.h \
158 h/mts.h h/nmh.h h/picksbr.h h/popsbr.h h/prototypes.h \
159 h/rcvmail.h h/scansbr.h h/signals.h h/tws.h h/utils.h \
160 h/vmhsbr.h mts/smtp/smtp.h
161
162 ##
163 ## Extra files we need to install in various places
164 ##
165 dist_sysconf_DATA = etc/MailAliases etc/components etc/digestcomps \
166 etc/distcomps etc/forwcomps etc/mhl.body etc/mhl.digest \
167 etc/mhl.format etc/mhl.forward etc/mhl.headers \
168 etc/mhl.reply etc/rcvdistcomps etc/rcvdistcomps.outbox \
169 etc/replcomps etc/replgroupcomps etc/scan.MMDDYY \
170 etc/scan.YYYYMMDD etc/scan.default etc/scan.highlighted \
171 etc/scan.mailx etc/scan.nomime etc/scan.size etc/scan.time \
172 etc/scan.timely etc/scan.unseen
173
174 ##
175 ## The same as above, but we don't include these in the distribution
176 ## (because they're generated at compile time)
177 ##
178 sysconf_DATA = etc/mhn.defaults etc/mts.conf
179
180 ##
181 ## Documentation that gets installed in docdir
182 ##
183 dist_doc_DATA = COPYRIGHT INSTALL NEWS README VERSION \
184 docs/COMPLETION-BASH docs/COMPLETION-TCSH \
185 docs/COMPLETION-ZSH docs/DIFFERENCES docs/FAQ \
186 docs/MAIL.FILTERING docs/MAILING-LISTS docs/README-ATTACHMENTS \
187 docs/README-HOOKS docs/README-components docs/README.about \
188 docs/README.SASL docs/README.developers docs/README.manpages \
189 docs/TODO
190
191 ##
192 ## Contribs that get installed in docdir/contrib/
193 ##
194 contribdir = $(docdir)/contrib
195 dist_contrib_DATA = docs/contrib/replyfilter docs/contrib/build_nmh \
196 docs/contrib/ml
197
198 ##
199 ## Our man pages
200 ##
201 man_MANS = man/ali.1 man/anno.1 man/ap.8 man/burst.1 man/comp.1 \
202 man/conflict.8 man/dist.1 man/dp.8 man/flist.1 man/flists.1 \
203 man/fmtdump.8 man/fnext.1 man/folder.1 man/folders.1 \
204 man/forw.1 man/fprev.1 man/inc.1 man/install-mh.1 man/mark.1 \
205 man/mh-alias.5 man/mh-chart.7 man/mh-draft.5 man/mh-format.5 \
206 man/mh-mail.5 man/mh-profile.5 man/mh_profile.5 man/mh-sequence.5 \
207 man/mh-tailor.5 man/mhbuild.1 man/mhl.1 man/mhlist.1 \
208 man/mhmail.1 man/mhn.1 man/mhparam.1 man/mhpath.1 \
209 man/mhshow.1 man/mhstore.1 man/msgchk.1 man/msh.1 \
210 man/mts.conf.5 man/new.1 man/next.1 man/nmh.7 man/packf.1 \
211 man/pick.1 man/post.8 man/prev.1 man/prompter.1 man/rcvdist.1 \
212 man/rcvpack.1 man/rcvstore.1 man/rcvtty.1 man/refile.1 \
213 man/repl.1 man/rmf.1 man/rmm.1 man/scan.1 man/send.1 \
214 man/sendfiles.1 man/show.1 man/slocal.1 man/sortm.1 man/unseen.1 \
215 man/whatnow.1 man/whom.1
216
217 ##
218 ## Sources for our man pages
219 ##
220 man_SRCS = man/ali.man man/anno.man man/ap.man man/burst.man man/comp.man \
221 man/conflict.man man/dist.man man/dp.man man/flist.man \
222 man/flists.man man/fmtdump.man man/fnext.man man/folder.man \
223 man/folders.man man/forw.man man/fprev.man man/inc.man \
224 man/install-mh.man man/mark.man man/mh-alias.man \
225 man/mh-chart-gen.sh man/mh-draft.man man/mh-format.man \
226 man/mh-mail.man man/mh-profile.man man/mh_profile.man \
227 man/mh-sequence.man man/mh-tailor.man man/mhbuild.man man/mhl.man \
228 man/mhlist.man man/mhmail.man man/mhn.man man/mhparam.man \
229 man/mhpath.man man/mhshow.man man/mhstore.man man/msgchk.man \
230 man/msh.man man/mts.conf.man man/new.man man/next.man man/nmh.man \
231 man/packf.man man/pick.man man/post.man man/prev.man \
232 man/prompter.man man/rcvdist.man man/rcvpack.man \
233 man/rcvstore.man man/rcvtty.man man/refile.man man/repl.man \
234 man/rmf.man man/rmm.man man/scan.man man/send.man \
235 man/sendfiles.man man/show.man man/slocal.man man/sortm.man \
236 man/unseen.man man/whatnow.man man/whom.man
237
238 ##
239 ## Files we need to include in the distribution which aren't found by
240 ## Automake using the automatic rules
241 ##
242 EXTRA_DIST = config/version.sh sbr/sigmsg.awk etc/mts.conf.in \
243 etc/mhn.defaults.sh etc/sendfiles $(MHNSEARCHPROG) DATE MACHINES \
244 docs/ChangeLog_MH-3_to_MH-6.6 \
245 docs/ChangeLog_MH-6.7.0_to_MH-6.8.4.html \
246 test/README test/fakesendmail $(TESTS) test/inc/deb359167.mbox \
247 test/inc/fromline.txt test/inc/msgheader.txt test/inc/filler.txt \
248 test/inc/md5sums test/mhmail/attachment.txt \
249 test/post/test-post-common.sh uip/mhmail \
250 SPECS/nmh.spec SPECS/build-nmh-cygwin $(man_SRCS)
251
252 ##
253 ## These are all of the definitions for each of the programs listed above.
254 ## They describe the source files that make up the programs and any particular
255 ## overrides that are used to select different library options from the
256 ## default.
257 ##
258 uip_ali_SOURCES = uip/ali.c uip/aliasbr.c
259
260 uip_anno_SOURCES = uip/anno.c uip/annosbr.c
261
262 uip_burst_SOURCES = uip/burst.c
263
264 uip_comp_SOURCES = uip/comp.c uip/whatnowproc.c uip/whatnowsbr.c uip/sendsbr.c \
265 uip/annosbr.c uip/distsbr.c
266 uip_comp_LDADD = $(LDADD) $(ICONVLIB) $(READLINELIB)
267
268 uip_dist_SOURCES = uip/dist.c uip/whatnowproc.c uip/whatnowsbr.c uip/sendsbr.c \
269 uip/annosbr.c uip/distsbr.c uip/forwsbr.c
270 uip_dist_LDADD = $(LDADD) $(ICONVLIB) $(READLINELIB)
271
272 uip_flist_SOURCES = uip/flist.c
273
274 uip_folder_SOURCES = uip/folder.c
275
276 uip_forw_SOURCES = uip/forw.c uip/whatnowproc.c uip/whatnowsbr.c uip/sendsbr.c \
277 uip/annosbr.c uip/distsbr.c uip/forwsbr.c
278 uip_forw_LDADD = $(LDADD) $(ICONVLIB) $(READLINELIB)
279
280 uip_inc_SOURCES = uip/inc.c uip/scansbr.c uip/dropsbr.c uip/termsbr.c \
281 uip/popsbr.c
282 uip_inc_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) $(SASLLIB)
283
284 uip_install_mh_SOURCES = uip/install-mh.c
285
286 uip_mark_SOURCES = uip/mark.c
287
288 uip_mhbuild_SOURCES = uip/mhbuild.c uip/mhbuildsbr.c uip/mhcachesbr.c \
289 uip/mhlistsbr.c uip/mhoutsbr.c uip/mhmisc.c \
290 uip/mhfree.c uip/mhparse.c uip/termsbr.c uip/md5.c
291 uip_mhbuild_LDADD = $(LDADD) $(TERMLIB)
292
293 uip_mhlist_SOURCES = uip/mhlist.c uip/mhparse.c uip/mhcachesbr.c \
294 uip/mhlistsbr.c uip/mhmisc.c uip/mhfree.c uip/termsbr.c \
295 uip/md5.c
296 uip_mhlist_LDADD = $(LDADD) $(TERMLIB)
297
298 uip_mhn_SOURCES = uip/mhn.c uip/mhparse.c uip/mhcachesbr.c uip/mhshowsbr.c \
299 uip/mhlistsbr.c uip/mhstoresbr.c uip/mhmisc.c uip/mhfree.c \
300 uip/termsbr.c uip/md5.c
301 uip_mhn_LDADD = $(LDADD) $(TERMLIB)
302
303 uip_mhparam_SOURCES = uip/mhparam.c
304
305 uip_mhpath_SOURCES = uip/mhpath.c
306
307 uip_mhshow_SOURCES = uip/mhshow.c uip/mhparse.c uip/mhcachesbr.c \
308 uip/mhshowsbr.c uip/mhlistsbr.c uip/mhmisc.c \
309 uip/mhfree.c uip/termsbr.c uip/md5.c
310 uip_mhshow_LDADD = $(LDADD) $(TERMLIB)
311
312 uip_mhstore_SOURCES = uip/mhstore.c uip/mhparse.c uip/mhcachesbr.c \
313 uip/mhshowsbr.c uip/mhlistsbr.c uip/mhstoresbr.c \
314 uip/mhmisc.c uip/mhfree.c uip/termsbr.c uip/md5.c
315 uip_mhstore_LDADD = $(LDADD) $(TERMLIB)
316
317 uip_msgchk_SOURCES = uip/msgchk.c uip/popsbr.c
318 uip_msgchk_LDADD = $(LDADD) $(SASLLIB)
319
320 uip_msh_SOURCES = uip/msh.c uip/mshcmds.c uip/vmhsbr.c uip/picksbr.c \
321 uip/scansbr.c uip/dropsbr.c uip/mhlsbr.c uip/termsbr.c
322 uip_msh_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB)
323
324 uip_new_SOURCES = uip/new.c
325
326 uip_packf_SOURCES = uip/packf.c uip/dropsbr.c
327
328 uip_pick_SOURCES = uip/pick.c uip/picksbr.c
329 uip_pick_LDADD = $(LDADD) $(ICONVLIB)
330
331 uip_prompter_SOURCES = uip/prompter.c
332
333 uip_refile_SOURCES = uip/refile.c
334
335 uip_repl_SOURCES = uip/repl.c uip/replsbr.c uip/whatnowproc.c \
336 uip/whatnowsbr.c uip/sendsbr.c uip/annosbr.c uip/distsbr.c
337 uip_repl_LDADD = $(LDADD) $(ICONVLIB) $(READLINELIB)
338
339 uip_rmf_SOURCES = uip/rmf.c
340
341 uip_rmm_SOURCES = uip/rmm.c
342
343 uip_scan_SOURCES = uip/scan.c uip/scansbr.c uip/termsbr.c
344 uip_scan_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB)
345
346 uip_send_SOURCES = uip/send.c uip/sendsbr.c uip/annosbr.c uip/distsbr.c
347
348 uip_show_SOURCES = uip/show.c uip/mhlsbr.c uip/termsbr.c
349 uip_show_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB)
350
351 uip_sortm_SOURCES = uip/sortm.c
352
353 uip_whatnow_SOURCES = uip/whatnow.c uip/whatnowsbr.c uip/sendsbr.c \
354 uip/annosbr.c uip/distsbr.c
355 uip_whatnow_LDADD = $(LDADD) $(READLINELIB)
356
357 uip_whom_SOURCES = uip/whom.c uip/distsbr.c
358
359 ##
360 ## Programs definitions for all utilities that end up in $(libdir)
361 ##
362
363 uip_ap_SOURCES = uip/ap.c uip/termsbr.c
364 uip_ap_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB)
365
366 uip_conflict_SOURCES = uip/conflict.c uip/aliasbr.c
367
368 uip_dp_SOURCES = uip/dp.c uip/termsbr.c
369 uip_dp_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB)
370
371 uip_fmtdump_SOURCES = uip/fmtdump.c
372 uip_fmtdump_LDADD = $(LDADD) $(ICONVLIB)
373
374 uip_mhl_SOURCES = uip/mhl.c uip/mhlsbr.c uip/termsbr.c
375 uip_mhl_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB)
376
377 uip_mhtest_SOURCES = uip/mhtest.c uip/mhparse.c uip/mhcachesbr.c \
378 uip/mhoutsbr.c uip/mhmisc.c uip/mhfree.c \
379 uip/termsbr.c uip/md5.c
380 uip_mhtest_LDADD = $(LDADD) $(TERMLIB)
381
382 uip_post_SOURCES = uip/post.c uip/aliasbr.c
383 uip_post_LDADD = mts/libmts.a $(LDADD) $(SASLLIB) $(TLSLIB)
384
385 uip_rcvdist_SOURCES = uip/rcvdist.c uip/distsbr.c
386 uip_rcvdist_LDADD = $(LDADD) $(ICONVLIB)
387
388 uip_rcvpack_SOURCES = uip/rcvpack.c uip/dropsbr.c
389
390 uip_rcvstore_SOURCES = uip/rcvstore.c
391
392 uip_rcvtty_SOURCES = uip/rcvtty.c uip/scansbr.c uip/termsbr.c
393 uip_rcvtty_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB)
394
395 uip_slocal_SOURCES = uip/slocal.c uip/aliasbr.c uip/dropsbr.c
396 uip_slocal_LDADD = $(LDADD) $(NDBM_LIBS)
397
398 uip_viamail_SOURCES = uip/viamail.c uip/mhmisc.c uip/mhoutsbr.c uip/sendsbr.c \
399 uip/annosbr.c uip/distsbr.c
400
401 test_getfullname_SOURCES = test/getfullname.c
402 test_getfullname_LDADD = sbr/libmh.a
403
404 test_getfqdn_SOURCES = test/getfqdn.c
405 test_getfqdn_LDADD =
406
407 test_fakepop_SOURCES = test/fakepop.c
408 test_fakepop_LDADD =
409
410 test_fakesmtp_SOURCES = test/fakesmtp.c
411 test_fakesmtp_LDADD =
412
413 ##
414 ## Our rebuild rules for files that aren't built via the normal mechanisms
415 ##
416 config/version.c: Makefile
417 sh $(srcdir)/config/version.sh $(VERSION) > $@
418
419 sbr/sigmsg.h: $(srcdir)/sbr/sigmsg.awk $(SIGNAL_H)
420 $(AWK) -f $(srcdir)/sbr/sigmsg.awk $(SIGNAL_H) > $@
421
422 etc/mts.conf: $(srcdir)/etc/mts.conf.in Makefile
423 @rm -f $@
424 $(SED) -e 's,%mts%,$(MTS),' \
425 -e 's,%mailspool%,$(mailspool),' \
426 -e 's,%smtpservers%,$(smtpservers),' \
427 < $(srcdir)/etc/mts.conf.in > $@
428
429 etc/mhn.defaults: $(srcdir)/etc/mhn.defaults.sh $(MHNSEARCHPROG)
430 @rm -f $@
431 $(srcdir)/etc/mhn.defaults.sh $(MHNSEARCHPATH) $(MHNSEARCHPROG) > $@
432
433 ##
434 ## Use configure to set up default LN, but through a make variable so
435 ## that it can be overridden at install time.
436 ##
437 LN = @LN@
438
439 ##
440 ## This rule gets called at "make install" time; we use it to create links
441 ## between different programs.
442 ##
443 install-exec-hook:
444 @rm -f $(DESTDIR)$(bindir)/flists$(EXEEXT)
445 @rm -f $(DESTDIR)$(bindir)/folders$(EXEEXT)
446 @rm -f $(DESTDIR)$(bindir)/fnext$(EXEEXT)
447 @rm -f $(DESTDIR)$(bindir)/fprev$(EXEEXT)
448 @rm -f $(DESTDIR)$(bindir)/unseen$(EXEEXT)
449 @rm -f $(DESTDIR)$(bindir)/prev$(EXEEXT)
450 @rm -f $(DESTDIR)$(bindir)/next$(EXEEXT)
451 $(LN) $(DESTDIR)$(bindir)/flist$(EXEEXT) $(DESTDIR)$(bindir)/flists$(EXEEXT)
452 $(LN) $(DESTDIR)$(bindir)/folder$(EXEEXT) $(DESTDIR)$(bindir)/folders$(EXEEXT)
453 $(LN) $(DESTDIR)$(bindir)/new$(EXEEXT) $(DESTDIR)$(bindir)/fnext$(EXEEXT)
454 $(LN) $(DESTDIR)$(bindir)/new$(EXEEXT) $(DESTDIR)$(bindir)/fprev$(EXEEXT)
455 $(LN) $(DESTDIR)$(bindir)/new$(EXEEXT) $(DESTDIR)$(bindir)/unseen$(EXEEXT)
456 $(LN) $(DESTDIR)$(bindir)/show$(EXEEXT) $(DESTDIR)$(bindir)/prev$(EXEEXT)
457 $(LN) $(DESTDIR)$(bindir)/show$(EXEEXT) $(DESTDIR)$(bindir)/next$(EXEEXT)
458 if test x$(SETGID_MAIL) != x; then \
459 chgrp $(MAIL_SPOOL_GRP) $(DESTDIR)$(bindir)/inc$(EXEEXT) && \
460 chmod 2755 $(DESTDIR)$(bindir)/inc$(EXEEXT); \
461 fi
462
463 ##
464 ## Make sure we remove those links at uninstall time
465 ##
466 uninstall-hook:
467 rm -f $(DESTDIR)$(bindir)/flists$(EXEEXT)
468 rm -f $(DESTDIR)$(bindir)/folders$(EXEEXT)
469 rm -f $(DESTDIR)$(bindir)/fnext$(EXEEXT)
470 rm -f $(DESTDIR)$(bindir)/fprev$(EXEEXT)
471 rm -f $(DESTDIR)$(bindir)/unseen$(EXEEXT)
472 rm -f $(DESTDIR)$(bindir)/prev$(EXEEXT)
473 rm -f $(DESTDIR)$(bindir)/next$(EXEEXT)
474
475 ##
476 ## Our rules to build our internal libraries (libmh.a, libmts.a)
477 ##
478 sbr_libmh_a_SOURCES = sbr/addrsbr.c sbr/ambigsw.c sbr/atooi.c sbr/arglist.c \
479 sbr/base64.c \
480 sbr/brkstring.c sbr/check_charset.c sbr/client.c \
481 sbr/closefds.c sbr/concat.c sbr/context_del.c \
482 sbr/context_find.c sbr/context_foil.c sbr/context_read.c \
483 sbr/context_replace.c sbr/context_save.c \
484 sbr/copy.c sbr/copyip.c sbr/cpydata.c \
485 sbr/cpydgst.c sbr/crawl_folders.c sbr/discard.c \
486 sbr/done.c sbr/dtime.c sbr/escape_addresses.c \
487 sbr/error.c sbr/ext_hook.c sbr/fdcompare.c \
488 sbr/folder_addmsg.c sbr/folder_delmsgs.c \
489 sbr/folder_free.c sbr/folder_pack.c \
490 sbr/folder_read.c sbr/folder_realloc.c sbr/gans.c \
491 sbr/getans.c sbr/getanswer.c sbr/getarguments.c \
492 sbr/getcpy.c sbr/geteditor.c sbr/getfolder.c \
493 sbr/getpass.c \
494 sbr/fmt_addr.c sbr/fmt_compile.c sbr/fmt_new.c \
495 sbr/fmt_rfc2047.c sbr/fmt_scan.c sbr/lock_file.c \
496 sbr/m_atoi.c sbr/m_backup.c sbr/m_convert.c \
497 sbr/m_draft.c sbr/m_getfld.c sbr/m_gmprot.c \
498 sbr/m_maildir.c sbr/m_name.c sbr/m_rand.c \
499 sbr/makedir.c sbr/message_id.c sbr/mts.c \
500 sbr/norm_charmap.c sbr/path.c \
501 sbr/peekc.c sbr/pidwait.c sbr/pidstatus.c \
502 sbr/print_help.c sbr/print_sw.c sbr/print_version.c \
503 sbr/push.c sbr/putenv.c sbr/refile.c sbr/remdir.c \
504 sbr/r1bindex.c sbr/readconfig.c sbr/ruserpass.c \
505 sbr/seq_add.c sbr/seq_bits.c sbr/seq_del.c \
506 sbr/seq_getnum.c sbr/seq_list.c sbr/seq_nameok.c \
507 sbr/seq_print.c sbr/seq_read.c sbr/seq_save.c \
508 sbr/seq_setcur.c sbr/seq_setprev.c sbr/seq_setunseen.c \
509 sbr/showfile.c sbr/signals.c sbr/smatch.c \
510 sbr/snprintb.c sbr/ssequal.c sbr/strcasecmp.c \
511 sbr/strindex.c sbr/trimcpy.c sbr/uprf.c sbr/vfgets.c \
512 sbr/fmt_def.c sbr/mf.c sbr/utils.c \
513 sbr/m_mktemp.c sbr/getansreadline.c config/config.c \
514 config/version.c
515
516 sbr_libmh_a_CPPFLAGS = -I./sbr -DNMHETCDIR='"$(sysconfdir)"' \
517 -DMAILSPOOL='"$(mailspool)"' \
518 -DSENDMAILPATH='"$(sendmailpath)"' -DNMHBINDIR='"$(bindir)"' \
519 -DNMHLIBDIR='"$(libdir)"'
520
521 sbr_libdtimep_a_SOURCES = sbr/dtimep.l
522 sbr_libdtimep_a_CFLAGS = $(sbr_libmh_a_CPPFLAGS) \
523 $(DISABLE_SIGN_COMPARE_WARNING)
524
525 mts_libmts_a_SOURCES = mts/smtp/smtp.c
526
527 ##
528 ## Our rules for generating man pages (both the rule for man.sed and
529 ## the implicit rules for man page generation).
530 ##
531 manext1 = 1
532 manext5 = 5
533 manext7 = 7
534 manext8 = 8
535
536 $(man_MANS): man/man.sed
537
538 man/man.sed: Makefile
539 @echo 's,%nmhwarning%,THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.,g' > $@
540 @echo 's,%nmhversion%,nmh-$(VERSION),g' >> $@
541 @echo 's,%bindir%,$(bindir),g' >> $@
542 @echo 's,%etcdir%,$(sysconfdir),g' >> $@
543 @echo 's,%libdir%,$(libdir),g' >> $@
544 @echo 's,%mandir%,$(mandir),g' >> $@
545 @echo 's,%mailspool%,$(mailspool),g' >> $@
546 @echo 's,%sendmailpath%,$(sendmailpath),g' >> $@
547 @echo 's,%manext1%,$(manext1),g' >> $@
548 @echo 's,%manext5%,$(manext5),g' >> $@
549 @echo 's,%manext7%,$(manext7),g' >> $@
550 @echo 's,%manext8%,$(manext8),g' >> $@
551 @echo '/%mhl_forward%/r $(top_srcdir)/etc/mhl.forward' >> $@
552 @echo ' s,%mhl_forward%,,g' >> $@
553 @echo '/%mhl_format%/r $(top_srcdir)/etc/mhl.format' >> $@
554 @echo ' s,%mhl_format%,,g' >> $@
555 @echo '/%mhl_reply%/r $(top_srcdir)/etc/mhl.reply' >> $@
556 @echo ' s,%mhl_reply%,,g' >> $@
557
558 man/mh-chart.man: $(man_SRCS)
559 $(srcdir)/man/mh-chart-gen.sh > $@
560
561 .man.$(manext1):
562 $(SED) -f man/man.sed $< > $@
563
564 .man.$(manext5):
565 $(SED) -f man/man.sed $< > $@
566
567 .man.$(manext7):
568 $(SED) -f man/man.sed $< > $@
569
570 .man.$(manext8):
571 $(SED) -f man/man.sed $< > $@
572
573 man: $(man_MANS)
574
575 cleanman:
576 rm -f $(man_MANS)
577
578 .PHONY: man cleanman
579
580 ## Don't include commit hashes in ChangeLog.
581 ChangeLog:
582 @[ -d .git ] && git --no-pager log --abbrev-commit | \
583 egrep -v '^commit [0-9a-f]+$$' > $@ || true
584 ## Make ChangeLog phony so it will always get regenerated. But don't
585 ## fail if we don't have a git repository in order to allow
586 ## regeneration of distribution archive or RPM.
587 .PHONY: ChangeLog
588
589 ##
590 ## Our RPM build target
591 ##
592 rpm: dist
593 @test -d $(rpmdir)/SOURCES || $(MKDIR_P) $(rpmdir)/SOURCES
594 @mv -f $(DIST_ARCHIVES) $(rpmdir)/SOURCES
595 @cp -p VERSION $(rpmdir)/SOURCES
596 @rpmbuild --define '_topdir $(rpmdir)' \
597 --define '_tmppath %{_topdir}/TMP' \
598 --define "_sysconfdir $(DESTDIR)$(sysconfdir)" \
599 -ba SPECS/nmh.spec
600 .PHONY: rpm
601
602
603 ##
604 ## Use GNU gcov to find the coverage of the test suite.
605 ## These targets are not integrated into the other automake
606 ## targets because they will be used so infrequently, if at all.
607 ##
608 gcov:
609 @if ./config.status --config | grep -e --enable-debug >/dev/null; then \
610 echo For best results with gcov, configure without --enable-debug; \
611 fi
612 @echo rebuilding with AM_CFLAGS=--coverage . . .
613 @(make clean && make AM_CFLAGS=--coverage) > /dev/null && \
614 make check AM_CFLAGS=--coverage
615 @for i in `find . -name '*.gcda'`; do \
616 gcov -p -o `echo $$i | $(SED) 's%\\(.*\\)/%\\1 %'`; \
617 done
618 @for i in `find . -name '*.gcno'`; do \
619 if test -f `echo $$i | sed 's%\.gcno%.gcda%'`; then :; else \
620 echo untested: $$i; \
621 fi; \
622 done
623 gcov-mostlyclean:
624 @find . -name '*.gcno' -o -name '*.gcda' | xargs rm
625 gcov-clean: gcov-mostlyclean
626 @find . -name '*.gcov' | xargs rm
627 .PHONY: gcov gcov-mostlyclean gcov-clean
628
629
630 ##
631 ## Rules to upload the distribution to savannah
632 ##
633 upload: dist
634 @if test -z "$(SAVANNAH_USERNAME)"; then \
635 echo "You need to set SAVANNAH_USERNAME to the your username on savannah.gnu.org." ;\
636 echo "You can set it either in your environment or on the make command line."; \
637 false; \
638 fi
639 @echo "Did you run 'make distcheck' already?"
640 @if test -z "$(SKIP_GPG_SIG)"; then \
641 echo "Creating GPG signature (set SKIP_GPG_SIG to bypass this step)"; \
642 gpg --output $(DIST_ARCHIVES).sig --detach-sig $(DIST_ARCHIVES); \
643 fi
644 @echo "Setting permissions for savannah.gnu.org"
645 chmod 664 $(DIST_ARCHIVES)
646 if test -f $(DIST_ARCHIVES).sig; then \
647 chmod 664 $(DIST_ARCHIVES).sig; \
648 fi
649 @echo "Uploading to savannah"
650 scp -p $(DIST_ARCHIVES)* $(SAVANNAH_USERNAME)@dl.sv.nongnu.org:/releases/nmh
651 .PHONY: upload