X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=Makefile.am;h=3f1650df211b606f23d1a7a232919c194bbc7db0;hb=df31d2abe4d453eaef9a818a83bae42e80a1e67b;hp=56178f9d742011331c4cd6d6d7c09b9c742d8d1c;hpb=dc1f54e0b883f7deec844b7acd87d5c9ad9b306d;p=mmh diff --git a/Makefile.am b/Makefile.am index 56178f9..3f1650d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -33,16 +33,32 @@ auxexecdir = @libdir@ ## ## nmh _does_ have a test suite! ## -testdir = $(srcdir)/test -## It might be nice to configure testinstall and testbuild -## directories, but for now they're hard-coded here and in the test -## scripts. -## And it would be easier to clean up if tests were launched from a -## tmp directory, and/or each test cleaned up after itself on -## successful completion. -MOSTLYCLEANFILES = test/testinstall/*.actual* test/testinstall/*.expected* \ - test/testinstall/*.replgroupcomps test/testinstall/*.draft \ - test/testinstall/,*.draft* \* +TESTS_ENVIRONMENT = MH_OBJ_DIR=@abs_builddir@ \ + MH_TEST_DIR=@abs_builddir@/test/testdir \ + auxexecdir=$(auxexecdir) bindir=$(bindir) \ + mandir=$(mandir) sysconfdir=$(sysconfdir) +## +## Important note: the "cleanup" test should always be last +## +TESTS = test/bad-input/test-header test/comp/test-comp-format \ + test/folder/test-create \ + test/folder/test-total test/format/test-localmbox \ + test/format/test-myname test/format/test-myhost \ + test/format/test-mymbox \ + test/inc/test-deb359167 test/inc/test-eom-align \ + test/manpages/test-manpages test/mhbuild/test-forw \ + test/mhpath/test-mhpath \ + test/mhshow/test-cte-binary test/mhshow/test-qp \ + test/mhshow/test-subpart test/new/test-basic \ + test/pick/test-pick test/pick/test-stderr \ + test/repl/test-if-str test/scan/test-scan \ + test/sequences/test-flist test/sequences/test-mark \ + test/whatnow/test-attach-detach test/whatnow/test-cd \ + test/whatnow/test-ls \ + test/cleanup ## The "cleanup" test should always be last. + +check_SCRIPTS = test/common.sh +check_PROGRAMS = test/getfullname ## ## Stuff that should be cleaned via "make clean" @@ -51,7 +67,7 @@ CLEANFILES = config/version.c sbr/sigmsg.h etc/mts.conf etc/sendfiles \ etc/mhn.defaults man/man.sed $(man_MANS) clean-local: @rm -rf RPM a.out.DSYM uip/a.out.DSYM - @$(testdir)/teardown-test + @rm -rf test/testdir ## ## Stuff that should be cleaned via "make maintainer-clean" @@ -130,6 +146,9 @@ dist_sysconf_DATA = etc/MailAliases etc/components etc/digestcomps \ ## sysconf_DATA = etc/mhn.defaults etc/mts.conf +## +## Documentation that gets installed in docdir +## dist_doc_DATA = COPYRIGHT VERSION docs/COMPLETION-BASH docs/COMPLETION-TCSH \ docs/COMPLETION-ZSH docs/DIFFERENCES docs/FAQ \ docs/MAIL.FILTERING docs/MAILING-LISTS docs/README-ATTACHMENTS \ @@ -139,7 +158,6 @@ dist_doc_DATA = COPYRIGHT VERSION docs/COMPLETION-BASH docs/COMPLETION-TCSH \ ## ## Our man pages ## - man_MANS = man/ali.1 man/anno.1 man/ap.8 man/burst.1 man/comp.1 \ man/conflict.8 man/dist.1 man/dp.8 man/flist.1 man/flists.1 \ man/fmtdump.8 man/fnext.1 man/folder.1 man/folders.1 \ @@ -160,7 +178,6 @@ man_MANS = man/ali.1 man/anno.1 man/ap.8 man/burst.1 man/comp.1 \ ## Files we need to include in the distribution which aren't found by ## Automake using the automatic rules ## - EXTRA_DIST = config/version.sh sbr/sigmsg.awk etc/mts.conf.in etc/sendfiles.in \ etc/mhn.defaults.sh $(MHNSEARCHPROG) nmh.spec DATE \ docs/ChangeLog_MH-3_to_MH-6.6 \ @@ -180,7 +197,9 @@ EXTRA_DIST = config/version.sh sbr/sigmsg.awk etc/mts.conf.in etc/sendfiles.in \ man/rcvpack.man man/rcvstore.man man/rcvtty.man man/refile.man \ man/repl.man man/rmf.man man/rmm.man man/scan.man man/send.man \ man/sendfiles.man man/show.man man/slocal.man man/sortm.man \ - man/unseen.man man/whatnow.man man/whom.man + man/unseen.man man/whatnow.man man/whom.man test/README $(TESTS) \ + test/inc/deb359167.mbox test/inc/fromline.txt \ + test/inc/msgheader.txt test/inc/filler.txt test/inc/md5sums ## ## These are all of the definitions for each of the programs listed above. @@ -196,6 +215,7 @@ uip_burst_SOURCES = uip/burst.c uip_comp_SOURCES = uip/comp.c uip/whatnowproc.c uip/whatnowsbr.c uip/sendsbr.c \ uip/annosbr.c uip/distsbr.c +uip_comp_LDADD = $(LDADD) $(ICONVLIB) uip_dist_SOURCES = uip/dist.c uip/whatnowproc.c uip/whatnowsbr.c uip/sendsbr.c \ uip/annosbr.c uip/distsbr.c @@ -205,7 +225,7 @@ uip_flist_SOURCES = uip/flist.c uip_folder_SOURCES = uip/folder.c uip_forw_SOURCES = uip/forw.c uip/whatnowproc.c uip/whatnowsbr.c uip/sendsbr.c \ - uip/annosbr.c uip/distsbr.c + uip/annosbr.c uip/distsbr.c uip/forwsbr.c uip_forw_LDADD = $(LDADD) $(ICONVLIB) uip_inc_SOURCES = uip/inc.c uip/scansbr.c uip/dropsbr.c uip/termsbr.c \ @@ -331,6 +351,9 @@ uip_spost_SOURCES = uip/spost.c uip/aliasbr.c uip_viamail_SOURCES = uip/viamail.c uip/mhmisc.c uip/mhoutsbr.c uip/sendsbr.c \ uip/annosbr.c uip/distsbr.c +test_getfullname_SOURCES = test/getfullname.c +test_getfullname_LDADD = + ## ## Our rebuild rules for files that aren't built via the normal mechanisms ## @@ -438,8 +461,8 @@ sbr_libmh_a_CPPFLAGS = -I./sbr -DNMHETCDIR='"$(sysconfdir)"' \ -DMAILSPOOL='"$(mailspool)"' \ -DSENDMAILPATH='"$(sendmailpath)"' -DNMHBINDIR='"$(bindir)"' \ -DNMHLIBDIR='"$(libdir)"' \ - -DDEFAULT_EDITOR='"$(default_editor)"' \ - -DDEFAULT_PAGER='"$(default_pager)"' + -DDEFAULT_EDITOR='"$(editorpath)"' \ + -DDEFAULT_PAGER='"$(pagerpath)"' sbr_libdtimep_a_SOURCES = sbr/dtimep.l sbr_libdtimep_a_CFLAGS = $(sbr_libmh_a_CPPFLAGS) $(DISABLE_UNUSED_MACROS_WARNING) @@ -450,7 +473,6 @@ mts_libmts_a_SOURCES = mts/smtp/hosts.c mts/smtp/smtp.c ## Our rules for generating man pages (both the rule for man.sed and ## the implicit rules for man page generation). ## - manext1 = 1 manext5 = 5 manext8 = 8 @@ -458,46 +480,41 @@ manext8 = 8 $(man_MANS): man/man.sed man/man.sed: Makefile - echo 's,%nmhwarning%,THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.,g' > $@ - echo 's,%nmhversion%,nmh-$(VERSION),g' >> $@ - echo 's,%nmhdate%,$(DATE),g' >> $@ - echo 's,%bindir%,$(bindir),g' >> $@ - echo 's,%etcdir%,$(sysconfdir),g' >> $@ - echo 's,%libdir%,$(libdir),g' >> $@ - echo 's,%mandir%,$(mandir),g' >> $@ - echo 's,%mailspool%,$(mailspool),g' >> $@ - echo 's,%sendmailpath%,$(sendmailpath),g' >> $@ - echo 's,%default_editor%,$(default_editor),g' >> $@ - echo 's,%default_pager%,$(default_pager),g' >> $@ - echo 's,%manext1%,$(manext1),g' >> $@ - echo 's,%manext5%,$(manext5),g' >> $@ - echo 's,%manext8%,$(manext8),g' >> $@ - echo '/%components%/r $(top_srcdir)/etc/components' >> $@ - echo ' s,%components%,,g' >> $@ - echo '/%distcomps%/r $(top_srcdir)/etc/distcomps' >> $@ - echo ' s,%distcomps%,,g' >> $@ - echo '/%forwcomps%/r $(top_srcdir)/etc/forwcomps' >> $@ - echo ' s,%forwcomps%,,g' >> $@ - echo '/%mhl_forward%/r $(top_srcdir)/etc/mhl.forward' >> $@ - echo ' s,%mhl_forward%,,g' >> $@ - echo '/%mhl_format%/r $(top_srcdir)/etc/mhl.format' >> $@ - echo ' s,%mhl_format%,,g' >> $@ - echo '/%mhl_reply%/r $(top_srcdir)/etc/mhl.reply' >> $@ - echo ' s,%mhl_reply%,,g' >> $@ + @echo 's,%nmhwarning%,THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.,g' > $@ + @echo 's,%nmhversion%,nmh-$(VERSION),g' >> $@ + @echo 's,%nmhdate%,$(DATE),g' >> $@ + @echo 's,%bindir%,$(bindir),g' >> $@ + @echo 's,%etcdir%,$(sysconfdir),g' >> $@ + @echo 's,%libdir%,$(libdir),g' >> $@ + @echo 's,%mandir%,$(mandir),g' >> $@ + @echo 's,%mailspool%,$(mailspool),g' >> $@ + @echo 's,%sendmailpath%,$(sendmailpath),g' >> $@ + @echo 's,%default_editor%,$(editorpath),g' >> $@ + @echo 's,%default_pager%,$(pagerpath),g' >> $@ + @echo 's,%manext1%,$(manext1),g' >> $@ + @echo 's,%manext5%,$(manext5),g' >> $@ + @echo 's,%manext8%,$(manext8),g' >> $@ + @echo '/%components%/r $(top_srcdir)/etc/components' >> $@ + @echo ' s,%components%,,g' >> $@ + @echo '/%distcomps%/r $(top_srcdir)/etc/distcomps' >> $@ + @echo ' s,%distcomps%,,g' >> $@ + @echo '/%forwcomps%/r $(top_srcdir)/etc/forwcomps' >> $@ + @echo ' s,%forwcomps%,,g' >> $@ + @echo '/%mhl_forward%/r $(top_srcdir)/etc/mhl.forward' >> $@ + @echo ' s,%mhl_forward%,,g' >> $@ + @echo '/%mhl_format%/r $(top_srcdir)/etc/mhl.format' >> $@ + @echo ' s,%mhl_format%,,g' >> $@ + @echo '/%mhl_reply%/r $(top_srcdir)/etc/mhl.reply' >> $@ + @echo ' s,%mhl_reply%,,g' >> $@ .man.$(manext1): - $(SED) -f man/man.sed $< > $@ + @$(SED) -f man/man.sed $< > $@ .man.$(manext5): - $(SED) -f man/man.sed $< > $@ + @$(SED) -f man/man.sed $< > $@ .man.$(manext8): - $(SED) -f man/man.sed $< > $@ - -test: all - @test -d $(testdir)/testinstall || $(testdir)/setup-test - @$(testdir)/runalltests -.PHONY: test + @$(SED) -f man/man.sed $< > $@ ## Don't include commit hashes in ChangeLog. ChangeLog: @@ -511,7 +528,6 @@ ChangeLog: ## ## Our RPM build target ## - rpm: dist @test -d $(rpmdir)/SOURCES || $(MKDIR_P) $(rpmdir)/SOURCES @test -d $(rpmdir)/SPECS || $(MKDIR_P) $(rpmdir)/SPECS @@ -520,21 +536,43 @@ rpm: dist @cp -p nmh.spec $(rpmdir)/SPECS @rpmbuild --define '_topdir $(rpmdir)' \ --define '_tmppath %{_topdir}/TMP' \ + --define "_sysconfdir $(DESTDIR)$(sysconfdir)" \ -ba $(rpmdir)/SPECS/nmh.spec .PHONY: rpm ## ## A target to build information needed by cscope ## - cscope: echo "-I $(srcdir)/h -I $(srcdir)/sbr -I $(srcdir)/uip -I $(srcdir)/mts/smtp" > cscope.files find $(srcdir) \( -name \*.c -o -name \*.l \) -print | grep -v dtimep.c >> cscope.files +.PHONY: cscope + ## -## Rules to upload the distribution to savannah +## Use GNU gcov to find the coverage of the test suite. +## gcov and gcov-clean are not integrated into the other automake +## targets because gcov will be used so infrequently, if at all. ## +gcov: + @echo rebuilding with AM_CLFAGS=--coverage . . . + @(make clean && make AM_CFLAGS=--coverage) > /dev/null && make check + @for i in `find . -name '*.gcda'`; do \ + gcov -o `echo $$i | $(SED) 's%\\(.*\\)/%\\1 %'`; \ + done + @for i in `find . -name '*.gcno'`; do \ + if ! test -f `echo $$i | sed 's%\.gcno%.gcda%'`; then \ + echo untested: $$i; \ + fi; \ + done +gcov-clean: + @find . -name '*.gcno' -o -name '*.gcda' -o -name '*.gcov' | xargs rm +.PHONY: gcov gcov-clean + +## +## Rules to upload the distribution to savannah +## upload: dist @if test -z "$(SAVANNAH_USERNAME)"; then \ echo "You need to set SAVANNAH_USERNAME to the your username on savannah.gnu.org." ;\