## -*- makefile -*- ## ## Makefile for Proof General development. ## ## Author: David Aspinall ## ## Maintainer: Proof General maintainer ## ## 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 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'. ## ## ## 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 Markus Wenzel da+pg-wenzelm@inf.ed.ac.uk" \ -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\.5.1pre PRERELEASE_TAG=3.5.1pre$(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 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) # 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); make pub.$(DOWNLOADHTML); make pub.${DOWNLOADINFOHTML}; 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=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 # 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)' 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 # Copied from distributed Makefile ELISP_DIRS=acl2 coq demoisa generic hol98 isa isar lclam lego mmm phox plastic twelf SUBDIRS=$(ELISP_DIRS) etc doc 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: distcompile distdocs ############################################################ # # Make tags file # tags: $(EL) etags $(EL) todo doc/ProofGeneral.texi doc/PG-adapting.texi > TAGS ############################################################ # # 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 "dcs.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 # clean: @echo "***** CLEANING UP INTERMEDIATE FILES ****" (cd doc; $(MAKE) clean) (cd images; $(MAKE) clean) rm -f doc/ProofGeneralPortrait.eps.gz rm -f $(HTMLDIR)/ProofGeneral ############################################################ # # Clean up intermediate files, all generated files # and Emacs backups, CVS temps # distclean: 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/ ############################################################ # # 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 $(DOWNLOADHTML) and $(DOWNLOADINFOHTML) ## 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 # 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 $(HTMLDIR); mv $(DOWNLOADHTML) $(DOWNLOADHTML).old; sed -e 's|ProofGeneral-$(PRERELEASE_PREFIX)......|ProofGeneral-$(PRERELEASE_TAG)|g' $(DOWNLOADHTML).old > $(DOWNLOADHTML); rm $(DOWNLOADHTML).old); \ (cd $(HTMLDIR); 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) etc/ProofGeneral.spec; (cd $(HTMLDIR); cvs commit -m"Set version tag for new release." $(DOWNLOADHTML) $(DOWNLOADINFOHTML)); 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); $(DEVELMAKE) alldist) (cd $(DISTBUILDIR)/$(RELEASENAME); $(DEVELMAKE) 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) -C $(DISTBUILDIR) $(RELEASENAME) $(NAME) -X $(DISTBUILDIR)/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) # 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) ############################################################ ## ## 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 $($*)