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