17
17
docs/manual/cocci-python.txt
18
BINSRC=spatch env.sh env.csh standard.h standard.iso \
18
BINSRC=spatch* env.sh env.csh standard.h standard.iso \
19
*.txt $(DOC) demos/* scripts/spatch*
20
20
BINSRC-PY=$(BINSRC) $(PYLIB) python/coccilib/
22
22
EXCL=$(EXCLUDE:%=--exclude=%)
23
23
BINSRC2=$(BINSRC:%=$(PACKAGE)/%)
24
24
BINSRC2-PY=$(BINSRC-PY:%=$(PACKAGE)/%)
26
# TMP should point to a folder that is private to the release
27
# process. In addition, it should not be the direct parent of
28
# the directory in which the release is performed, because it
29
# creates temporary directories that in this case could have
30
# a name clash with the current directory.
30
35
# should be defined by Makefile.config
64
69
# unpushed changes. However, that is probably something you should
65
70
# not do in the first place.
67
prerelease: Makefile.config
73
@echo "To make a release, perform the following steps:"
75
@echo "1. Make sure that all changes are committed and pushed."
76
@echo " (making a release will destroy any uncommitted changes)"
77
@echo " Preferably, start from a fresh clone of the coccinelle repo."
78
@echo "2. Run 'make prerelease'. It will generate some files that are not"
79
@echo " in the repository but part of the release tarballs."
80
@echo "3. Edit ./version. It must be a new version."
81
@echo "4. Run 'make release'. It makes changes to the git repository that"
82
@echo " are not idempotent. Running this step again is likely to result"
83
@echo " in some git errors. These are not dramatic and are therefore"
85
@echo "5. Run 'make package'. It will build many tarballs."
86
@echo "6. Run 'make website'. Make sure that $(WEBBASE) exists beforehand."
87
@echo " Hint: run step 5 and 6 directly after each other. The tarballs"
88
@echo " are stored temporarily in $(TMP)."
89
@echo "7. Updated some webpages and commit them to svn."
68
92
@echo "pulling changes from the repository"
69
93
$(GIT) pull --rebase
70
94
$(MAKE) fix-expected
71
95
$(MAKE) distclean KEEP_CONFIG=1
72
96
@echo "\n\tEdit ./version"
73
97
@echo "\tCommit with 'make release'\n"
74
@echo "\tYou can skip the actual commit using 'GIT=echo make release'"
98
@echo "\t* set the GIT env variable to 'echo' to skip performing any git commands"
99
@echo "\t* changes to files other than ./version will not be committed automatically."
77
102
@echo "going to generate: tests/SCORE_expected_orig.sexp"
79
./configure --disable-python
104
./configure --enable-release --disable-python
81
106
yes | ./spatch.opt -testall --iso-file ./standard.iso --macro-file-builtins ./standard.h
82
107
cp tests/SCORE_actual.sexp tests/SCORE_expected_orig.sexp
86
111
@echo "Marking version: $(VERSION)"
87
112
echo -n "$(VERSION)" > ./version
88
113
$(GIT) add ./version
89
$(GIT) commit -m "Release $(VERSION)"
90
$(GIT) tag -a -m "Release $(VERSION)" $(VERSION)
114
-$(GIT) commit -m "Release $(VERSION)"
115
-$(GIT) tag -a -m "Release $(VERSION)" $(VERSION)
91
116
$(GIT) push --mirror
93
118
@echo "\n\tLicensify has run: do not commit any files from now on!"
106
131
$(MAKE) coccicheck
133
# Reconfigures the project without Python support
134
# Note: we disable pcre syntax as well to eliminate the dependency
135
# on those libraries.
108
136
package-nopython:
109
$(MAKE) distclean # Clean project
110
./configure --disable-python # Reconfigure project without Python support
138
./configure --enable-release --disable-python --disable-pcre-syntax --disable-menhirLib --disable-sexplib --disable-extlib --disable-pycaml
112
140
$(MAKE) bytecodetar
113
# $(MAKE) staticbintar
142
# Reconfigure project with Python support
143
# Note: we disable pcre syntax as well to eliminate the dependency
144
# on those libraries.
116
$(MAKE) distclean # Clean project
117
./configure --enable-python # Reconfigure project with Python support
147
./configure --enable-release --enable-python --disable-pcre-syntax --disable-menhirLib --disable-sexplib --disable-extlib --disable-pycaml
118
148
$(MAKE) bintar-python
119
149
$(MAKE) bytecodetar-python
134
164
if test -f "$(TMP)/$(PACKAGE)/"; then rm -f "$(TMP)/$(PACKAGE)/"; fi # remove it if it is a symlink
135
165
$(MKDIR_P) "$(TMP)/$(PACKAGE)/"
136
166
cp -rfa ./* "$(TMP)/$(PACKAGE)/"
137
cd $(TMP)/$(PACKAGE); cd parsing_cocci/; $(MAKE) parser_cocci_menhir.ml
167
cd $(TMP)/$(PACKAGE); $(MAKE) -C parsing_cocci parser_cocci_menhir.ml
138
168
rm -f $(TMP)/$(PACKAGE)/Makefile.config
139
169
cd $(TMP); tar cvfz $(PACKAGE).tgz --exclude-vcs $(EXCL) $(PACKAGE)
140
170
rm -rf $(TMP)/$(PACKAGE)
144
174
rm -f $(TMP)/$(PACKAGE)
145
175
ln -s `pwd` $(TMP)/$(PACKAGE)
176
@if test -n "${PATCHELF}" -a -f spatch; then \
177
$(PATCHELF) --set-interpreter "/lib/ld-linux.so.2" --set-rpath "" spatch; fi
178
@if test -n "${PATCHELF}" -a -f spatch.opt; then \
179
$(PATCHELF) --set-interpreter "/lib/ld-linux.so.2" --set-rpath "" spatch.opt; fi
146
180
cd $(TMP); tar cvfz $(PACKAGE)-bin-x86.tgz --exclude-vcs $(BINSRC2)
147
181
rm -f $(TMP)/$(PACKAGE)
154
188
cd $(TMP); tar cvfz $(PACKAGE)-bin-x86-static.tgz --exclude-vcs $(BINSRC2)
155
189
rm -f $(TMP)/$(PACKAGE)
157
# add ocaml version in name ?
158
191
bytecodetar: all-dev
160
193
rm -f $(TMP)/$(PACKAGE)
161
194
ln -s `pwd` $(TMP)/$(PACKAGE)
162
195
$(MAKE) purebytecode
163
cd $(TMP); tar cvfz $(PACKAGE)-bin-bytecode-$(OCAMLVERSION).tgz --exclude-vcs $(BINSRC2)
197
@if test -n "${PATCHELF}" -a -f dllpycaml_stubs.so; then \
198
$(PATCHELF) --set-rpath "" dllpycaml_stubs.so; fi
199
@if test -n "${PATHCELF}" -a -f dllpcre_stubs.so; then \
200
$(PATCHELF) --set-rpath "" dllpcre_stubs.so; fi
201
cd $(TMP); tar cvfz $(PACKAGE)-bin-bytecode-$(OCAMLVERSION).tgz --exclude-vcs $(BINSRC2) $$(find -L $(PACKAGE) -maxdepth 1 -name 'dll*.so')
164
202
rm -f $(TMP)/$(PACKAGE)
203
rm -f dllpycaml_stubs.so dllpcre_stubs.so
166
205
bintar-python: all
207
@if test -n "${PATCHELF}" -a -f spatch; then \
208
$(PATCHELF) --set-interpreter "/lib/ld-linux.so.2" --set-rpath "" spatch; fi
209
@if test -n "${PATCHELF}" -a -f spatch.opt; then \
210
$(PATCHELF) --set-interpreter "/lib/ld-linux.so.2" --set-rpath "" spatch.opt; fi
168
211
rm -f $(TMP)/$(PACKAGE)
169
212
ln -s `pwd` $(TMP)/$(PACKAGE)
170
213
cd $(TMP); tar cvfz $(PACKAGE)-bin-x86-python.tgz --exclude-vcs $(BINSRC2-PY)
171
214
rm -f $(TMP)/$(PACKAGE)
173
# add ocaml version in name ?
174
216
bytecodetar-python: all-dev
176
218
rm -f $(TMP)/$(PACKAGE)
177
219
ln -s `pwd` $(TMP)/$(PACKAGE)
178
220
$(MAKE) purebytecode
179
cd $(TMP); tar cvfz $(PACKAGE)-bin-bytecode-$(OCAMLVERSION)-python.tgz --exclude-vcs $(BINSRC2-PY)
222
@if test -n "${PATCHELF}" -a -f dllpycaml_stubs.so; then \
223
$(PATCHELF) --set-rpath "" dllpycaml_stubs.so; fi
224
@if test -n "${PATHCELF}" -a -f dllpcre_stubs.so; then \
225
$(PATCHELF) --set-rpath "" dllpcre_stubs.so; fi
226
cd $(TMP); tar cvfz $(PACKAGE)-bin-bytecode-$(OCAMLVERSION)-python.tgz --exclude-vcs $(BINSRC2-PY) $$(find -L $(PACKAGE) -maxdepth 1 -name 'dll*.so')
180
227
rm -f $(TMP)/$(PACKAGE)
228
rm -f dllpycaml_stubs.so dllpcre_stubs.so
183
231
cp -a ./scripts/coccicheck $(TMP)/$(CCPACKAGE)
188
236
rm -f $(TMP)/$(PACKAGE).tgz
189
237
rm -f $(TMP)/$(PACKAGE)-bin-x86.tgz
190
# rm -f $(TMP)/$(PACKAGE)-bin-x86-static.tgz
191
238
rm -f $(TMP)/$(PACKAGE)-bin-bytecode-$(OCAMLVERSION).tgz
192
239
rm -f $(TMP)/$(PACKAGE)-bin-x86-python.tgz
193
240
rm -f $(TMP)/$(PACKAGE)-bin-bytecode-$(OCAMLVERSION)-python.tgz
194
241
rm -f $(TMP)/$(CCPACKAGE).tgz
197
# No need to licensify 'demos'. Because these is basic building blocks
244
# No need to licensify 'demos'. Because these are basic building blocks
200
247
TOLICENSIFY=ctl engine globals parsing_cocci popl popl09 python scripts tools
268
315
# Note: configure first
270
317
$(MAKE) licensify
318
$(MAKE) distclean KEEP_CONFIG=1
320
$(MAKE) -C parsing_cocci parser_cocci_menhir.ml
273
322
tar cvfz $(PACKAGE).tar.gz --transform="s,^,$(PACKAGE)/,S" --exclude=$(PACKAGE).tar.gz --exclude-backups --exclude-vcs *