- Try to do better pretty printing when array elements are individually
[bpt/coccinelle.git] / commons / Makefile
index f4654f8..0ad2077 100644 (file)
@@ -28,7 +28,6 @@ MYSRC=        commands.ml                              \
        oarray.ml                                \
        ocollection/ograph2way.ml                \
        ograph_simple.ml ograph_extended.ml      \
-       ofullcommon.ml                           \
        glimpse.ml parser_combinators.ml
 
 # src from other authors, got from the web or caml hump
@@ -76,10 +75,6 @@ MYMPISRC=distribution.ml
 MPIINCLUDES=-I ../ocamlmpi -I ../../ocamlmpi -I +ocamlmpi
 MPISYSLIBS=mpi.cma
 
-#sexplib
-MYSEXPSRC=sexp_common.ml
-SEXPINCLUDES=-I $(SEXPDIR)
-
 #binprot
 MYBINSRC=bin_common.ml
 BININCLUDES=-I ../ocamltarzan/lib-binprot -I ../../ocamltarzan/lib-binprot
@@ -90,7 +85,7 @@ BININCLUDES=-I ../ocamltarzan/lib-binprot -I ../../ocamltarzan/lib-binprot
 
 #backtrace
 MYBACKTRACESRC=backtrace.ml
-BACKTRACEINCLUDES=-I $(shell ocamlc -where)
+BACKTRACEINCLUDES=-I $(shell $(OCAMLC) -where)
 
 
 ##############################################################################
@@ -105,8 +100,8 @@ INCLUDES=$(INCLUDEDIRS:%=-I %) $(INCLUDESEXTRA)
 
 # This flag can also be used in subdirectories so don't change its name here.
 # For profiling use:  -p -inline 0
-OPTFLAGS=
-#-thread
+OCAMLCFLAGS ?= -g
+OPTFLAGS ?= -g
 
 # The OPTBIN variable is here to allow to use ocamlc.opt instead of
 # ocaml, when it is available, which speeds up compilation. So
@@ -114,8 +109,6 @@ OPTFLAGS=
 # or setenv it to ".opt" in your startup script.
 OPTBIN ?= #.opt
 
-OCAMLCFLAGS ?= -g -dtypes
-
 # The OCaml tools.
 OCAMLC_CMD=$(OCAMLC) $(OCAMLCFLAGS) $(INCLUDES)
 OCAMLOPT_CMD=$(OCAMLOPT) $(OPTFLAGS) $(INCLUDES)
@@ -132,8 +125,10 @@ OBJS = $(SRC:.ml=.cmo)
 OPTOBJS = $(SRC:.ml=.cmx)
 
 
+ifneq ($(FEATURE_OCAMLBUILD),yes)
 all: $(LIB)
-all.opt: $(OPTLIB)
+all.opt:
+       @$(MAKE) $(OPTLIB) BUILD_OPT=yes
 opt: all.opt
 top: $(TARGET).top
 
@@ -148,6 +143,14 @@ $(TARGET).top: $(OBJS)
 
 clean::
        rm -f $(TARGET).top
+else
+all:
+       cd .. && $(OCAMLBUILD) commons/commons.cma
+all.opt:
+       cd .. && $(OCAMLBUILD) commons/commons.cmxa
+clean::
+       cd .. && $(OCAMLBUILD) -clean
+endif
 
 ##############################################################################
 # Other commons libs target
@@ -244,18 +247,6 @@ clean::
 
 
 #-----------------------------------------------------------------------------
-.PHONEY: sexp.all sexp.opt
-sexp.all:
-       $(MAKE) INCLUDESEXTRA="$(SEXPINCLUDES)" commons_sexp.cma
-sexp.opt:
-       $(MAKE) INCLUDESEXTRA="$(SEXPINCLUDES)" commons_sexp.cmxa
-
-commons_sexp.cma: $(MYSEXPSRC:.ml=.cmo)
-       $(OCAMLC_CMD) -a -o $@ $^
-
-commons_sexp.cmxa: $(MYSEXPSRC:.ml=.cmx)
-       $(OCAMLOPT_CMD) -a -o $@ $^
-
 binprot:
        $(MAKE) INCLUDESEXTRA="$(BININCLUDES)" commons_bin.cma
 binprot.opt:
@@ -339,6 +330,10 @@ distclean: clean
 
 ifneq ($(MAKECMDGOALS),clean)
 ifneq ($(MAKECMDGOALS),distclean)
+ifneq ($(FEATURE_OCAMLBUILD),yes)
 -include .depend
 endif
 endif
+endif
+
+include ../Makefile.common