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