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