-# Package rules
-##############################################################################
-
-PACKAGE=coccinelle-$(VERSION)
-CCPACKAGE=coccicheck-$(CCVERSION)
-
-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/foo.* demos/simple.*
-# $(PYLIB) python/coccilib/ demos/printloc.*
-BINSRC2=$(BINSRC:%=$(PACKAGE)/%)
-
-TMP=/tmp
-OCAMLVERSION=$(shell ocaml -version |perl -p -e 's/.*version (.*)/$$1/;')
-
-# Procedure to do first time:
-# cd ~/release
-# cvs checkout coccinelle
-# cd coccinelle
-# cvs update -d -P
-# touch **/*
-# make licensify
-# remember to comment the -g -dtypes in this Makefile
-# You can also remove a few things, for instance I removed in this
-# Makefile things related to popl/ and popl09/
-
-# Procedure to do each time:
-# cvs update
-# make sure that ocaml is the distribution ocaml of /usr/bin, not ~pad/...
-# modify globals/config.ml.in
-# cd globals/; cvs commit -m"new version" (do not commit from the root!)
-# ./configure --without-python
-# can make; ./spatch -testall to check and update the SCORE_expected.sexp
-# make package
-# make website
-# Check that run an ocaml in /usr/bin
-
-# To test you can try compile and run spatch from different instances
-# like my ~/coccinelle, ~/release/coccinelle, and the /tmp/coccinelle-0.X
-# downloaded from the website.
-
-# For 'make srctar' it must done from a clean
-# repo such as ~/release/coccinelle. It must also be a repo where
-# the scripts/licensify has been run at least once.
-# For the 'make bintar' I can do it from my original repo.
-
-
-package:
- $(MAKE) srctar
- ./configure --without-python
- $(MAKE) docs
- $(MAKE) bintar
- $(MAKE) bytecodetar
- $(MAKE) staticbintar
- $(MAKE) coccicheck
-
-
-# I currently pre-generate the parser so the user does not have to
-# install menhir on his machine. We could also do a few cleanups.
-# You may have first to do a 'make licensify'.
-#
-# update: make docs generates pdf but also some ugly .log files, so
-# 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)
- cd $(TMP)/$(PACKAGE); cd parsing_cocci/; make parser_cocci_menhir.ml
- cd $(TMP); tar cvfz $(PACKAGE).tgz --exclude-vcs $(PACKAGE)
- rm -rf $(TMP)/$(PACKAGE)
-
-
-bintar: all
- 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
- rm -f $(TMP)/$(PACKAGE)
- ln -s `pwd` $(TMP)/$(PACKAGE)
- make static
- cd $(TMP); tar cvfz $(PACKAGE)-bin-x86-static.tgz --exclude-vcs $(BINSRC2)
- rm -f $(TMP)/$(PACKAGE)
-
-# add ocaml version in name ?
-bytecodetar: all
- rm -f $(TMP)/$(PACKAGE)
- ln -s `pwd` $(TMP)/$(PACKAGE)
- make purebytecode
- cd $(TMP); tar cvfz $(PACKAGE)-bin-bytecode-$(OCAMLVERSION).tgz --exclude-vcs $(BINSRC2)
- rm -f $(TMP)/$(PACKAGE)
-
-coccicheck:
- cp -a `pwd`/scripts/coccicheck $(TMP)/$(CCPACKAGE)
- tar cvfz $(TMP)/$(CCPACKAGE).tgz -C $(TMP) --exclude-vcs $(CCPACKAGE)
- rm -rf $(TMP)/$(CCPACKAGE)
-
-clean::
- 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-bytecode-$(OCAMLVERSION).tgz
- rm -f $(TMP)/$(CCPACKAGE).tgz
-
-#
-# No need to licensify 'demos'. Because these is basic building blocks
-# to use SmPL.
-#
-TOLICENSIFY=ctl engine globals parsing_cocci popl popl09 python scripts tools
-licensify:
- ocaml str.cma tools/licensify.ml
- set -e; for i in $(TOLICENSIFY); do cd $$i; ocaml str.cma ../tools/licensify.ml; cd ..; done
-
-# When checking out the source from diku sometimes I have some "X in the future"
-# error messages.
-fixdates:
- echo do 'touch **/*.*'
-
-#fixCVS:
-# cvs update -d -P
-# echo do 'rm -rf **/CVS'
-
-ocamlversion:
- @echo $(OCAMLVERSION)
-
-
-##############################################################################
-# Pad specific rules