]> diplodocus.org Git - nmh/blobdiff - Makefile.am
Reverted commit 9a4b4a3d3b27fe4a7ff6d0b8724ce1c06b5917eb.
[nmh] / Makefile.am
index 91b53efe5b5712f716c1e3ea1374232118302d8a..c79adeb6a0cd6d6e1a2c0ba33e0156cd3567dc91 100644 (file)
@@ -55,9 +55,11 @@ TESTS = test/ali/test-ali test/anno/test-anno \
        test/bad-input/test-header \
        test/burst/test-burst test/burst/test-burst-mime \
        test/comp/test-comp-format test/dist/test-dist \
+       test/folder/test-coverage \
        test/folder/test-create test/folder/test-nocreate \
        test/folder/test-packf test/folder/test-recurse \
        test/folder/test-sortm test/folder/test-total \
+       test/format/test-ap \
        test/format/test-curses test/format/test-dp \
        test/format/test-fmtdump test/format/test-functions \
        test/format/test-localmbox test/format/test-myname \
@@ -65,6 +67,7 @@ TESTS = test/ali/test-ali test/anno/test-anno \
        test/format/test-nullstr \
        test/format/test-rightjustify \
        test/format/test-unquote \
+       test/forw/test-forw-coverage \
        test/forw/test-forw-digest test/forw/test-forw-format \
        test/inc/test-deb359167 test/inc/test-eom-align \
        test/inc/test-inc-scanout test/inc/test-msgchk \
@@ -72,7 +75,7 @@ TESTS = test/ali/test-ali test/anno/test-anno \
        test/install-mh/test-install-mh test/install-mh/test-version-check \
        test/locking/test-datalocking test/locking/test-spoollocking \
        test/manpages/test-manpages \
-       test/mhbuild/test-attach \
+       test/mhbuild/test-attach test/mhbuild/test-mhbuild \
        test/mhbuild/test-cte \
        test/mhbuild/test-ext-params \
        test/mhbuild/test-forw test/mhbuild/test-header-encode \
@@ -82,6 +85,7 @@ TESTS = test/ali/test-ali test/anno/test-anno \
        test/mhlist/test-mhlist test/mhlist/test-ext-params \
        test/mhmail/test-mhmail \
        test/mhparam/test-mhparam test/mhpath/test-mhpath \
+       test/mhshow/test-binary \
        test/mhshow/test-charset test/mhshow/test-textcharset \
        test/mhshow/test-cte-binary test/mhshow/test-qp \
        test/mhshow/test-subpart test/mhshow/test-msg-buffer-boundaries \
@@ -100,6 +104,7 @@ TESTS = test/ali/test-ali test/anno/test-anno \
        test/rcv/test-rcvtty test/refile/test-refile test/repl/test-convert \
        test/repl/test-if-str test/repl/test-trailing-newline \
        test/repl/test-multicomp test/repl/test-repl \
+       test/scan/test-header-parsing \
        test/scan/test-scan test/scan/test-scan-multibyte \
        test/sequences/test-flist test/sequences/test-mark \
        test/sequences/test-out-of-range \
@@ -110,10 +115,16 @@ TESTS = test/ali/test-ali test/anno/test-anno \
        test/whatnow/test-ls test/whom/test-whom \
        test/cleanup ## The "cleanup" test should always be last.
 
+XFAIL_TESTS = \
+    #
+
 check_SCRIPTS = test/common.sh
 check_PROGRAMS = test/getfullname test/getcanon test/fakepop test/fakesmtp \
                 test/getcwidth test/fakehttp
 
+## So they can be built without builing the `check' target.
+check-programs: $(check_PROGRAMS)
+
 ## The location of installed nmhetcdir is, for all purposes except
 ## distcheck, $nmhetcdir.  For distcheck, prepend $MH_INST_DIR (from
 ## test/common.sh.in), which is based on $MH_TEST_DIR (from
@@ -125,10 +136,9 @@ AM_DISTCHECK_CONFIGURE_FLAGS = DISABLE_SETGID_MAIL=1 \
 ## Stuff that should be cleaned via "make clean"
 ## automake 1.12.6 on FreeBSD 9 needs the sbr/dtimep.c.
 ##
-CLEANFILES = config/version.c sbr/sigmsg.h sbr/dtimep.c etc/mts.conf \
-            etc/gen-ctype-checked sbr/ctype-checked.[hc] \
-            etc/mhn.defaults man/man.sed man/mh-chart.man $(man_MANS) \
-            *.plist
+CLEANFILES = config/version.c sbr/dtimep.c \
+            etc/bash_completion_nmh etc/mhn.defaults etc/mts.conf \
+            man/man.sed man/mh-chart.man $(man_MANS) *.plist
 clean-local:
        @rm -rf RPM a.out.dSYM uip/a.out.dSYM
        @rm -rf test/testdir
@@ -149,11 +159,6 @@ superclean: maintainer-clean
        @rm -f $(SUPERCLEANFILES)
 .PHONY: superclean
 
-##
-## Files that need to be built before everything else
-##
-BUILT_SOURCES = sbr/ctype-checked.c
-
 ##
 ## This is a list of all programs that get installed in the "bin" directory
 ## Note that primary difference between "PROGRAMS" and "SCRIPTS" is that
@@ -178,13 +183,6 @@ nmhlibexec_PROGRAMS = uip/ap uip/dp uip/fmtdump uip/mhl uip/mkstemp \
 
 nmhlibexec_SCRIPTS = uip/spost
 
-##
-## Programs that MAY need to get built at some point; we need to list them
-## here if they don't appear in any other primary so Automake knows about
-## them and can properly record dependency information.
-##
-EXTRA_PROGRAMS = etc/gen-ctype-checked
-
 ##
 ## Internal libraries that we create as part of the build process
 ## but do not install
@@ -223,14 +221,14 @@ dist_nmhetc_DATA = etc/MailAliases etc/components etc/digestcomps \
 ## The same as above, but we don't include these in the distribution
 ## (because they're generated at compile time)
 ##
-nmhetc_DATA = etc/mhn.defaults etc/mts.conf
+nmhetc_DATA = etc/bash_completion_nmh etc/mhn.defaults etc/mts.conf
 
 ##
 ## Documentation that gets installed in docdir
 ##
 dist_doc_DATA = COPYRIGHT INSTALL NEWS README VERSION \
-               docs/COMPLETION-BASH docs/COMPLETION-TCSH \
-               docs/COMPLETION-ZSH docs/DIFFERENCES docs/FAQ \
+               docs/COMPLETION-TCSH docs/COMPLETION-ZSH \
+               docs/DIFFERENCES docs/FAQ \
                docs/MAIL.FILTERING docs/MAILING-LISTS docs/README-ATTACHMENTS \
                docs/README-HOOKS docs/README-components docs/README.about \
                docs/README.SASL docs/README.developers docs/README.manpages \
@@ -240,7 +238,7 @@ dist_doc_DATA = COPYRIGHT INSTALL NEWS README VERSION \
 ## Contribs that get installed in docdir/contrib/
 ##
 docs_contribdir = $(docdir)/contrib
-dist_docs_contrib_SCRIPTS = docs/contrib/replyfilter docs/contrib/build_nmh \
+dist_docs_contrib_SCRIPTS = docs/contrib/replyfilter \
                            docs/contrib/localpostproc docs/contrib/ml \
                            docs/contrib/vpick docs/contrib/replaliases
 dist_docs_contrib_DATA = docs/contrib/replaliases
@@ -290,8 +288,9 @@ man_SRCS = man/MH.man man/ali.man man/anno.man man/ap.man man/burst.man  \
 ## Files we need to include in the distribution which aren't found by
 ## Automake using the automatic rules
 ##
-EXTRA_DIST = autogen.sh config/version.sh sbr/icalparse.h \
-            etc/mts.conf.in etc/mhn.defaults.sh etc/sendfiles \
+EXTRA_DIST = autogen.sh build_nmh config/version.sh sbr/icalparse.h \
+            etc/bash_completion_nmh-gen etc/mhn.defaults.sh etc/mts.conf.in \
+            etc/sendfiles \
             $(MHNSEARCHPROG) DATE MACHINES \
             docs/ChangeLog_MH-3_to_MH-6.6 \
             docs/ChangeLog_MH-6.7.0_to_MH-6.8.4.html \
@@ -504,14 +503,11 @@ test_fakesmtp_SOURCES = test/fakesmtp.c test/server.c
 test_fakesmtp_LDADD = $(POSTLINK)
 
 test_fakehttp_SOURCES = test/fakehttp.c test/server.c
-test_fakehttp_LDADD = $(POSTLINK)
+test_fakehttp_LDADD = $(LDADD) $(POSTLINK)
 
 test_getcwidth_SOURCES = test/getcwidth.c
 test_getcwidth_LDADD = $(POSTLINK)
 
-etc_gen_ctype_checked_SOURCES = etc/gen-ctype-checked.c
-etc_gen_ctype_checked_LDADD = $(POSTLINK)
-
 ##
 ## Our rebuild rules for files that aren't built via the normal mechanisms
 ##
@@ -522,10 +518,9 @@ etc_gen_ctype_checked_LDADD = $(POSTLINK)
 config/version.c: Makefile $(srcdir)/config/version.sh
        env srcdir="$(srcdir)" sh $(srcdir)/config/version.sh $(VERSION) > ./config/version.c
 
-sbr/ctype-checked.h: etc/gen-ctype-checked
-       etc/gen-ctype-checked
-
-sbr/ctype-checked.c: etc/gen-ctype-checked sbr/ctype-checked.h
+etc/bash_completion_nmh: $(srcdir)/etc/bash_completion_nmh-gen
+       $(MKDIR_P) $(@D) # FIXME: A better way?
+       $(srcdir)/etc/bash_completion_nmh-gen > $@
 
 etc/mts.conf: $(srcdir)/etc/mts.conf.in Makefile
        @rm -f $@
@@ -537,6 +532,7 @@ etc/mts.conf: $(srcdir)/etc/mts.conf.in Makefile
                                < $(srcdir)/etc/mts.conf.in > $@
 
 etc/mhn.defaults: $(srcdir)/etc/mhn.defaults.sh $(MHNSEARCHPROG)
+       $(MKDIR_P) $(@D) # FIXME: A better way?
        @rm -f $@
        $(srcdir)/etc/mhn.defaults.sh $(MHNSEARCHPATH) $(MHNSEARCHPROG) > $@
 
@@ -591,7 +587,7 @@ sbr_libmh_a_SOURCES = sbr/addrsbr.c sbr/ambigsw.c sbr/atooi.c sbr/arglist.c \
                      sbr/closefds.c sbr/concat.c sbr/context_del.c \
                      sbr/context_find.c sbr/context_foil.c sbr/context_read.c \
                      sbr/context_replace.c sbr/context_save.c \
-                     sbr/copy.c sbr/copyip.c sbr/cpydata.c \
+                     sbr/copyip.c sbr/cpydata.c \
                      sbr/cpydgst.c sbr/crawl_folders.c sbr/credentials.c \
                      sbr/discard.c sbr/done.c sbr/dtimep.l sbr/dtime.c \
                      sbr/encode_rfc2047.c \
@@ -614,7 +610,7 @@ sbr_libmh_a_SOURCES = sbr/addrsbr.c sbr/ambigsw.c sbr/atooi.c sbr/arglist.c \
                      sbr/makedir.c sbr/md5.c sbr/message_id.c \
                      sbr/mime_type.c sbr/mts.c sbr/netsec.c \
                      sbr/norm_charmap.c sbr/path.c \
-                     sbr/peekc.c sbr/pidwait.c sbr/pidstatus.c \
+                     sbr/pidwait.c sbr/pidstatus.c \
                      sbr/print_help.c sbr/print_sw.c sbr/print_version.c \
                      sbr/push.c sbr/putenv.c sbr/refile.c sbr/remdir.c \
                      sbr/r1bindex.c sbr/readconfig.c sbr/ruserpass.c \
@@ -632,6 +628,8 @@ sbr_libmh_a_SOURCES = sbr/addrsbr.c sbr/ambigsw.c sbr/atooi.c sbr/arglist.c \
                      config/config.c config/version.c \
                      thirdparty/jsmn/jsmn.c
 
+sbr_libmh_a_LIBADD = $(LIBOBJS)
+
 ##
 ## Because these files use the definitions in the libmh rule below,
 ## they need to be rebuilt if the Makefile changes.
@@ -733,16 +731,17 @@ rpm: dist
 ## These targets are not integrated into the other automake
 ## targets because they will be used so infrequently, if at all.
 ##
-gcov:
-       @if ./config.status --config | grep -e --enable-debug >/dev/null; then \
-          echo For best results with gcov, configure without --enable-debug; \
-        fi
+gcov: gcov-rebuild gcov-run gcov-process gcov-report
+gcov-rebuild:
        @echo rebuilding with AM_CFLAGS=--coverage . . .
-       @(make clean  &&  make AM_CFLAGS=--coverage) > /dev/null  && \
-         make check AM_CFLAGS=--coverage
+       @(make clean  &&  make AM_CFLAGS=--coverage) > /dev/null
+gcov-run:
+       make check AM_CFLAGS=--coverage
+gcov-process:
        @for i in `find . -name '*.gcda'`; do \
-          gcov -p -o `echo $$i | $(SED) 's%\\(.*\\)/%\\1 %'`; \
+          gcov -pro `echo $$i | $(SED) 's%\\(.*\\)/%\\1 %'`; \
         done
+gcov-report:
        @for i in `find . -name '*.gcno'`; do \
           if test -f `echo $$i | sed 's%\.gcno%.gcda%'`; then :; else \
             echo untested: $$i; \
@@ -752,7 +751,8 @@ gcov-mostlyclean:
        @find . -name '*.gcno' -o -name '*.gcda' | xargs rm
 gcov-clean: gcov-mostlyclean
        @find . -name '*.gcov' | xargs rm
-.PHONY: gcov gcov-mostlyclean gcov-clean
+.PHONY: gcov gcov-rebuild gcov-run gcov-process gcov-report \
+    gcov-mostlyclean gcov-clean
 
 
 ##