## -*- makefile -*- ## ## Makefile for Proof General development. ## ## Author: David Aspinall ## ## Maintainer: Proof General maintainer ## ## Developer use only, not part of user 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 golive - publish previously built distribution ## ## make links - add some links which help testing web pages ## from the html directory. ## ## make releaseclean - clean up after 'make dist' 'make rpmrelease'. ## ## make testall.xemacs - run all autotest files in Emacs named "xemacs" ## ## ## 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 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 ## ## ## $Id$ ## ########################################################################### ## TODO: could include prerel tag in web pages, and link using -latest ## sym links. Would avoid needing to edit html below. # Names and real mail addresses of developers # Arguments for rcs2log for ChangeLog target # NB: must use TAB as separator in list below. DEVELOPERS=\ -u "da David Aspinall da@inf.ed.ac.uk" \ -u "gkein Gerwin Klein gklein@in.tum.de" \ -u "sberghof Stefan Berghofer berghofe@in.tum.de" \ -u "markus Makarius makarius@sketis.net" \ -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 da+pg-patrl@inf.ed.ac.uk" \ -u "tms Thomas Kleymann da+pg-tms@inf.ed.ac.uk" \ -u "djs Dilip Sequiera da+pg-djs@inf.ed.ac.uk" \ -u "hhg Healfdene Goguen da+pg-hhg@inf.ed.ac.uk" # PRERELEASE_PREFIX is used to match PRERELEASE_TAG in sed # line in tag target below, which edits $(DOWNLOADHTML) # The prereltag.txt is kept as a record in the distrib area # of the current pre-release version (currently not used explicitly # anywhere for web pages/whatever). PRERELEASE_PREFIX=3\.7pre PRERELEASE_TAG=3.7pre$(shell date "+%y%m%d") PREREL_TAG_FILE=prereltag.txt # Path to web pages in repository, used for automatically # updating with release information. HTMLDIR=../web DOWNLOADHTMLS=develdownload.html 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) # devel just means developer's package, with more files. # bit ambiguous: "development version" means latest version, # in development. # LATESTNAME is linked to the development version. # NAME is linked to the current release. # (Before 3.4, NAME was linked to the development version). NAME = ProofGeneral LATESTNAME = $(NAME)-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) CVS_RELEASENAME = Release-$(CVS_VERSION) # Where to release (i.e. copy) a new distribution to. # This may be the final directory (local) or temporary directory. # was: RELEASEDIR = /home/proofgen/www RELEASEDIR = /tmp/proofgeneral-www # How to make the release "live". (Could be "true" to do nothing). # was: GOLIVE=true # GOLIVE=scp -pr $(RELEASEDIR)/* ssh.inf.ed.ac.uk:/group/project/proofgeneral/web/releases/ # Use rsync instead of scp: it copies links. Also clean releasedir GOLIVE=(rsync -e ssh -auv $(RELEASEDIR)/* ssh.inf.ed.ac.uk:/group/project/proofgeneral/web/releases/; rm -rf $(RELEASEDIR); cd $(HTMLDIR); for f in $(DOWNLOADHTMLS); do make pub.$f; done; rm -rf ${RELEASEDIR}) CVSNAME = ProofGeneral # Remote commands to use CVS in server mode and install files. # With these settings the build can be done remotely. # CVSROOT = :pserver:da@cvs.inf.ed.ac.uk:/disk/cvs/proofgen # FIXME: this command causes an error on some recursive calls, e.g. to do # make clean in a non cvs directory. CVSROOT=$(shell cat CVS/Root) # Emacs for batch compiling BATCHEMACS=$(EMACS) -batch -q -no-site-file # Emacs for interactive use in testing EMACSFLAGS=-q -no-site-file # GNU version of tar, please TAR=tar # zip utility ZIP=zip # Files not to include the distribution area or tarball # FIXME: really this should be an opt-in list! UNFINISHED_ELISP=generic/pg-metadata.el generic/pg-xhhtml.el generic/_pkg.el ETC_FILES=etc/lego etc/coq etc/demoisa etc/isa etc/isar etc/lego etc/patches etc/pgkit etc/*.txt pgkit etc/Mailman NONDISTFILES=.cvsignore */.cvsignore Makefile.devel Makefile.xemacs doc/notes.txt doc/ProofGeneral.dvi doc/PG-adapting.dvi doc/ProofGeneral.jpg images/*.xcf images/notes.txt images/gimp images/Makefile $(UNFINISHED_ELISP) $(ETC_FILES) # 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*/TAGS ProofGeneral*/Makefile.devel ProofGeneral*/TODO.* ProofGeneral*/BUGS.* 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*/doc/docstring-magic.el ProofGeneral*/*/todo ProofGeneral*/etc/TESTS ProofGeneral*/*.cvsignore ProofGeneral*/*/*.cvsignore # 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 # RPMBUILD=rpmbuild --rcfile $(RPMRC) RPMBUILD=rpmbuild --define '_topdir $(RPMTOPDIR)' # Temporary dmg root for building Mac OS X 10.4 disk image files. DMGTOPDIR=/tmp/$(NAME)-dmg RELEASENAMETAR = $(RELEASENAME).tar RELEASENAMETARGZ = $(RELEASENAMETAR).gz RELEASENAMEZIP = $(RELEASENAME).zip # What the RPM should be called. RELEASENAMERPM = $(RELEASENAME)-1.noarch.rpm # 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 SUBDIRS=$(ELISP_DIRS) etc doc images PWD=$(shell pwd) BYTECOMP = $(BATCHEMACS) -eval '(setq load-path (append (list "$(PWD)/generic" "$(PWD)/lib" "$(PWD)/lego" "$(PWD)/coq" "$(PWD)/isar") load-path))' -f batch-byte-compile EL=$(shell for f in $(ELISP_DIRS); do ls $$f/*.el; done) ELC=$(EL:.el=.elc) %.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: distcompile distdocs ############################################################ # # Make tags file # TAGS_EXTRAS=x-symbol/lisp/*.el ETAGS=etags tags: $(EL) $(TAGS_EXTRAS) $(ETAGS) $(EL) $(TAGS_EXTRAS) TODO.developer doc/ProofGeneral.texi doc/PG-adapting.texi > TAGS ############################################################ # # Run tests for a particular prover and particular Emacs # test.%: if [ -f "$*/$*-autotest.el" ]; then if $(EMACS) $(EMACSFLAGS) -l generic/proof-site.el $*/$*-autotest.el -f eval-current-buffer; then echo "Autotests run successfully on `date`" > $*/.autotest.txt; else rm -f $*/autotest.txt; exit 1; fi; fi testall.%: for prover in ${PROVERS}; do $(MAKE) devel.test.$$prover EMACS=$*; done ############################################################ # # Add recent messages to ChangeLog. CVSROOT must be set correctly. # # FIXME: this duplicates entries made on the same day: we could do # with a way of cleaning the last day from the ChangeLog. # ChangeLog: FORCE rcs2log -h "inf.ed.ac.uk" $(DEVELOPERS) -i 4 | sed 's|/home/proofgen/src/ProofGeneral/||g' > ChangeLog.prefix if [ -f ChangeLog ]; then mv ChangeLog ChangeLog.old; else echo > ChangeLog.old; fi cat ChangeLog.prefix ChangeLog.old | sed 's|/disk/cvs/proofgen/ProofGeneral/||g' > ChangeLog rm ChangeLog.prefix ChangeLog.old logupdate: ChangeLog.gz cvs commit -m"Updated" ChangeLog.gz ############################################################ # # Clean up intermediate files # devclean: FORCE @echo "***** CLEANING UP INTERMEDIATE FILES ****" rm -f doc/ProofGeneralPortrait.eps.gz rm -f $(HTMLDIR)/ProofGeneral ############################################################ # # Clean up intermediate files, all generated files # and Emacs backups, CVS temps # distclean: devclean clean @echo "***** CLEANING UP ALL JUNK FILES ****" 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 @echo "***** CLEANING UP ALL NON-CVS FILES ****" # rm -rf $(FILES_NONCVS) (cd doc; $(MAKE) distclean) (cd images; $(MAKE) cvsclean) ############################################################ # # autoloads in generic/ # autoloads: $(EL) @echo "***** MAKING AUTOGENERATED AUTOLOADS ****" $(BATCHEMACS) -eval '(setq autoload-package-name "proof" generated-autoload-file "$(PWD)/generic/proof-autoloads.el")' -f batch-update-autoloads generic/ lib/ ############################################################ # # Documentation # distdocs: FORCE @echo "***** MAKING DISTRIBUTION DOCS ****" (cd doc; ln -s $(HTMLDIR)/ProofGeneralPortrait.eps.gz .; $(MAKE) dist) ############################################################ # # Compilation # distcompile: FORCE @echo "***** MAKING ELC FILES ****" ## FIXME: for now, ignroe errors in compilation -$(MAKE) compile ############################################################ # # Images # images: FORCE @echo "***** MAKING IMAGES ****" (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 $(DOWNLOADHTMLS) ## if VERSION matches PRERELEASE_TAG. ## tag: @echo "*************************************************" @echo " Tagging sources... (you must 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 -Pd | grep '^[MC] '`" ]; then cvs update -Pd; exit 1; fi # Update version in proof-site.el (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) # Tag ProofGeneral.spec (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 $(DOWNLOADHTMLS) only for prereleases. # Careful: the sed command below relies on previous value of PRERELEASE_TAG. if [ $(PRERELEASE_TAG) = $(VERSION) ]; then \ (cd $(HTMLDIR); \ for f in $(DOWNLOADHTMLS); do \ mv $$f $$f.old; \ sed -e 's|ProofGeneral\([xemacselc-]*\)-$(PRERELEASE_PREFIX)......|ProofGeneral\1-$(PRERELEASE_TAG)|g' $$f.old > $$f; \ rm $$f.old; \ done) \ fi if [ -z "$(NOCVS)" ]; then cvs commit -m"Set version tag for new release." generic/$(VERSIONFILE) etc/ProofGeneral.spec; (cd $(HTMLDIR); cvs commit -m"Set version tag for new release." $(DOWNLOADHTMLS)); fi if [ -z "$(NOCVS)" ]; then cvs tag -cF "$(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. ## (NB: lines in subshells here inherit CVSROOT settings from above) ## 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 -d $(CVSROOT) 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); $(MAKE) alldist) (cd $(DISTBUILDIR)/$(RELEASENAME); $(MAKE) clean) @echo "*************************************************" # @echo " Copying doc files .." # @echo "*************************************************" # (cp -pr $(DISTBUILDIR)/$(RELEASENAME)/doc $(DISTBUILDIR)) @echo "*************************************************" @echo " Cleaning non-distributed files .." @echo "*************************************************" (cd $(DISTBUILDIR)/$(RELEASENAME); rm -rf $(NONDISTFILES)) @echo "*************************************************" @echo " Making compressed tar file..." @echo "*************************************************" -(cd $(DISTBUILDIR); ls $(IGNOREDFILES) > ignoredfiles; echo ignoredfiles >> ignoredfiles) # link the long name to short name for convenience of user (cd $(DISTBUILDIR); ln -sf $(RELEASENAME) $(NAME)) $(TAR) cvzf $(DISTBUILDIR)/$(RELEASENAMETARGZ) --directory $(DISTBUILDIR) --exclude-from $(DISTBUILDIR)/ignoredfiles $(RELEASENAME) $(NAME) @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) # remove temporary files made for tar/zip only (cd $(DISTBUILDIR); rm -f ignoredfiles $(NAME)) @echo "*************************************************" @echo " Finished making dist." @echo "*************************************************" ############################################################ ## ## 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. ## release: distclean tag dist @echo "*************************************************" @echo " Making release (installing tarball distributions)." @echo "*************************************************" mkdir -p $(RELEASEDIR) # clean source dir (remove link to this release) (cd $(DISTBUILDIR); rm -f $(NAME)) # clean target dir (remove link for latest release) (cd $(RELEASEDIR); rm -rf $(RELEASENAME)) # Seem to need R instead of r here now, # Otherwise cp tries to make hard link instead of symlink?! cp -pfdR $(DISTBUILDIR)/* $(RELEASEDIR) (cd $(RELEASEDIR); rm -f $(LATESTNAME); ln -s $(RELEASENAME) $(LATESTNAME)) (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); 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 $(RPMBUILD) -tb $(DISTBUILDIR)/$(RELEASENAMETARGZ) ############################################################ ## ## rpmrelease: ## Build and install RPM package into RELEASEDIR. ## rpmrelease: rpm cp -pf $(RPMTOPDIR)/RPMS/noarch/* $(RELEASEDIR) ############################################################ ## ## dmg: ## Build a Mac OS X dmg disk image file from the recently made ## distribution using the tarball. ## ## dmg: rm -rf $(DMGTOPDIR) hdiutil create -srcfolder $(DISTBUILDIR) mkdir -p $(RPMTOPDIR)/SPECS mkdir -p $(RPMTOPDIR)/SOURCES mkdir -p $(RPMTOPDIR)/BUILD $(RPMBUILD) -tb $(DISTBUILDIR)/$(RELEASENAMETARGZ) ############################################################ ## ## 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 NOCVS="no" ############################################################ ## ## releaseall: ## Do everything! (EXCEPT: ChangeLog.gz update) ## releaseall: release rpmrelease releaseclean golive ############################################################ ## ## golive: ## Execute golive command. ## golive: $(GOLIVE) ############################################################ ## ## releasefinal: ## Do everything for a final release based on a pre-release. ## Except editing download file. ## releasefinal: release rpmrelease releaseclean # Link the latest version (cd $(DISTBUILDIR); rm -f $(NAME); ln -sf $(RELEASENAME) $(NAME)) ############################################################ ## ## 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 $(HTMLDIR)/ProofGeneralPortrait.eps.gz doc ln -sf ../../ProofGeneral $(HTMLDIR) ################################################################# ## ## Reporting Makefile settings. ## ## Useful for debugging Makefile show.%: echo $($*)