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