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