Coccinelle release-1.0.0-rc11
[bpt/coccinelle.git] / Makefile.release
index f87b10f..1ccbc03 100644 (file)
@@ -6,16 +6,20 @@
 PACKAGE=$(PRJNAME)-$(VERSION)
 CCPACKAGE=coccicheck-$(CCVERSION)
 
-EXCLUDE=debian
-
+EXCLUDE=$(PACKAGE)/debian .depend
+
+DOC=docs/manual/manual.pdf       \
+    docs/manual/options.pdf      \
+    docs/manual/main_grammar.pdf \
+    docs/html                    \
+    docs/man                     \
+    docs/spatch.1                \
+    docs/manual/cocci-python.txt
 BINSRC=spatch env.sh env.csh standard.h standard.iso \
-       *.txt \
-       docs/manual/manual.pdf docs/manual/options.pdf docs/manual/main_grammar.pdf docs/spatch.1 \
-       docs/manual/cocci-python.txt \
-       demos/*
+       *.txt $(DOC) demos/*
 BINSRC-PY=$(BINSRC) $(PYLIB) python/coccilib/
 
-EXCL=$(EXCLUDE:%=--exclude=$(PACKAGE)/%)
+EXCL=$(EXCLUDE:%=--exclude=%)
 BINSRC2=$(BINSRC:%=$(PACKAGE)/%)
 BINSRC2-PY=$(BINSRC-PY:%=$(PACKAGE)/%)
 
@@ -24,14 +28,14 @@ OCAMLVERSION=$(shell ocaml -version |perl -p -e 's/.*version (.*)/$$1/;')
 
 # Procedure to do first time:
 #  cd ~/release
-#  cvs checkout coccinelle -dP
+#  git clone ... coccinelle
 #  cd coccinelle
 #
 # Procedure to do each time:
 #
 #  1) make prerelease # WARN: These will clean your local rep. of pending modifications
 #
-#  UPDATE VERSION number in globals/config.ml.in
+#  UPDATE VERSION number in ./version
 #  and commit it with
 #
 #  2) make release
@@ -57,15 +61,31 @@ OCAMLVERSION=$(shell ocaml -version |perl -p -e 's/.*version (.*)/$$1/;')
 # the scripts/licensify has been run at least once.
 # For the 'make bintar' I can do it from my original repo.
 
+# The 'git rebase' is in there just in case you started with
+# unpushed changes. However, that is probably something you should
+# not do in the first place.
+
 prerelease:
-       cvs up -CdP
+       git pull --rebase
+       $(MAKE) fix-expected
        $(MAKE) distclean
        sed -i "s|^OCAMLCFLAGS=.*$$|OCAMLCFLAGS=|" Makefile
-       @echo "\n\tEdit globals/config.ml.in"
+       @echo "\n\tEdit ./version"
        @echo "\tCommit with 'make release'\n"
 
+fix-expected:
+       $(MAKE) distclean
+       ./configure --without-python
+       $(MAKE) world
+       yes | ./spatch.opt -testall
+       cp tests/SCORE_actual.sexp tests/SCORE_expected_orig.sexp
+
 release:
-       cvs ci -m "Release $(VERSION)" globals/config.ml.in
+       sed -i -e 's|^let version = ".*"$$|let version = "$(VERSION)"|g' globals/config.ml.in
+       git add ./ version globals/config.ml.in
+       git commit -m "Release $(VERSION)"
+       git tag -a -m "Release $(VERSION)" $(VERSION)
+       git push --mirror
        $(MAKE) licensify
        @echo "\n\tRun 'make package'\n"
 
@@ -73,6 +93,8 @@ package:
        $(MAKE) package-src
        $(MAKE) package-nopython
        $(MAKE) package-python
+       @echo "\tPut online with 'make website'"
+       @echo "\tThe coccinelle SVN repository must be in $(WEBBASE)\n"
 
 package-src:
        $(MAKE) distclean       # Clean project
@@ -82,15 +104,13 @@ package-src:
 package-nopython:
        $(MAKE) distclean       # Clean project
        ./configure --without-python
-       $(MAKE) docs
        $(MAKE) bintar
        $(MAKE) bytecodetar
-       $(MAKE) staticbintar
+#      $(MAKE) staticbintar
 
 package-python:
        $(MAKE) distclean       # Clean project
        ./configure             # Reconfigure project with Python support
-       $(MAKE) docs
        $(MAKE) bintar-python
        $(MAKE) bytecodetar-python
 
@@ -103,7 +123,6 @@ package-python:
 # make clean is there to remove them while not removing the pdf
 # (only distclean remove the pdfs).
 srctar:
-       $(MAKE) distclean
        $(MAKE) docs
        $(MAKE) clean
        cp -a .  $(TMP)/$(PACKAGE)
@@ -112,12 +131,14 @@ srctar:
        rm -rf  $(TMP)/$(PACKAGE)
 
 bintar: all
+       $(MAKE) docs
        rm -f $(TMP)/$(PACKAGE)
        ln -s `pwd` $(TMP)/$(PACKAGE)
        cd $(TMP); tar cvfz $(PACKAGE)-bin-x86.tgz --exclude-vcs $(BINSRC2)
        rm -f $(TMP)/$(PACKAGE)
 
 staticbintar: all.opt
+       $(MAKE) docs
        rm -f $(TMP)/$(PACKAGE)
        ln -s `pwd` $(TMP)/$(PACKAGE)
        $(MAKE) static
@@ -126,6 +147,7 @@ staticbintar: all.opt
 
 # add ocaml version in name ?
 bytecodetar: all
+       $(MAKE) docs
        rm -f $(TMP)/$(PACKAGE)
        ln -s `pwd` $(TMP)/$(PACKAGE)
        $(MAKE) purebytecode
@@ -133,6 +155,7 @@ bytecodetar: all
        rm -f $(TMP)/$(PACKAGE)
 
 bintar-python: all
+       $(MAKE) docs
        rm -f $(TMP)/$(PACKAGE)
        ln -s `pwd` $(TMP)/$(PACKAGE)
        cd $(TMP); tar cvfz $(PACKAGE)-bin-x86-python.tgz --exclude-vcs $(BINSRC2-PY)
@@ -140,6 +163,7 @@ bintar-python: all
 
 # add ocaml version in name ?
 bytecodetar-python: all
+       $(MAKE) docs
        rm -f $(TMP)/$(PACKAGE)
        ln -s `pwd` $(TMP)/$(PACKAGE)
        $(MAKE) purebytecode
@@ -154,7 +178,7 @@ coccicheck:
 clean-packages::
        rm -f $(TMP)/$(PACKAGE).tgz
        rm -f $(TMP)/$(PACKAGE)-bin-x86.tgz
-       rm -f $(TMP)/$(PACKAGE)-bin-x86-static.tgz
+#      rm -f $(TMP)/$(PACKAGE)-bin-x86-static.tgz
        rm -f $(TMP)/$(PACKAGE)-bin-bytecode-$(OCAMLVERSION).tgz
        rm -f $(TMP)/$(PACKAGE)-bin-x86-python.tgz
        rm -f $(TMP)/$(PACKAGE)-bin-bytecode-$(OCAMLVERSION)-python.tgz
@@ -174,10 +198,6 @@ licensify:
 fixdates:
        echo do 'touch **/*.*'
 
-#fixCVS:
-#      cvs update -d -P
-#      echo do 'rm -rf **/CVS'
-
 ocamlversion:
        @echo $(OCAMLVERSION)
 
@@ -202,6 +222,7 @@ ocamlversion:
 EXCL_SYNC=--exclude ".git"          \
        --exclude ".gitignore"      \
        --exclude ".cvsignore"      \
+       --exclude ".svn"            \
        --exclude "tests"           \
        --exclude "TODO"            \
        --cvs-exclude
@@ -209,7 +230,8 @@ EXCL_SYNC=--exclude ".git"          \
 packsrc: prepack
        $(MAKE) -C $(TMP)/$(PACKAGE)/debian lucid
        $(MAKE) -C $(TMP)/$(PACKAGE)/debian karmic
-#      $(MAKE) -C $(TMP)/$(PACKAGE)/debian maverik
+       $(MAKE) -C $(TMP)/$(PACKAGE)/debian maverick
+       $(MAKE) -C $(TMP)/$(PACKAGE)/debian natty
        $(MAKE) push
        rm -rf  $(TMP)/$(PACKAGE)/
 
@@ -221,6 +243,7 @@ packbin: prepack
 prepack:
        rsync -a $(EXCL_SYNC) . $(TMP)/$(PACKAGE)
        $(MAKE) -C $(TMP)/$(PACKAGE) licensify
+       sed -i "s|^OCAMLCFLAGS=.*$$|OCAMLCFLAGS=|" $(TMP)/$(PACKAGE)/Makefile
        rm -rf $(TMP)/$(PACKAGE)/tools
 
 push:
@@ -230,3 +253,11 @@ push:
        rm -rf $(TMP)/$(PRJNAME)_$(VERSION)*.dsc
        rm -rf $(TMP)/$(PRJNAME)_$(VERSION)*.tar.gz
 
+# Produces a source tarball
+# Note: start from a fresh working directory
+# Note: configure first
+dist:
+       $(MAKE) licensify
+       $(MAKE) docs
+       $(MAKE) clean
+       tar cvfz $(PACKAGE).tar.gz --transform="s,^,$(PACKAGE)/,S" --exclude=$(PACKAGE).tar.gz --exclude-backups --exclude-vcs *