-# Copyright 2010, INRIA, University of Copenhagen
+# Copyright 2012, INRIA
+# Julia Lawall, Gilles Muller
+# Copyright 2010-2011, 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
# 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
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' )
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' )
extra/extra.cma python/coccipython.cma ocaml/cocciocaml.cma
# Should we use the local version of pycaml
extra/extra.cma python/coccipython.cma ocaml/cocciocaml.cma
# Should we use the local version of pycaml
# Should we use the local version of menhirLib
ifeq ("$(MENHIRDIR)","menhirlib")
# Should we use the local version of menhirLib
ifeq ("$(MENHIRDIR)","menhirlib")
# 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 \
# 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 \
# 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
# 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
-OCAMLC=ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(INCLUDES)
-OCAMLOPT=ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES)
+OCAMLC=ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(LINKFLAGS) $(INCLUDES)
+OCAMLOPT=ocamlopt$(OPTBIN) $(OPTFLAGS) $(LINKFLAGS) $(INCLUDES)
OCAMLLEX=ocamllex #-ml # -ml for debugging lexer, but slightly slower
OCAMLYACC=ocamlyacc -v
OCAMLDEP=ocamldep $(INCLUDEDIRSDEP:%=-I %)
OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDES)
# can also be set via 'make static'
OCAMLLEX=ocamllex #-ml # -ml for debugging lexer, but slightly slower
OCAMLYACC=ocamlyacc -v
OCAMLDEP=ocamldep $(INCLUDEDIRSDEP:%=-I %)
OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDES)
# can also be set via 'make static'
##############################################################################
# Pre-Install (customization of spatch frontend script)
##############################################################################
# Pre-Install (customization of spatch frontend script)
mkdir -p $(DESTDIR)$(LIBDIR)
mkdir -p $(DESTDIR)$(SHAREDIR)/ocaml
mkdir -p $(DESTDIR)$(SHAREDIR)/commons
mkdir -p $(DESTDIR)$(LIBDIR)
mkdir -p $(DESTDIR)$(SHAREDIR)/ocaml
mkdir -p $(DESTDIR)$(SHAREDIR)/commons
$(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) 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-bash:
mkdir -p $(DESTDIR)$(BASH_COMPLETION_DIR)
$(INSTALL_DATA) scripts/spatch.bash_completion \
$(DESTDIR)$(BASH_COMPLETION_DIR)/spatch
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
+
if [ -f pycaml/dllpycaml_stubs.so ]; then \
$(INSTALL_LIB) pycaml/dllpycaml_stubs.so $(DESTDIR)$(LIBDIR) ; fi
if [ -f pycaml/dllpycaml_stubs.so ]; then \
$(INSTALL_LIB) pycaml/dllpycaml_stubs.so $(DESTDIR)$(LIBDIR) ; fi
rm -f $(DESTDIR)$(SHAREDIR)/standard.iso
rm -f $(DESTDIR)$(SHAREDIR)/ocaml/coccilib.cmi
rm -f $(DESTDIR)$(SHAREDIR)/parsing_c/*.cmi
rm -f $(DESTDIR)$(SHAREDIR)/standard.iso
rm -f $(DESTDIR)$(SHAREDIR)/ocaml/coccilib.cmi
rm -f $(DESTDIR)$(SHAREDIR)/parsing_c/*.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
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)
uninstall-bash:
rm -f $(DESTDIR)$(BASH_COMPLETION_DIR)/spatch
rmdir --ignore-fail-on-non-empty -p \
$(DESTDIR)$(BASH_COMPLETION_DIR)
uninstall-bash:
rm -f $(DESTDIR)$(BASH_COMPLETION_DIR)/spatch
rmdir --ignore-fail-on-non-empty -p \
$(DESTDIR)$(BASH_COMPLETION_DIR)
ocamldot -lr /tmp/dependfull.depend > /tmp/dependfull.dot
dot -Tps /tmp/dependfull.dot > /tmp/dependfull.ps
ps2pdf /tmp/dependfull.ps /tmp/dependfull.pdf
ocamldot -lr /tmp/dependfull.depend > /tmp/dependfull.dot
dot -Tps /tmp/dependfull.dot > /tmp/dependfull.ps
ps2pdf /tmp/dependfull.ps /tmp/dependfull.pdf