aboutsummaryrefslogtreecommitdiff
path: root/Makefile.devel
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.devel')
-rw-r--r--Makefile.devel532
1 files changed, 532 insertions, 0 deletions
diff --git a/Makefile.devel b/Makefile.devel
new file mode 100644
index 00000000..722585fa
--- /dev/null
+++ b/Makefile.devel
@@ -0,0 +1,532 @@
+##
+## Makefile for Proof General development.
+##
+## Author: David Aspinall <da@dcs.ed.ac.uk>
+##
+## Maintainer: Proof General maintainer <proofgen@dcs.ed.ac.uk>
+##
+## Developer use only, not part of distribution.
+##
+## make clean - remove intermediate files
+## make distclean - remove all generated files
+##
+## make ChangeLog - make ChangeLog from CVS sources
+## make tags - update TAGS file for Elisp sources
+## make autoloads - update autoloads
+##
+## make tag - tag the CVS sources with CVS_RELEASENAME
+## make untag - remove tag CVS_RELEASENAME from the sources
+## make dist - make a distribution from sources with above tag
+## make rpm - make RPM packages based on etc/ProofGeneral.spec
+##
+## make release - make tag, dist, and install it in RELEASEDIR.
+## make releaseall - make release, local installation and rpmrelease.
+##
+## make distinstall - install distribution build by 'make dist'
+## into DISTINSTALLDIR.
+##
+## make links - add some links which help testing web pages
+## from the html directory, and ensure that the
+##
+##
+## make releaseclean - clean up after 'make dist' 'make rpmrelease'.
+##
+##
+## Notes:
+## Use 'make untag' before re-trying if 'make releaseall' fails and files
+## are changed. This will make sure tags move to correct files
+## NB: this may create duplicate ChangeLog entries for current day,
+## watch out!
+## Use 'make releaseclean' if giving up, to remove temp dirs.
+##
+## No facility to edit html to make a full release in this makefile.
+## Too much effort for infrequenty used function.
+## Must edit download.html and doc.html by hand, then run
+##
+## make releaseall VERSION=2.0
+##
+## Or similar to make the required version.
+##
+## To customize the tags in case of a re-release with the same official
+## version:
+##
+## make releaseall VERSION=2.0 FULLVERSION=2.0.1
+##
+## NB: if this release is made from an old branch, beware that html
+## files (news!) etc, will all be downgraded. To fix, make a
+## development release immediately afterwards.
+##
+## $Id$
+##
+###########################################################################
+
+# Names and real mail addresses of developers
+# Arguments for rcs2log for ChangeLog target
+
+DEVELOPERS=\
+-u "da David Aspinall da@proofgeneral.org" \
+-u "markus Markus Wenzel wenzelm@informatik.tu-muenchen.de" \
+-u "pier Pierre Courtieu courtieu@lri.fr" \
+-u "crr Christophe Raffalli Christophe.Raffalli@univ-savoie.fr" \
+-u "pxc Paul Callaghan P.C.Callaghan@durham.ac.uk" \
+-u "patrl Patrick Loiseleur Patrick.Loiseleur@lri.fr" \
+-u "tms Thomas Kleymann tms@dcs.ed.ac.uk" \
+-u "djs Dilip Sequiera djs@dcs.ed.ac.uk" \
+-u "hhg Healfdene Goguen hhg@dcs.ed.ac.uk"
+
+
+
+# PRERELEASE_PREFIX is used to match PRERELEASE_TAG in sed
+# line in tag target below, which edits $(DOWNLOADHTML)
+PRERELEASE_PREFIX=3\.4pre
+PRERELEASE_TAG=3.4pre$(shell date "+%y%m%d")
+PREREL_TAG_FILE=prereltag.txt
+
+DOWNLOADHTML=develdownload.php
+DOWNLOADINFOHTML=devel.html
+
+# This is used for full releases to control the tag name
+# and distribution name. No editing of html is done
+# when PRERELEASE_TAG != VERSION
+VERSION=$(PRERELEASE_TAG)
+
+# Date stamp used in file if we're making a full release.
+DATEMSG=$(shell if [ $(PRERELEASE_TAG) = $(VERSION) ]; then echo; else date "+ on %a %e %b %Y"; fi)
+
+
+NAME = ProofGeneral
+LATESTNAME = $(NAME)-latest
+DEVELLATESTNAME = $(NAME)-devel-latest
+
+VERSIONVARIABLE=proof-general-version
+VERSIONFILE=proof-site.el
+
+# Full version number defaults to ordinary version number.
+FULLVERSION=$(VERSION)
+
+# NB: CVS tags can't have points in them.
+# Substitute points for hyphens.
+CVS_VERSION=$(shell echo $(FULLVERSION) | sed 's/\./-/g')
+
+# Name of tar file and RPM file.
+RELEASENAME = $(NAME)-$(VERSION)
+DEVELRELEASENAME = $(NAME)-$(VERSION)-devel
+CVS_RELEASENAME = Release-$(CVS_VERSION)
+
+# Where to release (i.e. copy) a new distribution to
+RELEASEDIR = /home/proofgen/www/
+
+# How to make the release "live". (Could be "true" to do nothing).
+# GOLIVE="scp -r $RELEASEDIR tweed:/home/proofgen/www"
+GOLIVE=true
+
+CVSNAME = ProofGeneral
+
+# Remote commands to use CVS in server mode and install files.
+# With these settings the build can be done remotely.
+# CVSROOT = :ext:$(USER)@$(MACHINE).dcs.ed.ac.uk:/home/proofgen/src
+# CVSROOT = /home/proofgen/src
+# CVS_RSH=ssh
+MACHINE=scar
+CVSROOT = :ext:da@$(MACHINE).dcs.ed.ac.uk:/home/proofgen/src
+
+# Emacs for batch compiling
+BATCHEMACS=xemacs -batch -q -no-site-file
+
+# GNU version of tar, please
+TAR=tar
+# zip utility
+ZIP=zip
+
+# For recursive make
+DEVELMAKE=make -f Makefile.devel
+
+# Files not to include the distribution area or tarball
+NONDISTFILES=.cvsignore */.cvsignore html Makefile.devel Makefile.xemacs doc/notes.txt doc/ProofGeneral.dvi doc/PG-adapting.dvi doc/ProofGeneralPortrait.eps* images/*.xcf images/notes.txt images/gimp images/Makefile etc/lego etc/coq etc/demoisa etc/isa etc/isar etc/lego etc/patches etc/pgkit etc/*.txt pgkit
+
+# Files not to include in the ordinary distribution tarball, but left
+# in the server's copy of the distribution.
+# NB: these are *patterns* to exclude rather than files!
+# I would rather have files themselves to exclude, but
+# seems to be no way.
+IGNOREDFILES=ProofGeneral*/Makefile.devel ProofGeneral*/todo ProofGeneral*/ChangeLog ProofGeneral*/doc/ProofGeneral.dvi ProofGeneral*/doc/ProofGeneral.ps.gz ProofGeneral*/doc/ProofGeneral.pdf ProofGeneral*/doc/PG-adapting.ps.gz ProofGeneral*/doc/PG-adapting.pdf ProofGeneral/*/todo
+
+# Temporary directory to to build a distribution in
+DISTBUILDIR = /tmp/ProofGeneralRelease
+
+# Temporary RPM topdir for building packages as non-root user.
+RPMTOPDIR=/tmp/$(NAME)-rpm
+# rpm 3.0 has changed rc file beyond recognition.
+# now wants a macro file included and stuck in ~/.rpmmacros.
+# Alternative is to use --define from command line.
+# RPMRC=$(RPMTOPDIR)/rpmrc
+# RPM=rpm --rcfile $(RPMRC)
+RPM=rpm --define '_topdir $(RPMTOPDIR)'
+
+RELEASENAMETAR = $(RELEASENAME).tar
+RELEASENAMETARGZ = $(RELEASENAMETAR).gz
+RELEASENAMEZIP = $(RELEASENAME).zip
+# What the RPM should be called.
+RELEASENAMERPM = $(RELEASENAME)-1.noarch.rpm
+
+DEVELRELEASENAMETAR = $(DEVELRELEASENAME).tar
+DEVELRELEASENAMETARGZ = $(DEVELRELEASENAMETAR).gz
+
+# Files not kept under cvs to clean away.
+FILES_NONCVS = TAGS
+
+# Where to install a distribution
+# DISTINSTALLDIR=/usr/local/share/elisp/proofgeneral
+# value for dcs.ed.ac.uk:
+DISTINSTALLDIR=/export/local/share/elisp
+
+# Copied from distributed Makefile
+ELISP_DIRS=generic lego coq isa isar plastic demoisa hol98 phox twelf acl2
+SUBDIRS=$(ELISP_DIRS) etc doc html images
+
+PWD=$(shell pwd)
+
+BYTECOMP = $(BATCHEMACS) -eval '(setq load-path (append (list "$(PWD)/generic" "$(PWD)/lego" "$(PWD)/coq" "$(PWD)/isa" "$(PWD)/isar") load-path))' -f batch-byte-compile
+
+EL=$(shell for f in $(ELISP_DIRS); do ls $$f/*.el; done)
+ELC=$(EL:.el=.elc)
+
+.SUFFIXES: .el .elc
+
+.el.elc:
+ $(BYTECOMP) $*.el
+
+%.gz: %
+ gzip -f $*
+
+FORCE:
+
+# Targets to pre-compile for distribution
+# Slightly dodgy to include elisp compile here, because
+# it can be incompatible across emacs versions.
+alldist: distdocs
+
+
+############################################################
+#
+# Make tags file
+#
+tags: $(EL)
+ etags $(EL) doc/ProofGeneral.texi > TAGS
+
+
+
+############################################################
+#
+# Add recent messages to ChangeLog. CVSROOT must be set correctly.
+#
+ChangeLog: FORCE
+ rcs2log -h "dcs.ed.ac.uk" $(DEVELOPERS) | sed 's|/home/proofgen/src/ProofGeneral/||g' > ChangeLog.prefix
+ mv ChangeLog ChangeLog.old
+ cat ChangeLog.prefix ChangeLog.old > ChangeLog
+ rm ChangeLog.prefix ChangeLog.old
+
+############################################################
+#
+# Clean up intermediate files
+#
+clean:
+ (cd doc; $(MAKE) clean)
+ (cd images; $(MAKE) clean)
+ rm -f doc/ProofGeneralPortrait.eps.gz
+ rm -f html/ProofGeneral
+
+
+
+############################################################
+#
+# Clean up intermediate files, all generated files
+# and Emacs backups, CVS temps
+#
+distclean: clean
+ find . \( -name '*~' -o -name '#*#' -o -name '\.\#*' \) -print | xargs rm -f
+ (cd doc; $(MAKE) distclean)
+ (cd images; $(MAKE) distclean)
+
+############################################################
+#
+# Clean up all non-cvs files.
+#
+cvsclean: clean
+ rm -rf $(FILES_NONCVS)
+ (cd doc; $(MAKE) distclean)
+ (cd images; $(MAKE) cvsclean)
+
+
+############################################################
+#
+# autoloads in generic/
+#
+autoloads: $(EL)
+ $(BATCHEMACS) -eval '(setq autoload-package-name "proof" generated-autoload-file "$(PWD)/generic/proof-autoloads.el")' -f batch-update-autoloads generic/
+
+
+
+############################################################
+#
+# Documentation
+#
+doc: FORCE
+ (cd doc; $(MAKE) doc)
+
+distdocs: FORCE
+ (cd doc; ln -s ../html/ProofGeneralPortrait.eps.gz .; $(MAKE) dist)
+
+############################################################
+#
+# Images
+#
+images: FORCE
+ (cd images; $(MAKE) images)
+
+
+
+
+############################################################
+##
+## tag: tag the CVS sources of working directory with CVS_RELEASENAME,
+## set version stamp in proof-site.el and ProofGeneral.spec
+## to VERSION, and edit $(DOWNLOADHTML) and $(DOWNLOADINFOHTML)
+## if VERSION matches PRERELEASE_TAG.
+##
+tag:
+ @echo "*************************************************"
+ @echo " Tagging sources... (rerun if CVS source dirty)"
+ @echo "*************************************************"
+# Update the sources, this is almost always what we want to do.
+ if [ -z "$(NOCVS)" ] && [ -n "`cvs -n -q update`" ]; then cvs update -d; exit 1; fi
+# Tag proof-site.el and ProofGeneral.spec
+ (cd generic; mv $(VERSIONFILE) $(VERSIONFILE).old; sed -e 's/defconst $(VERSIONVARIABLE) \".*\"/defconst $(VERSIONVARIABLE) \"Proof General Version $(FULLVERSION). Released by da$(DATEMSG).\"/g' $(VERSIONFILE).old > $(VERSIONFILE); rm $(VERSIONFILE).old)
+ (cd etc; mv ProofGeneral.spec ProofGeneral.spec.old; sed -e 's/Version:.*$$/Version: $(VERSION)/g' ProofGeneral.spec.old > ProofGeneral.spec; rm ProofGeneral.spec.old)
+# Edit $(DOWNLOADHTML) only for prereleases.
+# Careful: the sed command below relies on previous value of PRERELEASE_TAG.
+ if [ $(PRERELEASE_TAG) = $(VERSION) ]; then \
+ (cd html; mv $(DOWNLOADHTML) $(DOWNLOADHTML).old; sed -e 's|ProofGeneral-$(PRERELEASE_PREFIX)......|ProofGeneral-$(PRERELEASE_TAG)|g' $(DOWNLOADHTML).old > $(DOWNLOADHTML); rm $(DOWNLOADHTML).old); \
+ (cd html; mv $(DOWNLOADINFOHTML) $(DOWNLOADINFOHTML).old; sed -e 's|ProofGeneral-$(PRERELEASE_PREFIX)......|ProofGeneral-$(PRERELEASE_TAG)|g' $(DOWNLOADINFOHTML).old > $(DOWNLOADINFOHTML); rm $(DOWNLOADINFOHTML).old) \
+ fi
+# This hack to SOURCE: name is only needed because we have an obsolete version
+# of rpm installed on standard machines at dcs.ed, and we have to build with
+# that version. Otherwise we could use the %{version} macro in the spec file.
+ (cd etc; mv ProofGeneral.spec ProofGeneral.spec.old; sed -e 's/ProofGeneral-.*.tar.gz/$(RELEASENAMETARGZ)/g' ProofGeneral.spec.old > ProofGeneral.spec; rm ProofGeneral.spec.old)
+ (cd etc; mv ProofGeneral.spec ProofGeneral.spec.old; sed -e 's/ProofGeneral-.*.zip/$(RELEASENAMEZIP)/g' ProofGeneral.spec.old > ProofGeneral.spec; rm ProofGeneral.spec.old)
+ if [ -z "$(NOCVS)" ]; then cvs commit -m"Set version tag for new release." generic/$(VERSIONFILE) html/$(DOWNLOADHTML) html/$(DOWNLOADINFOHTML) etc/ProofGeneral.spec; fi
+ if [ -z "$(NOCVS)" ]; then cvs tag "$(CVS_RELEASENAME)"; fi
+
+############################################################
+##
+## untag: Remove the CVS_RELEASENAME tag from the CVS sources.
+##
+
+untag:
+ cvs tag -d "$(CVS_RELEASENAME)"
+
+
+############################################################
+##
+## dist: make a distribution in DISTBUILDIR from CVS sources
+## Builds for user-distribution, from sources tagged
+## with CVS_RELEASENAME.
+## Moves html files to parent directory, removes
+## non-distributed files.
+##
+dist:
+ @echo "*************************************************"
+ @echo " Cleaning dist build directory..."
+ @echo "*************************************************"
+ rm -rf $(DISTBUILDIR)
+ mkdir -p $(DISTBUILDIR)
+ @echo "*************************************************"
+ @echo " Running cvs export .."
+ @echo "*************************************************"
+ if [ -z "$(NOCVS)" ]; then \
+ (cd $(DISTBUILDIR); cvs export -kv -r "$(CVS_RELEASENAME)" -d $(RELEASENAME) $(CVSNAME)); \
+ else \
+ mkdir -p $(DISTBUILDIR)/$(RELEASENAME); \
+ cp -pr . $(DISTBUILDIR)/$(RELEASENAME); \
+ fi
+ @echo "*************************************************"
+ @echo " Running 'make alldist' for new release .."
+ @echo "*************************************************"
+ (cd $(DISTBUILDIR)/$(RELEASENAME); $(DEVELMAKE) alldist)
+ (cd $(DISTBUILDIR)/$(RELEASENAME); $(DEVELMAKE) clean)
+ @echo "*************************************************"
+# @echo " Copying doc files .."
+# @echo "*************************************************"
+# (cp -pr $(DISTBUILDIR)/$(RELEASENAME)/doc $(DISTBUILDIR))
+ @echo "*************************************************"
+ @echo " Moving html files .."
+ @echo "*************************************************"
+ (cd $(DISTBUILDIR)/$(RELEASENAME)/html; mv * ../..)
+ @echo "*************************************************"
+ @echo " Cleaning non-distributed files .."
+ @echo "*************************************************"
+ (cd $(DISTBUILDIR)/$(RELEASENAME); rm -rf $(NONDISTFILES))
+ @echo "*************************************************"
+ @echo " Making compressed tar file..."
+ @echo "*************************************************"
+ for f in $(IGNOREDFILES); do echo $$f >> ignoredfiles; done
+ (cd $(DISTBUILDIR); ln -sf $(RELEASENAME) $(NAME))
+ $(TAR) cvzf $(DISTBUILDIR)/$(RELEASENAMETARGZ) -C $(DISTBUILDIR) $(RELEASENAME) $(NAME) -X ignoredfiles
+ rm -f ignoredfiles
+ @echo "*************************************************"
+ @echo " Making zip file..."
+ @echo "*************************************************"
+ (cd $(DISTBUILDIR); for f in $(IGNOREDFILES); do echo $$f >> ignoredfiles; done)
+ (cd $(DISTBUILDIR); $(ZIP) -r $(RELEASENAMEZIP) $(RELEASENAME) -x@ignoredfiles)
+ rm -f ignoredfiles
+ @echo "*************************************************"
+ @echo " Finished making dist."
+ @echo "*************************************************"
+
+############################################################
+##
+## develdist: make a distribution for developers from
+## raw CVS sources, updating the ChangeLog.
+##
+develdist:
+ @echo "*************************************************"
+ @echo " Making developer distribution..."
+ @echo "*************************************************"
+ mkdir -p $(DISTBUILDIR)
+ if [ -z "$(NOCVS)" ]; then \
+ (make devel.ChangeLog; cvs commit -m"Updated." ChangeLog; cd $(DISTBUILDIR); cvs export -kv -r "$(CVS_RELEASENAME)" -d $(DEVELRELEASENAME) $(CVSNAME)) \
+ else \
+ mkdir -p $(DISTBUILDIR)/$(DEVELRELEASENAME); \
+ cp -pr . $(DISTBUILDIR)/$(DEVELRELEASENAME); \
+ fi
+ $(TAR) cvzf $(DISTBUILDIR)/$(DEVELRELEASENAMETARGZ) -C $(DISTBUILDIR) $(DEVELRELEASENAME)
+
+
+############################################################
+##
+## release:
+## tag the CVS sources, and make a distribution.
+## Then install the distribution in RELEASEDIR
+## WARNING: RELEASEDIR is not cleaned, but files there
+## with same names will be overwritten.
+## Moreover, a link ProofGeneral -> ProofGeneral-<version>
+## is made.
+##
+release: distclean tag dist develdist
+ mkdir -p $(RELEASEDIR)
+# clean destination a bit. NB: link RELEASENAME->NAME is copied,
+# so we remove that too.
+ (cd $(RELEASEDIR); rm -f $(NAME); rm -rf $(RELEASENAME))
+ cp -pfdr $(DISTBUILDIR)/* $(RELEASEDIR)
+ (cd $(RELEASEDIR); ln -sf $(RELEASENAMETARGZ) $(LATESTNAME).tar.gz)
+ (cd $(RELEASEDIR); ln -sf $(RELEASENAMEZIP) $(LATESTNAME).zip)
+ (cd $(RELEASEDIR); ln -sf $(RELEASENAME)-1.noarch.rpm $(LATESTNAME).noarch.rpm)
+ (cd $(RELEASEDIR); ln -sf $(DEVELRELEASENAMETARGZ) $(DEVELLATESTNAME).tar.gz)
+ (cd $(RELEASEDIR); echo $(PRERELEASE_TAG) > $(PREREL_TAG_FILE))
+ @echo "*************************************************"
+ @echo " Finished installing dist."
+ @echo "*************************************************"
+
+
+############################################################
+##
+## rpm:
+## Build an RPM binary package from the recently made distribution
+## using the tarball. (Any user could do this)
+##
+##
+rpm:
+ rm -rf $(RPMTOPDIR)
+ mkdir -p $(RPMTOPDIR)/RPMS
+ mkdir -p $(RPMTOPDIR)/SPECS
+ mkdir -p $(RPMTOPDIR)/SOURCES
+ mkdir -p $(RPMTOPDIR)/BUILD
+ $(RPM) -tb $(DISTBUILDIR)/$(RELEASENAMETARGZ)
+
+############################################################
+##
+## rpmrelease:
+## Build and install RPM package into RELEASEDIR.
+##
+rpmrelease: rpm
+ cp -pf $(RPMTOPDIR)/RPMS/noarch/* $(RELEASEDIR)
+
+############################################################
+##
+## releaseclean:
+## Clean up temporary directories after building dist/release.
+##
+releaseclean:
+ rm -rf $(DISTBUILDIR) $(RPMTOPDIR)
+
+############################################################
+##
+## fakereleaseall:
+## Do everything, but don't access CVS. Just for
+## testing on non-live system, really.
+##
+##
+fakereleaseall:
+ $(MAKE) -f Makefile.devel release rpmrelease releaseclean golive NOCVS="no"
+
+############################################################
+##
+## releaseall:
+## Do everything!
+##
+## For now, don't do distinstall any more: this only works
+## for the DCS Sun machines.
+##
+releaseall: release rpmrelease releaseclean golive
+
+############################################################
+##
+## golive:
+## Execute golive command.
+##
+golive:
+ $(GOLIVE)
+
+############################################################
+##
+## releasefinal:
+## Do everything for a final release based on a pre-release.
+## Don't use
+##
+releasefinal: release rpmrelease distinstall releaseclean
+
+
+############################################################
+##
+## distinstall:
+## Do everything for a local release.
+##
+distall: distclean tag dist distinstall releaseclean
+
+
+
+############################################################
+#
+# distinstall:
+# Install distribution from $(DISTBUILDIR) into DISTINSTALLDIR
+# Clean out DISTINSTALLDIR first.
+# NB! Simple install, no attempt to put info files, etc, in
+# special places.
+#
+distinstall:
+ rm -rf $(DISTINSTALLDIR)/$(NAME)
+ mkdir -p $(DISTINSTALLDIR)
+ (cd $(DISTINSTALLDIR); \
+ $(TAR) -xpzf $(DISTBUILDIR)/$(RELEASENAMETARGZ); \
+ mv $(RELEASENAME) $(NAME))
+
+############################################################
+#
+# links:
+#
+# Make some handy links for developers.
+#
+links:
+ ln -sf ../html/ProofGeneralPortrait.eps.gz doc
+ ln -sf ../../ProofGeneral html
+