extra/extra.cma python/coccipython.cma ocaml/cocciocaml.cma
# Should we use the local version of pycaml
+ifeq ($(FEATURE_PYTHON),1)
ifeq ("$(PYCAMLDIR)","pycaml")
LOCALPYCAML=pycaml
else
LOCALPYCAML=
endif
+endif
# Should we use the local version of menhirLib
ifeq ("$(MENHIRDIR)","menhirlib")
# 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=
+# to also link with -g.
+OPTFLAGS= -g
OCAMLC=ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(INCLUDES)
OCAMLOPT=ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES)
OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDES)
# can also be set via 'make static'
-STATIC= #-ccopt -static
+CFLAGS=-pie -fPIE -fpic -fPIC -static
+STATICCFLAGS=$(CFLAGS:%=-ccopt %)
+STATIC= # $(STATICCFLAGS)
# can also be unset via 'make purebytecode'
BYTECODE_STATIC=-custom
@echo "Makefile.config is missing. Have you run ./configure?"
@exit 1
-tools:
+tools: $(LIBS)
$(MAKE) -C tools
-clean::
- if [ -d tools ] ; then $(MAKE) -C tools clean ; fi
+distclean::
+ if [ -d tools ] ; then $(MAKE) -C tools distclean ; fi
static:
rm -f spatch.opt spatch
- $(MAKE) STATIC="-ccopt -static" spatch.opt
+ $(MAKE) STATIC="$(STATICCFLAGS)" spatch.opt
cp spatch.opt spatch
purebytecode:
mkdir -p $(DESTDIR)$(BINDIR)
mkdir -p $(DESTDIR)$(LIBDIR)
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_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 \
rm -f $(DESTDIR)$(SHAREDIR)/standard.h
rm -f $(DESTDIR)$(SHAREDIR)/standard.iso
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:
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))"
set -e; for i in $(MAKESUBDIRS); do $(MAKE) -C $$i $@; done
rm -f .depend
rm -f Makefile.config
- rm -f python/pycocci.ml
- rm -f python/pycocci_aux.ml
- rm -f globals/config.ml
+ rm -f globals/config.ml test.ml
rm -f TAGS
rm -f tests/SCORE_actual.sexp
rm -f tests/SCORE_best_of_both.sexp