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.)
.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 ==========
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"
# 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)
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
-
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:
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
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:
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
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 ==========
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
-
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
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
-
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)
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
-