X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=Makefile.am;h=41dee6c2dd22a50735696633c4815302ace93845;hb=00949f4fa56dc4e1a7d4ea1972d7492d80880b2c;hp=a3097e027905ecfc9fe0723d6ded149f6cd1a4bd;hpb=07e7ce5969d56152bb7ea9d31ebe0695d6535377;p=mmh diff --git a/Makefile.am b/Makefile.am index a3097e0..41dee6c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,7 +14,7 @@ ACLOCAL_AMFLAGS = -I m4 ## LDADD is included in the program-specific LDADD since we want to add ## to this list of libraries, not replace it. ## -LDADD = sbr/libmh.a +LDADD = sbr/libmh.a sbr/libdtimep.a ## ## These are used to create the default mhn.defaults config file @@ -31,10 +31,42 @@ MHNSEARCHPROG = $(srcdir)/etc/mhn.find.sh 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* \* + +## ## Stuff that should be cleaned via "make clean" ## 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 + +## +## Stuff that should be cleaned via "make maintainer-clean" +## +MAINTAINERCLEANFILES = cscope.files cscope.out + +## +## And our own superclean, to get everything left by maintainer-clean. +## +SUPERCLEANFILES = ChangeLog Makefile.in aclocal.m4 compile config.guess \ + config.h.in config.h.in~ config.sub configure depcomp \ + install-sh missing ylwrap nmh-*.tar.gz +superclean: maintainer-clean + @rm -f $(SUPERCLEANFILES) +.PHONY: superclean ## ## Files that need to be built before everything else @@ -64,10 +96,10 @@ auxexec_PROGRAMS = uip/ap uip/conflict uip/dp uip/fmtdump uip/mhl uip/post \ uip/spost uip/viamail uip/mhtest ## -## Internal libraries that we don't create as part of the build process +## Internal libraries that we create as part of the build process ## but do not install ## -noinst_LIBRARIES = sbr/libmh.a mts/libmts.a +noinst_LIBRARIES = sbr/libmh.a sbr/libdtimep.a mts/libmts.a ## ## These are all of our header files. Right now we don't install any of @@ -156,11 +188,6 @@ EXTRA_DIST = config/version.sh sbr/sigmsg.awk etc/mts.conf.in etc/sendfiles.in \ ## overrides that are used to select different library options from the ## default. ## -## Note that a few programs link in extra files (specifically, popsbr.c) -## if POP3 support is compiled in. An Automake conditional is used for -## this purpose. -## - uip_ali_SOURCES = uip/ali.c uip/aliasbr.c uip_anno_SOURCES = uip/anno.c uip/annosbr.c @@ -181,10 +208,8 @@ uip_forw_SOURCES = uip/forw.c uip/whatnowproc.c uip/whatnowsbr.c uip/sendsbr.c \ uip/annosbr.c uip/distsbr.c uip_forw_LDADD = $(LDADD) $(ICONVLIB) -uip_inc_SOURCES = uip/inc.c uip/scansbr.c uip/dropsbr.c uip/termsbr.c -if POP_SUPPORT -uip_inc_SOURCES += uip/popsbr.c -endif +uip_inc_SOURCES = uip/inc.c uip/scansbr.c uip/dropsbr.c uip/termsbr.c \ + uip/popsbr.c uip_inc_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) $(SASLLIB) uip_install_mh_SOURCES = uip/install-mh.c @@ -222,10 +247,7 @@ uip_mhstore_SOURCES = uip/mhstore.c uip/mhparse.c uip/mhcachesbr.c \ uip/mhmisc.c uip/mhfree.c uip/termsbr.c uip/md5.c uip_mhstore_LDADD = $(LDADD) $(TERMLIB) -uip_msgchk_SOURCES = uip/msgchk.c -if POP_SUPPORT -uip_msgchk_SOURCES += uip/popsbr.c -endif +uip_msgchk_SOURCES = uip/msgchk.c uip/popsbr.c uip_msgchk_LDADD = $(LDADD) $(SASLLIB) uip_msh_SOURCES = uip/msh.c uip/mshcmds.c uip/vmhsbr.c uip/picksbr.c \ @@ -315,7 +337,7 @@ uip_viamail_SOURCES = uip/viamail.c uip/mhmisc.c uip/mhoutsbr.c uip/sendsbr.c \ config/version.c: Makefile sh $(srcdir)/config/version.sh $(VERSION) > $@ -sbr/sigmsg.h: Makefile $(srcdir)/sbr/sigmsg.awk $(SIGNAL_H) +sbr/sigmsg.h: $(srcdir)/sbr/sigmsg.awk $(SIGNAL_H) $(AWK) -f $(srcdir)/sbr/sigmsg.awk $(SIGNAL_H) > $@ etc/mts.conf: $(srcdir)/etc/mts.conf.in Makefile @@ -340,35 +362,40 @@ etc/sendfiles: $(srcdir)/etc/sendfiles.in Makefile ## between different programs. ## install-exec-hook: - rm -f $(DESTDIR)/$(bindir)/flists$(EXEEXT) - rm -f $(DESTDIR)/$(bindir)/folders$(EXEEXT) - rm -f $(DESTDIR)/$(bindir)/fnext$(EXEEXT) - rm -f $(DESTDIR)/$(bindir)/fprev$(EXEEXT) - rm -f $(DESTDIR)/$(bindir)/unseen$(EXEEXT) - rm -f $(DESTDIR)/$(bindir)/prev$(EXEEXT) - rm -f $(DESTDIR)/$(bindir)/next$(EXEEXT) - ln $(DESTDIR)/$(bindir)/flist$(EXEEXT) $(DESTDIR)/$(bindir)/flists$(EXEEXT) - ln $(DESTDIR)/$(bindir)/folder$(EXEEXT) $(DESTDIR)/$(bindir)/folders$(EXEEXT) - ln $(DESTDIR)/$(bindir)/new$(EXEEXT) $(DESTDIR)/$(bindir)/fnext$(EXEEXT) - ln $(DESTDIR)/$(bindir)/new$(EXEEXT) $(DESTDIR)/$(bindir)/fprev$(EXEEXT) - ln $(DESTDIR)/$(bindir)/new$(EXEEXT) $(DESTDIR)/$(bindir)/unseen$(EXEEXT) - ln $(DESTDIR)/$(bindir)/show$(EXEEXT) $(DESTDIR)/$(bindir)/prev$(EXEEXT) - ln $(DESTDIR)/$(bindir)/show$(EXEEXT) $(DESTDIR)/$(bindir)/next$(EXEEXT) + rm -f $(DESTDIR)$(bindir)/flists$(EXEEXT) + rm -f $(DESTDIR)$(bindir)/folders$(EXEEXT) + rm -f $(DESTDIR)$(bindir)/fnext$(EXEEXT) + rm -f $(DESTDIR)$(bindir)/fprev$(EXEEXT) + rm -f $(DESTDIR)$(bindir)/unseen$(EXEEXT) + rm -f $(DESTDIR)$(bindir)/prev$(EXEEXT) + rm -f $(DESTDIR)$(bindir)/next$(EXEEXT) + ln $(DESTDIR)$(bindir)/flist$(EXEEXT) $(DESTDIR)$(bindir)/flists$(EXEEXT) + ln $(DESTDIR)$(bindir)/folder$(EXEEXT) $(DESTDIR)$(bindir)/folders$(EXEEXT) + ln $(DESTDIR)$(bindir)/new$(EXEEXT) $(DESTDIR)$(bindir)/fnext$(EXEEXT) + ln $(DESTDIR)$(bindir)/new$(EXEEXT) $(DESTDIR)$(bindir)/fprev$(EXEEXT) + ln $(DESTDIR)$(bindir)/new$(EXEEXT) $(DESTDIR)$(bindir)/unseen$(EXEEXT) + ln $(DESTDIR)$(bindir)/show$(EXEEXT) $(DESTDIR)$(bindir)/prev$(EXEEXT) + ln $(DESTDIR)$(bindir)/show$(EXEEXT) $(DESTDIR)$(bindir)/next$(EXEEXT) + if test x$(SETGID_MAIL) != x; then \ + chgrp $(MAIL_SPOOL_GRP) $(DESTDIR)$(bindir)/inc$(EXEEXT); \ + chmod 2755 $(DESTDIR)$(bindir)/inc$(EXEEXT); \ + fi install-data-hook: - ln $(DESTDIR)/$(man5dir)/mh-profile.5 $(DESTDIR)/$(man5dir)/mh_profile.5 + rm -f $(DESTDIR)$(man5dir)/mh_profile.5 + ln $(DESTDIR)$(man5dir)/mh-profile.5 $(DESTDIR)$(man5dir)/mh_profile.5 ## ## Make sure we remove those links at uninstall time ## uninstall-hook: - rm -f $(DESTDIR)/$(bindir)/flists$(EXEEXT) - rm -f $(DESTDIR)/$(bindir)/folders$(EXEEXT) - rm -f $(DESTDIR)/$(bindir)/fnext$(EXEEXT) - rm -f $(DESTDIR)/$(bindir)/fprev$(EXEEXT) - rm -f $(DESTDIR)/$(bindir)/unseen$(EXEEXT) - rm -f $(DESTDIR)/$(bindir)/prev$(EXEEXT) - rm -f $(DESTDIR)/$(bindir)/next$(EXEEXT) - rm -f $(DESTDIR)/$(man5dir)/mh_profile.5 + rm -f $(DESTDIR)$(bindir)/flists$(EXEEXT) + rm -f $(DESTDIR)$(bindir)/folders$(EXEEXT) + rm -f $(DESTDIR)$(bindir)/fnext$(EXEEXT) + rm -f $(DESTDIR)$(bindir)/fprev$(EXEEXT) + rm -f $(DESTDIR)$(bindir)/unseen$(EXEEXT) + rm -f $(DESTDIR)$(bindir)/prev$(EXEEXT) + rm -f $(DESTDIR)$(bindir)/next$(EXEEXT) + rm -f $(DESTDIR)$(man5dir)/mh_profile.5 ## ## Our rules to build our internal libraries (libmh.a, libmts.a) @@ -380,7 +407,7 @@ sbr_libmh_a_SOURCES = sbr/addrsbr.c sbr/ambigsw.c sbr/atooi.c sbr/brkstring.c \ sbr/context_replace.c sbr/context_save.c \ sbr/copy.c sbr/copyip.c sbr/cpydata.c \ sbr/cpydgst.c sbr/crawl_folders.c sbr/discard.c \ - sbr/done.c sbr/dtime.c sbr/dtimep.l \ + sbr/done.c sbr/dtime.c \ sbr/error.c sbr/ext_hook.c sbr/fdcompare.c \ sbr/folder_addmsg.c sbr/folder_delmsgs.c \ sbr/folder_free.c sbr/folder_pack.c \ @@ -414,6 +441,9 @@ sbr_libmh_a_CPPFLAGS = -I./sbr -DNMHETCDIR='"$(sysconfdir)"' \ -DDEFAULT_EDITOR='"$(default_editor)"' \ -DDEFAULT_PAGER='"$(default_pager)"' +sbr_libdtimep_a_SOURCES = sbr/dtimep.l +sbr_libdtimep_a_CFLAGS = $(sbr_libmh_a_CPPFLAGS) $(DISABLE_UNUSED_MACROS_WARNING) + mts_libmts_a_SOURCES = mts/smtp/hosts.c mts/smtp/smtp.c ## @@ -442,11 +472,6 @@ man/man.sed: Makefile echo 's,%manext1%,$(manext1),g' >> $@ echo 's,%manext5%,$(manext5),g' >> $@ echo 's,%manext8%,$(manext8),g' >> $@ -if POP_SUPPORT - echo '/^%nmhbeginpop%/d;/^%nmhendpop%/d' >> $@ -else - echo '/^%nmhbeginpop%/,/^%nmhendpop%/d' >> $@ -endif echo '/%components%/r $(top_srcdir)/etc/components' >> $@ echo ' s,%components%,,g' >> $@ echo '/%distcomps%/r $(top_srcdir)/etc/distcomps' >> $@ @@ -469,11 +494,24 @@ endif .man.$(manext8): $(SED) -f man/man.sed $< > $@ +test: all + @$(testdir)/runalltests +.PHONY: test + +## Don't include commit hashes in ChangeLog. +ChangeLog: + @[ -d .git ] && git --no-pager log --abbrev-commit | \ + egrep -v '^commit [0-9a-f]+$$' > $@ || true +## Make ChangeLog phony so it will always get regenerated. But don't +## fail if we don't have a git repository in order to allow +## regeneration of distribution archive or RPM. +.PHONY: ChangeLog + ## ## Our RPM build target ## -rpm: $(DIST_ARCHIVES) +rpm: dist @test -d $(rpmdir)/SOURCES || $(MKDIR_P) $(rpmdir)/SOURCES @test -d $(rpmdir)/SPECS || $(MKDIR_P) $(rpmdir)/SPECS @mv -f $(DIST_ARCHIVES) $(rpmdir)/SOURCES @@ -482,3 +520,36 @@ rpm: $(DIST_ARCHIVES) @rpmbuild --define '_topdir $(rpmdir)' \ --define '_tmppath %{_topdir}/TMP' \ -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 + +## +## 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." ;\ + echo "You can set it either in your environment or on the make command line."; \ + false; \ + fi + @echo "Did you run 'make distcheck' already?" + @if test -z "$(SKIP_GPG_SIG)"; then \ + echo "Creating GPG signature (set SKIP_GPG_SIG to bypass this step)"; \ + gpg --output $(DIST_ARCHIVES).sig --detatch-sig $(DIST_ARCHIVES); \ + fi + @echo "Setting permissions for savannah.gnu.org" + chmod 664 $(DIST_ARCHIVES) + if test -f $(DIST_ARCHIVES).sig; then \ + chmod 664 $(DIST_ARCHIVES).sig; \ + fi + @echo "Uploading to savannah" + scp -p $(DIST_ARCHIVES)* $(SAVANNAH_USERNAME)@savannah.gnu.org:/releases/nmh +.PHONY: upload