From: markus schnalke Date: Wed, 28 Oct 2015 22:19:14 +0000 (+0100) Subject: Build the release tarball from git, not manually X-Git-Tag: mmh-0.2~12 X-Git-Url: http://git.marmaro.de/?p=mmh;a=commitdiff_plain;h=d5d94ce76327869346e2b02b7b02a3620ddd38eb Build the release tarball from git, not manually Previously the Makefiles contained lists of files to distribute. They built the release tarball manually. It's much easier to just use git, which knows which files are the relevant files, because it's the ones that are under version control. We just need to add some additional, pre-generated files for convenience, so that the user does not need to have auto* and lex installed. The release tarball is now fully assembled in the top-level Makefile. (The only tricky part is sbr/dtimep.c, because that needs to be generated in the subdirectory.) --- diff --git a/Makefile.in b/Makefile.in index 83af4c2..21ffdb2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -63,16 +63,13 @@ INSTALL_DATA = @INSTALL_DATA@ .SUFFIXES: -# all files in this directory included in the distribution -DIST = COPYRIGHT DATE INSTALL README VERSION \ - autogen.sh install-sh Makefile.in aclocal.m4 \ - acconfig.h config.h.in configure.ac configure stamp-h.in \ - config.sub config.guess +# distribute all files that are under version control ... +# ... plus (for convenience): +DISTINCLUDE = config.h.in configure stamp-h.in sbr/dtimep.c +# ... minus (git stuff): +DISTEXCLUDE = .git .gitignore -# these directories included in the distribution -DISTDIRS = docs test - -# subdirectories in distribution +# Subdirectories with own Makefiles SUBDIRS = h config sbr uip etc man # ========== DEPENDENCIES FOR BUILDING AND INSTALLING ========== @@ -163,27 +160,25 @@ tarfile = mmh-$(VERSION).tar.gz distname: @echo mmh-$(VERSION) > distname +# pre-generate this file so users don't need lex(1) +sbr/dtimep.c: + @cd $(srcdir)/sbr && $(MAKE) dtimep.c + # build mmh distribution distdir = `cat distname` -mmhdist: $(DIST) distname +mmhdist: $(DISTINCLUDE) distname @echo "Begin building mmh-$(VERSION) distribution" - rm -rf $(distdir) - mkdir $(distdir) + @rm -rf $(distdir) + @echo "Copying files to distribution directory" + @git clone $(srcdir) $(distdir) @chmod 755 $(distdir) - @echo "Copying distribution files in main directory" - @for file in $(DIST); do \ - cp -p $(srcdir)/$$file $(distdir); \ - done - @echo "Copying distribution dirs in main directory" - @for dir in $(DISTDIRS); do \ - cp -rp $(srcdir)/$$dir $(distdir); \ + @for file in $(DISTINCLUDE); do \ + cp -p $(srcdir)/$$file $(distdir)/$$file; \ done - @for subdir in $(SUBDIRS); do \ - mkdir $(distdir)/$$subdir; \ - chmod 755 $(distdir)/$$subdir; \ - (cd $$subdir && $(MAKE) $@) || exit 1; \ + @for file in $(DISTEXCLUDE); do \ + rm -rf $(distdir)/$$file; \ done - chmod -R a+r $(distdir) + @chmod -R a+r $(distdir) tar chf - $(distdir) | gzip -c > $(tarfile) - rm -rf $(distdir) distname + @rm -rf $(distdir) distname @echo "Done building mmh-$(VERSION) distribution" diff --git a/config/Makefile.in b/config/Makefile.in index 4bdad8e..47f9125 100644 --- a/config/Makefile.in +++ b/config/Makefile.in @@ -44,12 +44,6 @@ SRCS = config.c # object files OBJS = config.o version.o -# auxiliary files -AUX = Makefile.in version.sh - -# all files in this directory included in the distribution -DIST = $(SRCS) $(AUX) - # ========= DEPENDENCIES FOR BUILDING ========== all: $(OBJS) @@ -88,10 +82,3 @@ subdir = config Makefile: Makefile.in ../config.status cd .. && ./config.status $(subdir)/$@ -distdir = ../`cat ../distname`/$(subdir) -mmhdist: $(DIST) - @echo "Copying distribution files in $(subdir)" - @for file in $(DIST); do \ - cp -p $(srcdir)/$$file $(distdir); \ - done - diff --git a/etc/Makefile.in b/etc/Makefile.in index 8b8a1c3..da3bb51 100644 --- a/etc/Makefile.in +++ b/etc/Makefile.in @@ -33,12 +33,6 @@ STATIC_FILES = components digestcomps distcomps forwcomps \ scan.nmh scan.mailx scan.nomime scan.size scan.time \ scan.timely scan.unseen scan.meillo mhn.defaults -# auxiliary files (included in distribution but not installed) -AUX = Makefile.in - -# all non-generated files in this directory are included in the distribution -DIST = $(STATIC_FILES) $(AUX) - # ========= DEPENDENCIES FOR BUILDING ========== all: @@ -88,9 +82,3 @@ subdir = etc Makefile: Makefile.in ../config.status cd .. && ./config.status $(subdir)/$@ -distdir = ../`cat ../distname`/$(subdir) -mmhdist: $(DIST) - @echo "Copying distribution files in $(subdir)" - @for file in $(DIST); do \ - cp -p $(srcdir)/$$file $(distdir); \ - done diff --git a/h/Makefile.in b/h/Makefile.in index 31237d0..baef0e0 100644 --- a/h/Makefile.in +++ b/h/Makefile.in @@ -12,12 +12,6 @@ HDRS = addrsbr.h aliasbr.h crawl_folders.h dropsbr.h fmt_compile.h \ fmt_scan.h mf.h mh.h mhparse.h mime.h \ prototypes.h rcvmail.h scansbr.h signals.h tws.h utils.h -# auxiliary files -AUX = Makefile.in - -# all files in this directory included in the distribution -DIST = $(HDRS) $(AUX) - # ========== DEPENDENCIES FOR BUILDING AND INSTALLING ========== all: @@ -49,9 +43,3 @@ subdir = h Makefile: Makefile.in ../config.status cd .. && ./config.status $(subdir)/$@ -distdir = ../`cat ../distname`/$(subdir) -mmhdist: $(DIST) - @echo "Copying distribution files in $(subdir)" - @for file in $(DIST); do \ - cp -p $(srcdir)/$$file $(distdir); \ - done diff --git a/man/Makefile.in b/man/Makefile.in index 44d0b75..ffa1203 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -67,17 +67,6 @@ MAN5 = $(MAN5SRC:.=.$(manext5)) MAN7 = $(MAN7SRC:.=.$(manext7)) MAN8 = $(MAN8SRC:.=.$(manext8)) -# source for man pages -DIST_MAN1 = $(MAN1SRC:.=.man1) -DIST_MAN5 = $(MAN5SRC:.=.man5) -DIST_MAN7 = $(MAN7SRC:.=.man7) -DIST_MAN8 = $(MAN8SRC:.=.man8) - -# auxiliary files -AUX = Makefile.in mh-chart-gen.sh - -# all files in this directory included in the distribution -DIST = $(DIST_MAN1) $(DIST_MAN5) $(DIST_MAN7) $(DIST_MAN8) $(AUX) ALLPROGS = $(MAN1) $(MAN8) # ========= DEFAULT TARGET ========== @@ -202,10 +191,3 @@ subdir = man Makefile: Makefile.in ../config.status cd .. && ./config.status $(subdir)/$@ -distdir = ../`cat ../distname`/$(subdir) -mmhdist: $(DIST) - @echo "Copying distribution files in $(subdir)" - @for file in $(DIST); do \ - cp -p $(srcdir)/$$file $(distdir); \ - done - diff --git a/sbr/Makefile.in b/sbr/Makefile.in index 6b4acf1..51049c7 100644 --- a/sbr/Makefile.in +++ b/sbr/Makefile.in @@ -74,12 +74,6 @@ SRCS = addrsbr.c ambigsw.c brkstring.c \ OBJS = $(SRCS:.c=.o) -# auxiliary files -AUX = Makefile.in sigmsg.awk dtimep.lex - -# all files in this directory included in the distribution -DIST = $(SRCS) $(AUX) - # ========= DEPENDENCIES FOR BUILDING ========== # default target @@ -135,10 +129,3 @@ subdir = sbr Makefile: Makefile.in ../config.status cd .. && ./config.status $(subdir)/$@ -distdir = ../`cat ../distname`/$(subdir) -mmhdist: $(DIST) - @echo "Copying distribution files in $(subdir)" - @for file in $(DIST); do \ - cp -p $(srcdir)/$$file $(distdir); \ - done - diff --git a/uip/Makefile.in b/uip/Makefile.in index 84f8535..be02b67 100644 --- a/uip/Makefile.in +++ b/uip/Makefile.in @@ -76,12 +76,6 @@ SRCS = ali.c aliasbr.c anno.c ap.c burst.c comp.c \ sendfiles.sh slocal.c sortm.c spost.c termsbr.c \ whatnow.c whatnowproc.c whom.c -# auxiliary files -AUX = Makefile.in - -# all files in this directory included in the distribution -DIST = $(SRCS) $(AUX) - # ========== DEFAULT TARGET ========== all: $(CMDS) $(MISC) $(SCMDS) @@ -317,10 +311,3 @@ subdir = uip Makefile: Makefile.in ../config.status cd .. && ./config.status $(subdir)/$@ -distdir = ../`cat ../distname`/$(subdir) -mmhdist: $(DIST) - @echo "Copying distribution files in $(subdir)" - @for file in $(DIST); do \ - cp -p $(srcdir)/$$file $(distdir); \ - done -