Release of coccinelle 1.0.0-rc9
[bpt/coccinelle.git] / Makefile.release
CommitLineData
5636bb2c
C
1
2##############################################################################
3# Release rules to generate website archives
4##############################################################################
5
6PACKAGE=$(PRJNAME)-$(VERSION)
7CCPACKAGE=coccicheck-$(CCVERSION)
8
65038c61 9EXCLUDE=$(PACKAGE)/debian .depend
5636bb2c 10
f3c4ece6
C
11DOC=docs/manual/manual.pdf \
12 docs/manual/options.pdf \
13 docs/manual/main_grammar.pdf \
14 docs/html \
15 docs/man \
16 docs/spatch.1 \
17 docs/manual/cocci-python.txt
5636bb2c 18BINSRC=spatch env.sh env.csh standard.h standard.iso \
f3c4ece6 19 *.txt $(DOC) demos/*
5636bb2c
C
20BINSRC-PY=$(BINSRC) $(PYLIB) python/coccilib/
21
65038c61 22EXCL=$(EXCLUDE:%=--exclude=%)
5636bb2c
C
23BINSRC2=$(BINSRC:%=$(PACKAGE)/%)
24BINSRC2-PY=$(BINSRC-PY:%=$(PACKAGE)/%)
25
26TMP=/tmp
27OCAMLVERSION=$(shell ocaml -version |perl -p -e 's/.*version (.*)/$$1/;')
28
29# Procedure to do first time:
30# cd ~/release
97111a47 31# git clone ... coccinelle
5636bb2c
C
32# cd coccinelle
33#
34# Procedure to do each time:
35#
36# 1) make prerelease # WARN: These will clean your local rep. of pending modifications
37#
38# UPDATE VERSION number in globals/config.ml.in
39# and commit it with
40#
41# 2) make release
42#
43# The project is then automatically licensified.
44#
45# Remember to comment the -g -dtypes in this Makefile
46# You can also remove a few things, for instance I removed in this
47# Makefile things related to popl/ and popl09/
48# make sure that ocaml is the distribution ocaml of /usr/bin, not ~pad/...
49#
50# 3) make package
51#
52# if WEBSITE is set properly, you can also run 'make website'
53# Check that run an ocaml in /usr/bin
54
55# To test you can try compile and run spatch from different instances
56# like my ~/coccinelle, ~/release/coccinelle, and the /tmp/coccinelle-0.X
57# downloaded from the website.
58
59# For 'make srctar' it must done from a clean
60# repo such as ~/release/coccinelle. It must also be a repo where
61# the scripts/licensify has been run at least once.
62# For the 'make bintar' I can do it from my original repo.
63
97111a47
C
64# The 'git rebase' is in there just in case you started with
65# unpushed changes. However, that is probably something you should
66# not do in the first place.
67
5636bb2c 68prerelease:
97111a47 69 git pull --rebase
8babbc8f 70 $(MAKE) fix-expected
5636bb2c
C
71 $(MAKE) distclean
72 sed -i "s|^OCAMLCFLAGS=.*$$|OCAMLCFLAGS=|" Makefile
174d1640
C
73 @echo "\n\tEdit globals/config.ml.in"
74 @echo "\tCommit with 'make release'\n"
5636bb2c 75
8babbc8f
C
76fix-expected:
77 $(MAKE) distclean
78 ./configure --without-python
79 $(MAKE) world
80 yes | ./spatch.opt -testall
81 cp tests/SCORE_actual.sexp tests/SCORE_expected_orig.sexp
82
5636bb2c 83release:
97111a47
C
84 git add globals/config.ml.in
85 git commit -m "Release $(VERSION)"
86 git tag -a -m "Release $(VERSION)" $(VERSION)
87 git push --mirror
5636bb2c 88 $(MAKE) licensify
174d1640 89 @echo "\n\tRun 'make package'\n"
5636bb2c
C
90
91package:
92 $(MAKE) package-src
93 $(MAKE) package-nopython
94 $(MAKE) package-python
785a3008 95 @echo "\tPut online with 'make website'"
97111a47 96 @echo "\tThe coccinelle SVN repository must be in $(WEBBASE)\n"
5636bb2c
C
97
98package-src:
99 $(MAKE) distclean # Clean project
100 $(MAKE) srctar
101 $(MAKE) coccicheck
102
103package-nopython:
104 $(MAKE) distclean # Clean project
105 ./configure --without-python
5636bb2c
C
106 $(MAKE) bintar
107 $(MAKE) bytecodetar
3a314143 108# $(MAKE) staticbintar
5636bb2c
C
109
110package-python:
111 $(MAKE) distclean # Clean project
112 ./configure # Reconfigure project with Python support
5636bb2c
C
113 $(MAKE) bintar-python
114 $(MAKE) bytecodetar-python
115
116
117# I currently pre-generate the parser so the user does not have to
118# install menhir on his machine. We could also do a few cleanups.
119# You may have first to do a 'make licensify'.
120#
121# update: make docs generates pdf but also some ugly .log files, so
122# make clean is there to remove them while not removing the pdf
123# (only distclean remove the pdfs).
124srctar:
174d1640
C
125 $(MAKE) docs
126 $(MAKE) clean
5636bb2c 127 cp -a . $(TMP)/$(PACKAGE)
174d1640 128 cd $(TMP)/$(PACKAGE); cd parsing_cocci/; $(MAKE) parser_cocci_menhir.ml
5636bb2c
C
129 cd $(TMP); tar cvfz $(PACKAGE).tgz --exclude-vcs $(EXCL) $(PACKAGE)
130 rm -rf $(TMP)/$(PACKAGE)
131
5636bb2c 132bintar: all
f3c4ece6 133 $(MAKE) docs
5636bb2c
C
134 rm -f $(TMP)/$(PACKAGE)
135 ln -s `pwd` $(TMP)/$(PACKAGE)
136 cd $(TMP); tar cvfz $(PACKAGE)-bin-x86.tgz --exclude-vcs $(BINSRC2)
137 rm -f $(TMP)/$(PACKAGE)
138
139staticbintar: all.opt
f3c4ece6 140 $(MAKE) docs
5636bb2c
C
141 rm -f $(TMP)/$(PACKAGE)
142 ln -s `pwd` $(TMP)/$(PACKAGE)
174d1640 143 $(MAKE) static
5636bb2c
C
144 cd $(TMP); tar cvfz $(PACKAGE)-bin-x86-static.tgz --exclude-vcs $(BINSRC2)
145 rm -f $(TMP)/$(PACKAGE)
146
147# add ocaml version in name ?
148bytecodetar: all
f3c4ece6 149 $(MAKE) docs
5636bb2c
C
150 rm -f $(TMP)/$(PACKAGE)
151 ln -s `pwd` $(TMP)/$(PACKAGE)
174d1640 152 $(MAKE) purebytecode
5636bb2c
C
153 cd $(TMP); tar cvfz $(PACKAGE)-bin-bytecode-$(OCAMLVERSION).tgz --exclude-vcs $(BINSRC2)
154 rm -f $(TMP)/$(PACKAGE)
155
156bintar-python: all
f3c4ece6 157 $(MAKE) docs
5636bb2c
C
158 rm -f $(TMP)/$(PACKAGE)
159 ln -s `pwd` $(TMP)/$(PACKAGE)
160 cd $(TMP); tar cvfz $(PACKAGE)-bin-x86-python.tgz --exclude-vcs $(BINSRC2-PY)
161 rm -f $(TMP)/$(PACKAGE)
162
163# add ocaml version in name ?
164bytecodetar-python: all
f3c4ece6 165 $(MAKE) docs
5636bb2c
C
166 rm -f $(TMP)/$(PACKAGE)
167 ln -s `pwd` $(TMP)/$(PACKAGE)
174d1640 168 $(MAKE) purebytecode
5636bb2c
C
169 cd $(TMP); tar cvfz $(PACKAGE)-bin-bytecode-$(OCAMLVERSION)-python.tgz --exclude-vcs $(BINSRC2-PY)
170 rm -f $(TMP)/$(PACKAGE)
171
172coccicheck:
173 cp -a `pwd`/scripts/coccicheck $(TMP)/$(CCPACKAGE)
174 tar cvfz $(TMP)/$(CCPACKAGE).tgz -C $(TMP) --exclude-vcs $(CCPACKAGE)
175 rm -rf $(TMP)/$(CCPACKAGE)
176
177clean-packages::
178 rm -f $(TMP)/$(PACKAGE).tgz
179 rm -f $(TMP)/$(PACKAGE)-bin-x86.tgz
3a314143 180# rm -f $(TMP)/$(PACKAGE)-bin-x86-static.tgz
5636bb2c
C
181 rm -f $(TMP)/$(PACKAGE)-bin-bytecode-$(OCAMLVERSION).tgz
182 rm -f $(TMP)/$(PACKAGE)-bin-x86-python.tgz
183 rm -f $(TMP)/$(PACKAGE)-bin-bytecode-$(OCAMLVERSION)-python.tgz
184 rm -f $(TMP)/$(CCPACKAGE).tgz
185
186#
187# No need to licensify 'demos'. Because these is basic building blocks
188# to use SmPL.
189#
190TOLICENSIFY=ctl engine globals parsing_cocci popl popl09 python scripts tools
191licensify:
192 ocaml str.cma tools/licensify.ml
193 set -e; for i in $(TOLICENSIFY); do cd $$i; ocaml str.cma ../tools/licensify.ml; cd ..; done
194
195# When checking out the source from diku sometimes I have some "X in the future"
196# error messages.
197fixdates:
198 echo do 'touch **/*.*'
199
5636bb2c
C
200ocamlversion:
201 @echo $(OCAMLVERSION)
202
203
204##############################################################################
205# Packaging rules -- To build deb packages
206##############################################################################
207#
208# Run 'make packsrc' to build a Deb source package
209#
210# The package is prepared in $(TMP), usually /tmp
211# Once the package has been build, it is uploaded
212# to a PPA on launchpad.
213#
214# You should have a "coccinelle" project configured
215# for dput in your ~/.dput.cf file.
216#
217# The 'packbin' target is to build a deb package
218# locally. It is only for testing purpose.
219#
220
221EXCL_SYNC=--exclude ".git" \
222 --exclude ".gitignore" \
223 --exclude ".cvsignore" \
97111a47 224 --exclude ".svn" \
5636bb2c
C
225 --exclude "tests" \
226 --exclude "TODO" \
227 --cvs-exclude
228
229packsrc: prepack
230 $(MAKE) -C $(TMP)/$(PACKAGE)/debian lucid
231 $(MAKE) -C $(TMP)/$(PACKAGE)/debian karmic
e6509c05 232 $(MAKE) -C $(TMP)/$(PACKAGE)/debian maverick
8babbc8f 233 $(MAKE) -C $(TMP)/$(PACKAGE)/debian natty
5636bb2c
C
234 $(MAKE) push
235 rm -rf $(TMP)/$(PACKAGE)/
236
237packbin: prepack
238 $(MAKE) -C $(TMP)/$(PACKAGE)/debian binary
239 rm -rf $(TMP)/$(PACKAGE)/
aba5c457 240 rm -rf $(TMP)/$(PACKAGE)_$(VERSION)*_source.build
5636bb2c
C
241
242prepack:
243 rsync -a $(EXCL_SYNC) . $(TMP)/$(PACKAGE)
244 $(MAKE) -C $(TMP)/$(PACKAGE) licensify
1eddfd50 245 sed -i "s|^OCAMLCFLAGS=.*$$|OCAMLCFLAGS=|" $(TMP)/$(PACKAGE)/Makefile
5636bb2c
C
246 rm -rf $(TMP)/$(PACKAGE)/tools
247
248push:
aba5c457
C
249 cd $(TMP)/ && for p in `ls $(PRJNAME)_$(VERSION)*_source.changes`; do dput $(PRJNAME) $$p ; done
250 rm -rf $(TMP)/$(PRJNAME)_$(VERSION)*_source.changes
251 rm -rf $(TMP)/$(PRJNAME)_$(VERSION)*_source.$(PRJNAME).upload
252 rm -rf $(TMP)/$(PRJNAME)_$(VERSION)*.dsc
253 rm -rf $(TMP)/$(PRJNAME)_$(VERSION)*.tar.gz
174d1640 254