Release of coccinelle 1.0.0-rc9
[bpt/coccinelle.git] / Makefile.release
1
2 ##############################################################################
3 # Release rules to generate website archives
4 ##############################################################################
5
6 PACKAGE=$(PRJNAME)-$(VERSION)
7 CCPACKAGE=coccicheck-$(CCVERSION)
8
9 EXCLUDE=$(PACKAGE)/debian .depend
10
11 DOC=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
18 BINSRC=spatch env.sh env.csh standard.h standard.iso \
19 *.txt $(DOC) demos/*
20 BINSRC-PY=$(BINSRC) $(PYLIB) python/coccilib/
21
22 EXCL=$(EXCLUDE:%=--exclude=%)
23 BINSRC2=$(BINSRC:%=$(PACKAGE)/%)
24 BINSRC2-PY=$(BINSRC-PY:%=$(PACKAGE)/%)
25
26 TMP=/tmp
27 OCAMLVERSION=$(shell ocaml -version |perl -p -e 's/.*version (.*)/$$1/;')
28
29 # Procedure to do first time:
30 # cd ~/release
31 # git clone ... coccinelle
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
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
68 prerelease:
69 git pull --rebase
70 $(MAKE) fix-expected
71 $(MAKE) distclean
72 sed -i "s|^OCAMLCFLAGS=.*$$|OCAMLCFLAGS=|" Makefile
73 @echo "\n\tEdit globals/config.ml.in"
74 @echo "\tCommit with 'make release'\n"
75
76 fix-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
83 release:
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
88 $(MAKE) licensify
89 @echo "\n\tRun 'make package'\n"
90
91 package:
92 $(MAKE) package-src
93 $(MAKE) package-nopython
94 $(MAKE) package-python
95 @echo "\tPut online with 'make website'"
96 @echo "\tThe coccinelle SVN repository must be in $(WEBBASE)\n"
97
98 package-src:
99 $(MAKE) distclean # Clean project
100 $(MAKE) srctar
101 $(MAKE) coccicheck
102
103 package-nopython:
104 $(MAKE) distclean # Clean project
105 ./configure --without-python
106 $(MAKE) bintar
107 $(MAKE) bytecodetar
108 # $(MAKE) staticbintar
109
110 package-python:
111 $(MAKE) distclean # Clean project
112 ./configure # Reconfigure project with Python support
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).
124 srctar:
125 $(MAKE) docs
126 $(MAKE) clean
127 cp -a . $(TMP)/$(PACKAGE)
128 cd $(TMP)/$(PACKAGE); cd parsing_cocci/; $(MAKE) parser_cocci_menhir.ml
129 cd $(TMP); tar cvfz $(PACKAGE).tgz --exclude-vcs $(EXCL) $(PACKAGE)
130 rm -rf $(TMP)/$(PACKAGE)
131
132 bintar: all
133 $(MAKE) docs
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
139 staticbintar: all.opt
140 $(MAKE) docs
141 rm -f $(TMP)/$(PACKAGE)
142 ln -s `pwd` $(TMP)/$(PACKAGE)
143 $(MAKE) static
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 ?
148 bytecodetar: all
149 $(MAKE) docs
150 rm -f $(TMP)/$(PACKAGE)
151 ln -s `pwd` $(TMP)/$(PACKAGE)
152 $(MAKE) purebytecode
153 cd $(TMP); tar cvfz $(PACKAGE)-bin-bytecode-$(OCAMLVERSION).tgz --exclude-vcs $(BINSRC2)
154 rm -f $(TMP)/$(PACKAGE)
155
156 bintar-python: all
157 $(MAKE) docs
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 ?
164 bytecodetar-python: all
165 $(MAKE) docs
166 rm -f $(TMP)/$(PACKAGE)
167 ln -s `pwd` $(TMP)/$(PACKAGE)
168 $(MAKE) purebytecode
169 cd $(TMP); tar cvfz $(PACKAGE)-bin-bytecode-$(OCAMLVERSION)-python.tgz --exclude-vcs $(BINSRC2-PY)
170 rm -f $(TMP)/$(PACKAGE)
171
172 coccicheck:
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
177 clean-packages::
178 rm -f $(TMP)/$(PACKAGE).tgz
179 rm -f $(TMP)/$(PACKAGE)-bin-x86.tgz
180 # rm -f $(TMP)/$(PACKAGE)-bin-x86-static.tgz
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 #
190 TOLICENSIFY=ctl engine globals parsing_cocci popl popl09 python scripts tools
191 licensify:
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.
197 fixdates:
198 echo do 'touch **/*.*'
199
200 ocamlversion:
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
221 EXCL_SYNC=--exclude ".git" \
222 --exclude ".gitignore" \
223 --exclude ".cvsignore" \
224 --exclude ".svn" \
225 --exclude "tests" \
226 --exclude "TODO" \
227 --cvs-exclude
228
229 packsrc: prepack
230 $(MAKE) -C $(TMP)/$(PACKAGE)/debian lucid
231 $(MAKE) -C $(TMP)/$(PACKAGE)/debian karmic
232 $(MAKE) -C $(TMP)/$(PACKAGE)/debian maverick
233 $(MAKE) -C $(TMP)/$(PACKAGE)/debian natty
234 $(MAKE) push
235 rm -rf $(TMP)/$(PACKAGE)/
236
237 packbin: prepack
238 $(MAKE) -C $(TMP)/$(PACKAGE)/debian binary
239 rm -rf $(TMP)/$(PACKAGE)/
240 rm -rf $(TMP)/$(PACKAGE)_$(VERSION)*_source.build
241
242 prepack:
243 rsync -a $(EXCL_SYNC) . $(TMP)/$(PACKAGE)
244 $(MAKE) -C $(TMP)/$(PACKAGE) licensify
245 sed -i "s|^OCAMLCFLAGS=.*$$|OCAMLCFLAGS=|" $(TMP)/$(PACKAGE)/Makefile
246 rm -rf $(TMP)/$(PACKAGE)/tools
247
248 push:
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
254