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