From 8d405f342bb3a1903fc12184f78f191e7d84c29d Mon Sep 17 00:00:00 2001 From: zhenya1007 Date: Sat, 31 Dec 2016 11:23:38 -0800 Subject: A first pass at converting from CVS to git. (#127) Do some cleanup in the Makefile.devel file. --- Makefile.devel | 166 +++++++++++++++++++++++---------------------------------- 1 file changed, 66 insertions(+), 100 deletions(-) diff --git a/Makefile.devel b/Makefile.devel index 39accdc8..bba2efef 100644 --- a/Makefile.devel +++ b/Makefile.devel @@ -13,12 +13,12 @@ ## ## make elisptidy - tidy up elisp files (run whitespace-cleanup) ## -## make ChangeLog - make ChangeLog from CVS sources +## make ChangeLog - make ChangeLog from git log ## 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 tag - tag the sources with GIT_RELEASENAME +## make untag - remove tag GIT_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 pkg - make Emacs tar file packages (Tromey's package.el) @@ -43,8 +43,8 @@ ## ## Use 'make releaseclean' if giving up, to remove temp dirs. ## -## NB: no facility to edit html to make a full release in this Makefile. -## Edit download.html by hand, then run +## NB: no facility to edit html to make a full release in this Makefile. +## Edit download.html by hand, then run ## ## make releaseall VERSION=2.0 ## @@ -57,7 +57,7 @@ ## ## ## $Id$ -## +## ########################################################################### ## TODO: could include prerel tag in web pages, and link using -latest @@ -89,14 +89,14 @@ DEVELOPERS=\ # 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 +# of the current pre-release version (currently not used explicitly # anywhere for web pages/whatever). PRERELEASE_PREFIX=4\.4\.1~pre PRERELEASE_TAG=4.4.1~pre ### Formerly: PRERELEASE_TAG=4.4pre$(shell date "+%y%m%d") PREREL_TAG_FILE=prereltag.txt -# Path to web pages in repository, used for automatically +# Path to web pages in repository, used for automatically # updating with release information. HTMLDIR=../web DOWNLOADHTMLS=devel.html @@ -124,14 +124,9 @@ 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) +GIT_RELEASENAME ?= v$(FULLVERSION) # Where to release (i.e. copy) a new distribution to. # This may be the final directory (local) or temporary directory. @@ -141,16 +136,6 @@ RELEASEDIR = /tmp/proofgeneral-www # How to make the release "live". (Could be "true" to do nothing). GOLIVE=rsync -e ssh -auv $(RELEASEDIR)/* ssh.inf.ed.ac.uk:/group/project/proofgeneral/web/releases/ - -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 @@ -160,10 +145,10 @@ EMACSFLAGS=-q -no-site-file # GNU version of tar, please TAR=tar -# Files not to include the distribution area or tarball +# Files not to include the distribution area or tarball UNFINISHED_ELISP= -ETC_FILES=etc/lego etc/coq etc/demoisa etc/isa etc/isar etc/lego etc/patches etc/*.txt -NONDISTFILES=.cvsignore */.cvsignore Makefile.devel etc/trac etc/testsuite $(UNFINISHED_ELISP) $(ETC_FILES) +ETC_FILES=etc/lego etc/coq etc/demoisa etc/isa etc/isar etc/lego etc/patches etc/*.txt +NONDISTFILES=.gitignore */.gitignore Makefile.devel etc/trac etc/testsuite $(UNFINISHED_ELISP) $(ETC_FILES) DOCDISTFILES=ProofGeneral.info PG-adapting.info # Files not to include in the ordinary distribution tarball, but left @@ -181,7 +166,7 @@ RELEASENAMETGZ = $(RELEASENAME).tgz RELEASENAMERPM = $(RELEASENAME)-1.noarch.rpm RELEASENAMEDMG = $(RELEASENAME).dmg -# Where to install a distribution +# Where to install a distribution DISTINSTALLDIR=/usr/local/share/elisp/proofgeneral SUBDIRS=$(ELISP_DIRS) etc doc images @@ -192,7 +177,7 @@ FORCE: # Targets to pre-compile for distribution # Warning: elisp files are incompatible across emacs versions! -alldist: distcompile distdocs +alldist: distcompile distdocs ############################################################ @@ -212,37 +197,30 @@ tags: $(EL) $(TAGS_EXTRAS) run.%: $(EMACS) $(EMACSFLAGS) -l generic/proof-site.el -eval '(proof-visit-example-file "$*")' -test.%: +test.%: if [ -f "$*/$*-autotest.el" ]; then if $(EMACS) $(EMACSFLAGS) -l generic/proof-site.el $*/$*-autotest.el -f eval-current-buffer; then echo "Autotests for $* run successfully on `date`"; else cat $*/.autotest.log; echo "Autotests for $* ran with failures on `date`"; exit 1; fi; fi -profile.%: +profile.%: if [ -f "$*/$*-profiling.el" ]; then if $(EMACS) $(EMACSFLAGS) -l generic/proof-site.el $*/$*-profiling.el -f eval-current-buffer; then echo "Profiling for $* run successfully on `date`"; else echo "Profiling for $* ran with failures on `date`"; exit 1; fi; cat $*/.profile.log; fi -testall.%: +testall.%: for prover in ${PROVERS}; do $(MAKE) test.$$prover EMACS=$*; done ############################################################ # -# Add recent messages to ChangeLog. CVSROOT must be set correctly. +# Add recent messages to ChangeLog. # # FIXME: this duplicates entries made on the same day: we could do # with a way of cleaning the last day from the ChangeLog. # -# Debian default path -RCS2LOG=/usr/share/cvs/contrib/rcs2log ChangeLog: FORCE - $(RCS2LOG) -h "inf.ed.ac.uk" $(DEVELOPERS) -r -b -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 + git log --pretty="format:%ad %s" --date=short > ChangeLog -logupdate: ChangeLog.gz - cvs commit -m"Updated" ChangeLog.gz ############################################################ # -# Clean up intermediate files +# Clean up intermediate files # devclean: FORCE @echo "***** CLEANING UP INTERMEDIATE FILES ****" @@ -253,23 +231,14 @@ devclean: FORCE ############################################################ # -# Clean up intermediate files, all generated files -# and Emacs backups, CVS temps +# Clean up intermediate files, all generated files +# and Emacs backups. # distclean: devclean clean @echo "***** CLEANING UP ALL JUNK FILES ****" find . \( -name '*~' -o -name '#*#' -o -name '\.\#*' -o -name '\.*\.log' \) -print | xargs rm -f (cd doc; $(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) - ############################################################ # @@ -309,51 +278,49 @@ distcompile: FORCE ############################################################ ## -## tag: tag the CVS sources of working directory with CVS_RELEASENAME, -## set version stamp in proof-site.el and ProofGeneral.spec +## tag: tag the sources of working directory with GIT_RELEASENAME, +## set version stamp in proof-site.el and ProofGeneral.spec ## to VERSION, and edit $(DOWNLOADHTMLS) ## if VERSION matches PRERELEASE_TAG. ## -tag: +tag: @echo "*************************************************" - @echo " Tagging sources... (you must rerun if CVS source dirty)" + @echo " Tagging sources... " @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 + if [ -z "$(NOCVS)" ]; then git fetch origin && git log --exit-code master...origin/master || 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).\"/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\([emacselc-]*\)-$(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 +# if [ $(PRERELEASE_TAG) = $(VERSION) ]; then \ +# (cd $(HTMLDIR); \ +# for f in $(DOWNLOADHTMLS); do \ +# mv $$f $$f.old; \ +# sed -e 's|ProofGeneral\([emacselc-]*\)-$(PRERELEASE_PREFIX)......|ProofGeneral\1-$(PRERELEASE_TAG)|g' $$f.old > $$f; \ +# rm $$f.old; \ +# done) \ +# fi + if [ -z "$(NOCVS)" ]; then git add generic/$(VERSIONFILE) etc/ProofGeneral.spec && git commit -m"Set version tag for new release." ; fi + if [ -z "$(NOCVS)" ]; then git tag -a "$(GIT_RELEASENAME)"; fi ############################################################ ## -## untag: Remove the CVS_RELEASENAME tag from the CVS sources. +## untag: Remove the GIT_RELEASENAME tag from the sources. ## untag: - cvs tag -d "$(CVS_RELEASENAME)" + git tag -d "$(GIT_RELEASENAME)" ############################################################ ## ## dist: make a distribution in DISTBUILDIR from CVS sources -## Builds for user-distribution, from sources tagged -## with CVS_RELEASENAME. +## Builds for user-distribution, from sources tagged +## with GIT_RELEASENAME. ## Moves html files to parent directory, removes ## non-distributed files. -## (NB: lines in subshells here inherit CVSROOT settings from above) -## +## cvsexport: @echo "*************************************************" @@ -362,8 +329,7 @@ cvsexport: rm -rf $(DISTBUILDIR) mkdir -p $(DISTBUILDIR) if [ -z "$(NOCVS)" ]; then \ - (cd $(DISTBUILDIR); \ - cvs -d $(CVSROOT) export -kv -r "${CVS_RELEASENAME}" -d ${RELEASENAME} ${CVSNAME}) \ + git archive --format=tar --prefix=$(RELEASENAME)/ $(GIT_RELEASENAME) | (cd "$(DISTBUILDIR)" && tar xf -) \ else \ mkdir -p $(DISTBUILDIR)/$(RELEASENAME); \ cp -pr . $(DISTBUILDIR)/$(RELEASENAME); \ @@ -390,7 +356,7 @@ dist: cvsexport -(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)/$(RELEASENAMETGZ) --directory $(DISTBUILDIR) --exclude-from $(DISTBUILDIR)/ignoredfiles $(RELEASENAME) $(NAME) + $(TAR) cvzf $(DISTBUILDIR)/$(RELEASENAMETGZ) --directory $(DISTBUILDIR) --exclude-from $(DISTBUILDIR)/ignoredfiles $(RELEASENAME) $(NAME) # remove temporary files made for tar/zip only (cd $(DISTBUILDIR); rm -f ignoredfiles $(NAME)) @echo "*************************************************" @@ -401,12 +367,12 @@ dist: cvsexport ############################################################ ## ## release: -## tag the CVS sources, and make a distribution. +## tag the sources, and make a distribution. ## Then install the distribution in RELEASEDIR ## WARNING: RELEASEDIR is not cleaned except to remove ## links, but files there with same names will be overwritten. ## -release: check distclean tag dist +release: check distclean tag dist @echo "*************************************************" @echo " Making release (installing tarball distributions)." @echo "*************************************************" @@ -425,16 +391,16 @@ release: check distclean tag dist ############################################################ ## ## rpm: -## Build an RPM binary package from the recently made distribution +## Build an RPM binary package from the recently made distribution ## using the tarball. (Any user could do this) ## -## +## # Temporary RPM topdir for building packages as non-root user. RPMTOPDIR=/tmp/$(NAME)-rpm RPMBUILD=rpmbuild --define '_topdir $(RPMTOPDIR)' -rpm: +rpm: rm -rf $(RPMTOPDIR) mkdir -p $(RPMTOPDIR)/RPMS mkdir -p $(RPMTOPDIR)/SPECS @@ -447,8 +413,8 @@ rpm: ## ## pkg: ## Build an Emacs .tar file package -## -PKGMOVES=doc/dir doc/ProofGeneral.info doc/PG-adapting.info +## +PKGMOVES=doc/dir doc/ProofGeneral.info doc/PG-adapting.info PKGDELETES=obsolete etc doc # Emacs package version is fussy about non-numbers in version, have to make version # from date. @@ -466,7 +432,7 @@ pkg: cvsexport ## ## rpmrelease: ## Build and install RPM package into RELEASEDIR. -## +## rpmrelease: rpm cp -pf $(RPMTOPDIR)/RPMS/noarch/* $(RELEASEDIR) @@ -476,9 +442,9 @@ rpmrelease: rpm ## Build (on Linux) a Mac OS X dmg disk image file ## This requires sudo powers for mounting, and ## (on Ubuntu), packages hfsplus and hfsprogs -## +## DMGBUILD=$(DISTBUILDIR)/dmg -dmg: +dmg: rm -rf $(DMGBUILD) mkdir -p $(DMGBUILD) dd if=/dev/zero of=$(DISTBUILDIR)/$(RELEASENAMEDMG) bs=1 count=0 seek=16M @@ -511,23 +477,23 @@ releaseclean: ## fakereleaseall: ## Do everything, but don't access CVS. Just for ## testing on non-live system, really. -## -## -fakereleaseall: - $(MAKE) -f Makefile.devel release releaseclean NOCVS="no" +## FIXME: does this still make sense now that git is used version control? +## +fakereleaseall: + $(MAKE) -f Makefile.devel release releaseclean NOCVS="no" ############################################################ ## ## releaseall: ## Do everything! (EXCEPT: ChangeLog.gz update) -## +## releaseall: release releaseclean golive ############################################################ ## ## golive: ## Execute golive command. -## +## golive: $(GOLIVE) cd $(HTMLDIR); for f in $(DOWNLOADHTMLS); do $(MAKE) pub.$$f; done; @@ -540,8 +506,8 @@ golive: ## Do everything for a final release based on a pre-release. ## Except editing download file. ## -releasefinal: release releaseclean -# Link the latest version +releasefinal: release releaseclean +# Link the latest version # 31.5.13: remove this link from tar file, it is unconventional # (cd $(DISTBUILDIR); rm -f $(NAME); ln -sf $(RELEASENAME) $(NAME)) @@ -550,7 +516,7 @@ releasefinal: release releaseclean ## ## distinstall: ## Do everything for a local release. -## +## distall: distclean tag dist distinstall releaseclean @@ -573,7 +539,7 @@ distinstall: ############################################################ # # links: -# +# # Make some handy links for developers. # links: @@ -582,9 +548,9 @@ links: ################################################################# ## -## Reporting Makefile settings. +## Reporting Makefile settings. ## -## Useful for debugging Makefile +## Useful for debugging Makefile show.%: @echo $($*) -- cgit v1.2.3