Coccinelle release 0.2.5-rc3
[bpt/coccinelle.git] / Makefile
index 712ac56..408708c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,5 @@
+# Copyright 2010, INRIA, University of Copenhagen
+# Julia Lawall, Rene Rydhof Hansen, Gilles Muller, Nicolas Palix
 # Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen
 # Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix
 # This file is part of Coccinelle.
 #############################################################################
 
 -include Makefile.config
+-include /etc/lsb-release
 
 VERSION=$(shell cat globals/config.ml.in |grep version |perl -p -e 's/.*"(.*)".*/$$1/;')
 CCVERSION=$(shell cat scripts/coccicheck/README |grep "Coccicheck version" |perl -p -e 's/.*version (.*)[ ]*/$$1/;')
+PKGVERSION=$(shell dpkg-parsechangelog -ldebian/changelog.$(DISTRIB_CODENAME) 2> /dev/null \
+        | sed -n 's/^Version: \(.*\)/\1/p' )
 
 ##############################################################################
 # Variables
 ##############################################################################
 TARGET=spatch
+PRJNAME=coccinelle
 
 SRC=flag_cocci.ml cocci.ml testing.ml test.ml main.ml
 
 ifeq ($(FEATURE_PYTHON),1)
-PYCMA=pycaml/pycaml.cma
-PYDIR=pycaml
-PYLIB=dllpycaml_stubs.so
+PYCMA=pycaml.cma
 # the following is essential for Coccinelle to compile under gentoo (weird)
-OPTLIBFLAGS=-cclib dllpycaml_stubs.so
+#OPTLIBFLAGS=-cclib dllpycaml_stubs.so
 else
 PYCMA=
-PYDIR=
-PYLIB=
+endif
 OPTLIBFLAGS=
+
+ifeq ("$(SEXPDIR)","ocamlsexp")
+SEXPLIB=sexplib.cmo
+OPTSEXPLIB=sexplib.cmx
+else
+SEXPLIB=sexplib.cma
+OPTSEXPLIB=sexplib.cmxa
+endif
+
+ifeq ("$(DYNLINK)","no")
+DYNLINK=
+else
+DYNLINK=dynlink.cma
 endif
 
 SEXPSYSCMA=bigarray.cma nums.cma
 
-SYSLIBS=str.cma unix.cma $(SEXPSYSCMA)
+SYSLIBS=str.cma unix.cma $(SEXPSYSCMA) $(PYCMA) $(DYNLINK) # threads.cma
 LIBS=commons/commons.cma \
-     ocamlsexp/sexplib1.cma commons/commons_sexp.cma \
+     commons/commons_sexp.cma \
      globals/globals.cma \
      ctl/ctl.cma \
      parsing_cocci/cocci_parser.cma parsing_c/parsing_c.cma \
      engine/cocciengine.cma popl09/popl.cma \
-     extra/extra.cma $(PYCMA) python/coccipython.cma
+     extra/extra.cma python/coccipython.cma ocaml/cocciocaml.cma
+
+# Should we use the local version of pycaml
+ifeq ("$(PYCAMLDIR)","pycaml")
+LOCALPYCAML=pycaml
+else
+LOCALPYCAML=
+endif
+
+# Should we use the local version of menhirLib
+ifeq ("$(MENHIRDIR)","menhirlib")
+LOCALMENHIR=menhirlib
+else
+LOCALMENHIR=
+endif
+
+# Should we use the local version of ocamlsexp
+ifeq ("$(SEXPDIR)","ocamlsexp")
+LOCALSEXP=ocamlsexp
+else
+LOCALSEXP=
+endif
+
+# used for depend: and a little for rec & rec.opt
+MAKESUBDIRS=$(LOCALPYCAML) $(LOCALSEXP) commons \
+ globals $(LOCALMENHIR) ctl parsing_cocci parsing_c \
+ engine popl09 extra python ocaml
+
+# used for clean:
+# It is like MAKESUBDIRS but also
+# force cleaning of local library copies
+CLEANSUBDIRS=pycaml ocamlsexp commons \
+ globals menhirlib ctl parsing_cocci parsing_c \
+ engine popl09 extra python ocaml
+
+INCLUDEDIRSDEP=commons commons/ocamlextra $(LOCALSEXP) \
+ globals $(LOCALMENHIR) $(LOCALPYCAML) ctl \
+ parsing_cocci parsing_c engine popl09 extra python ocaml
 
-#used for clean: and depend: and a little for rec & rec.opt
-MAKESUBDIRS=commons ocamlsexp \
- globals menhirlib $(PYDIR) ctl parsing_cocci parsing_c \
- engine popl09 extra python
-INCLUDEDIRS=commons commons/ocamlextra ocamlsexp \
- globals menhirlib $(PYDIR) ctl \
- parsing_cocci parsing_c engine popl09 extra python
+INCLUDEDIRS=$(INCLUDEDIRSDEP) $(SEXPDIR) $(MENHIRDIR) $(PYCAMLDIR)
 
 ##############################################################################
 # Generic variables
@@ -82,24 +129,20 @@ EXEC=$(TARGET)
 # Generic ocaml variables
 ##############################################################################
 
-OCAMLCFLAGS= -g -dtypes # -w A
+OCAMLCFLAGS=
 
 # for profiling add  -p -inline 0
 # but 'make forprofiling' below does that for you.
 # This flag is also used in subdirectories so don't change its name here.
 # To enable backtrace support for native code, you need to put -g in OPTFLAGS
-# to also link with -g, but even in 3.11 the backtrace support seems buggy so
-# not worth it.
-OPTFLAGS=
-# the following is essential for Coccinelle to compile under gentoo
-# but is now defined above in this file
-#OPTLIBFLAGS=-cclib dllpycaml_stubs.so
+# to also link with -g.
+OPTFLAGS= -g
 
 OCAMLC=ocamlc$(OPTBIN) $(OCAMLCFLAGS)  $(INCLUDES)
 OCAMLOPT=ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES)
 OCAMLLEX=ocamllex #-ml # -ml for debugging lexer, but slightly slower
 OCAMLYACC=ocamlyacc -v
-OCAMLDEP=ocamldep $(INCLUDES)
+OCAMLDEP=ocamldep $(INCLUDEDIRSDEP:%=-I %)
 OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDES)
 
 # can also be set via 'make static'
@@ -134,22 +177,18 @@ opt-compil: .depend
 top: $(EXEC).top
 
 subdirs:
-       $(MAKE) -C commons OCAMLCFLAGS="$(OCAMLCFLAGS)"
-       $(MAKE) -C ocamlsexp OCAMLCFLAGS="$(OCAMLCFLAGS)"
-       $(MAKE) -C commons sexp OCAMLCFLAGS="$(OCAMLCFLAGS)"
        +for D in $(MAKESUBDIRS); do $(MAKE) $$D || exit 1 ; done
+       $(MAKE) -C commons sexp OCAMLCFLAGS="$(OCAMLCFLAGS)"
 
 subdirs.opt:
-       $(MAKE) -C commons all.opt OCAMLCFLAGS="$(OCAMLCFLAGS)"
-       $(MAKE) -C ocamlsexp all.opt OCAMLCFLAGS="$(OCAMLCFLAGS)"
-       $(MAKE) -C commons sexp.opt OCAMLCFLAGS="$(OCAMLCFLAGS)"
        +for D in $(MAKESUBDIRS); do $(MAKE) $$D.opt || exit 1 ; done
+       $(MAKE) -C commons sexp.opt OPTFLAGS="$(OPTFLAGS)"
 
 $(MAKESUBDIRS):
        $(MAKE) -C $@ OCAMLCFLAGS="$(OCAMLCFLAGS)" all
 
 $(MAKESUBDIRS:%=%.opt):
-       $(MAKE) -C $(@:%.opt=%) OCAMLCFLAGS="$(OCAMLCFLAGS)" all.opt
+       $(MAKE) -C $(@:%.opt=%) OPTFLAGS="$(OPTFLAGS)" all.opt
 
 #dependencies:
 # commons:
@@ -165,7 +204,8 @@ $(MAKESUBDIRS:%=%.opt):
 # python:pycaml parsing_cocci parsing_c
 
 clean::
-       set -e; for i in $(MAKESUBDIRS); do $(MAKE) -C $$i $@; done
+       set -e; for i in $(CLEANSUBDIRS); do $(MAKE) -C $$i $@; done
+       $(MAKE) -C demos/spp $@
 
 $(LIBS): $(MAKESUBDIRS)
 $(LIBS:.cma=.cmxa): $(MAKESUBDIRS:%=%.opt)
@@ -174,35 +214,31 @@ $(OBJS):$(LIBS)
 $(OPTOBJS):$(LIBS:.cma=.cmxa)
 
 $(EXEC): $(LIBS) $(OBJS)
-       $(OCAMLC) $(BYTECODE_STATIC) -o $@ $(SYSLIBS)  $^
+       $(OCAMLC) $(BYTECODE_STATIC) -o $@ $(SYSLIBS) $(SEXPLIB) $^
 
 $(EXEC).opt: $(LIBS:.cma=.cmxa) $(OPTOBJS)
-       $(OCAMLOPT) $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) $(OPTLIBFLAGS)  $^
+       $(OCAMLOPT) $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) $(OPTSEXPLIB) $(OPTLIBFLAGS)  $^
 
 $(EXEC).top: $(LIBS) $(OBJS)
-       $(OCAMLMKTOP) -custom -o $@ $(SYSLIBS) $^
+       $(OCAMLMKTOP) -custom -o $@ $(SYSLIBS) $(SEXPLIB) $^
 
 clean::
        rm -f $(TARGET) $(TARGET).opt $(TARGET).top
 
-clean::
-       rm -f dllpycaml_stubs.so
-
-
 .PHONY:: tools configure
 
 configure:
        ./configure
 
-Makefile.config:    
+Makefile.config:
        @echo "Makefile.config is missing. Have you run ./configure?"
        @exit 1
 
-tools:
+tools: $(LIBS)
        $(MAKE) -C tools
 
-clean::
-       $(MAKE) -C tools clean
+distclean::
+       if [ -d tools ] ; then $(MAKE) -C tools distclean ; fi
 
 static:
        rm -f spatch.opt spatch
@@ -233,17 +269,20 @@ distclean::
 # Pre-Install (customization of spatch frontend script)
 ##############################################################################
 
-preinstall: scripts/spatch scripts/spatch.opt scripts/spatch.byte
+preinstall: docs/spatch.1 scripts/spatch scripts/spatch.opt scripts/spatch.byte
+
+docs/spatch.1: Makefile.config
+       $(MAKE) -C docs spatch.1
 
 # user will use spatch to run spatch.opt (native)
-scripts/spatch:
+scripts/spatch: Makefile.config
        cp scripts/spatch.sh scripts/spatch.tmp2
        sed "s|SHAREDIR|$(SHAREDIR)|g" scripts/spatch.tmp2 > scripts/spatch.tmp
        sed "s|LIBDIR|$(LIBDIR)|g" scripts/spatch.tmp > scripts/spatch
        rm -f scripts/spatch.tmp2 scripts/spatch.tmp
 
 # user will use spatch to run spatch (bytecode)
-scripts/spatch.byte:
+scripts/spatch.byte: Makefile.config
        cp scripts/spatch.sh scripts/spatch.byte.tmp3
        sed "s|\.opt||" scripts/spatch.byte.tmp3 > scripts/spatch.byte.tmp2
        sed "s|SHAREDIR|$(SHAREDIR)|g" scripts/spatch.byte.tmp2 \
@@ -255,7 +294,7 @@ scripts/spatch.byte:
                scripts/spatch.byte.tmp
 
 # user will use spatch.opt to run spatch.opt (native)
-scripts/spatch.opt:
+scripts/spatch.opt: Makefile.config
        cp scripts/spatch.sh scripts/spatch.opt.tmp2
        sed "s|SHAREDIR|$(SHAREDIR)|g" scripts/spatch.opt.tmp2 \
                > scripts/spatch.opt.tmp
@@ -275,13 +314,32 @@ clean::
 install-common:
        mkdir -p $(DESTDIR)$(BINDIR)
        mkdir -p $(DESTDIR)$(LIBDIR)
-       mkdir -p $(DESTDIR)$(SHAREDIR)
+       mkdir -p $(DESTDIR)$(SHAREDIR)/ocaml
+       mkdir -p $(DESTDIR)$(SHAREDIR)/commons
+       mkdir -p $(DESTDIR)$(SHAREDIR)/globals
+       mkdir -p $(DESTDIR)$(SHAREDIR)/parsing_c
        mkdir -p $(DESTDIR)$(MANDIR)/man1
        $(INSTALL_DATA) standard.h $(DESTDIR)$(SHAREDIR)
        $(INSTALL_DATA) standard.iso $(DESTDIR)$(SHAREDIR)
+       $(INSTALL_DATA) ocaml/coccilib.cmi $(DESTDIR)$(SHAREDIR)/ocaml/
+       $(INSTALL_DATA) parsing_c/*.cmi $(DESTDIR)$(SHAREDIR)/parsing_c/
+       $(INSTALL_DATA) commons/*.cmi $(DESTDIR)$(SHAREDIR)/commons/
+       $(INSTALL_DATA) globals/iteration.cmi $(DESTDIR)$(SHAREDIR)/globals/
        $(INSTALL_DATA) docs/spatch.1 $(DESTDIR)$(MANDIR)/man1/
        @if [ $(FEATURE_PYTHON) -eq 1 ]; then $(MAKE) install-python; fi
 
+install-bash:
+       mkdir -p $(DESTDIR)$(BASH_COMPLETION_DIR)
+       $(INSTALL_DATA) scripts/spatch.bash_completion \
+               $(DESTDIR)$(BASH_COMPLETION_DIR)/spatch
+
+install-tools:
+       mkdir -p $(DESTDIR)$(BINDIR)
+       $(INSTALL_PROGRAM) tools/splitpatch \
+               $(DESTDIR)$(BINDIR)/splitpatch
+       $(INSTALL_PROGRAM) tools/cocci-send-email.perl \
+               $(DESTDIR)$(BINDIR)/cocci-send-email.perl
+
 install-python:
        mkdir -p $(DESTDIR)$(SHAREDIR)/python/coccilib/coccigui
        $(INSTALL_DATA) python/coccilib/*.py \
@@ -292,7 +350,8 @@ install-python:
                $(DESTDIR)$(SHAREDIR)/python/coccilib/coccigui
        $(INSTALL_DATA) python/coccilib/coccigui/pygui.gladep \
                $(DESTDIR)$(SHAREDIR)/python/coccilib/coccigui
-       $(INSTALL_LIB) dllpycaml_stubs.so $(DESTDIR)$(LIBDIR)
+       if [ -f pycaml/dllpycaml_stubs.so ]; then \
+               $(INSTALL_LIB) pycaml/dllpycaml_stubs.so $(DESTDIR)$(LIBDIR) ; fi
 
 install: install-common
        @if test -x spatch -a ! -x spatch.opt ; then \
@@ -328,195 +387,52 @@ uninstall:
        rm -f $(DESTDIR)$(BINDIR)/spatch
        rm -f $(DESTDIR)$(BINDIR)/spatch.opt
        rm -f $(DESTDIR)$(LIBDIR)/dllpycaml_stubs.so
+       rm -f $(DESTDIR)$(SHAREDIR)/spatch
+       rm -f $(DESTDIR)$(SHAREDIR)/spatch.opt
        rm -f $(DESTDIR)$(SHAREDIR)/standard.h
        rm -f $(DESTDIR)$(SHAREDIR)/standard.iso
-       rm -rf $(DESTDIR)$(SHAREDIR)/python/coccilib
+       rm -f $(DESTDIR)$(SHAREDIR)/ocaml/coccilib.cmi
+       rm -f $(DESTDIR)$(SHAREDIR)/parsing_c/*.cmi
+       rm -f $(DESTDIR)$(SHAREDIR)/commons/*.cmi
+       rm -f $(DESTDIR)$(SHAREDIR)/globals/*.cmi
+       rm -f $(DESTDIR)$(SHAREDIR)/python/coccilib/coccigui/*
+       rm -f $(DESTDIR)$(SHAREDIR)/python/coccilib/*.py
+       rmdir --ignore-fail-on-non-empty -p \
+               $(DESTDIR)$(SHAREDIR)/python/coccilib/coccigui
+       rmdir $(DESTDIR)$(SHAREDIR)/globals
+       rmdir $(DESTDIR)$(SHAREDIR)/commons
+       rmdir $(DESTDIR)$(SHAREDIR)/parsing_c
+       rmdir $(DESTDIR)$(SHAREDIR)/ocaml
+       rmdir $(DESTDIR)$(SHAREDIR)
        rm -f $(DESTDIR)$(MANDIR)/man1/spatch.1
 
+uninstall-bash:
+       rm -f $(DESTDIR)$(BASH_COMPLETION_DIR)/spatch
+       rmdir --ignore-fail-on-non-empty -p \
+               $(DESTDIR)$(BASH_COMPLETION_DIR)
+
+uninstall-tools:
+       rm -f $(DESTDIR)$(BINDIR)/splitpatch
+       rm -f $(DESTDIR)$(BINDIR)/cocci-send-email.perl
+
 version:
        @echo "spatch     $(VERSION)"
+       @echo "spatch     $(PKGVERSION) ($(DISTRIB_ID))"
        @echo "coccicheck $(CCVERSION)"
 
 
 ##############################################################################
-# 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
+# Deb package (for Ubuntu) and release rules
 ##############################################################################
 
-#TOP=/home/pad/mobile/project-coccinelle
-WEBSITE=/home/pad/mobile/homepage/software/project-coccinelle
-
-website:
-       cp $(TMP)/$(PACKAGE).tgz                $(WEBSITE)
-       cp $(TMP)/$(PACKAGE)-bin-x86.tgz        $(WEBSITE)
-       cp $(TMP)/$(PACKAGE)-bin-x86-static.tgz $(WEBSITE)
-       cp $(TMP)/$(PACKAGE)-bin-bytecode-$(OCAMLVERSION).tgz   $(WEBSITE)
-       rm -f $(WEBSITE)/LATEST* $(WEBSITE)/coccinelle-latest.tgz
-       cp changes.txt $(WEBSITE)/changes-$(VERSION).txt
-       cd $(WEBSITE); touch LATEST_IS_$(VERSION); ln -s $(PACKAGE).tgz coccinelle-latest.tgz
-       cp readme.txt $(WEBSITE)
-
-
-#TXT=$(wildcard *.txt)
-syncwiki:
-#      unison ~/public_html/wiki/wiki-LFS/data/pages/ docs/wiki/
-#      set -e; for i in $(TXT); do unison $$i docs/wiki/$$i; done
-
-darcsweb:
-#      @echo pull from ~/public_html/darcs/c-coccinelle and c-commons and lib-xxx
-
-DARCSFORESTS=commons ocamlsexp \
- parsing_c parsing_cocci engine
-
-update_darcs:
-       darcs pull
-       set -e; for i in $(DARCSFORESTS); do cd $$i; darcs pull; cd ..; done
-
-#darcs diff -u
-diff_darcs:
-       set -e; for i in $(DARCSFORESTS); do cd $$i; darcs diff -u; cd ..; done
-
-##############################################################################
-# Git Developer rules
-##############################################################################
-gitupdate:
-       git cvsimport -d :ext:topps:/var/cvs/cocci  coccinelle
+include Makefile.release
 
 ##############################################################################
 # Developer rules
 ##############################################################################
 
+-include Makefile.dev
+
 test: $(TARGET)
        ./$(TARGET) -testall
 
@@ -589,9 +505,6 @@ distclean:: clean
        set -e; for i in $(MAKESUBDIRS); do $(MAKE) -C $$i $@; done
        rm -f .depend
        rm -f Makefile.config
-       rm -f python/coccilib/output.py
-       rm -f python/pycocci.ml
-       rm -f python/pycocci_aux.ml
        rm -f globals/config.ml
        rm -f TAGS
        rm -f tests/SCORE_actual.sexp