.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 ChangeLog
+# ... minus (git stuff):
+DISTEXCLUDE = .git .gitignore
-# subdirectories in distribution
-SUBDIRS = h config sbr uip etc man docs
+# Subdirectories with own Makefiles
+SUBDIRS = h config sbr uip etc man
# ========== DEPENDENCIES FOR BUILDING AND INSTALLING ==========
clean-local: mostlyclean-local
distclean-local: clean-local
- rm -f Makefile config.h config.status config.log config.cache stamp-h distname
+ rm -f Makefile config.h config.status config.log config.cache stamp-h distname ChangeLog
realclean-local: distclean-local
config.status: configure VERSION
./config.status --recheck
-configure: configure.ac aclocal.m4
+configure: configure.ac
cd $(srcdir) && autoconf
config.h: stamp-h
./config.status config.h stamp
config.h.in: stamp-h.in
-stamp-h.in: configure.ac acconfig.h aclocal.m4
+stamp-h.in: configure.ac
cd $(srcdir) && autoheader
date > $@
# name of new mmh distribution tar file
tarfile = mmh-$(VERSION).tar.gz
-# ftp directory location
-ftpdir = /ftp/mmh
-
# file containing name of new mmh distribution
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
+
+ChangeLog:
+ @git whatchanged --format=fuller > $@
+
# 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); \
+ @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"
-
-# release a new mmh distribution into ftp directory
-mmhrelease: $(tarfile)
- rm -f $(ftpdir)/$(tarfile)
- rm -f $(ftpdir)/mmh.tar.gz
- mv $(tarfile) $(ftpdir)/$(tarfile)
- cd $(ftpdir) && ln -s $(tarfile) mmh.tar.gz
- cd $(ftpdir) && md5sum *.gz > MD5SUM
-