permit multiline comments and strings in macros
[bpt/coccinelle.git] / popl09 / Makefile
index 5cfc0b5..ab8d987 100644 (file)
@@ -30,6 +30,9 @@ endif
 
 TARGET = popl
 
+OCAMLCFLAGS ?= -g
+OPTFLAGS ?= -g
+
 SRC = ast_popl.ml asttopopl.ml insert_quantifiers.ml \
 pretty_print_popl.ml flag_popl.ml popltoctl.ml popl.ml
 
@@ -42,7 +45,6 @@ INCLUDES = -I ../commons -I ../globals \
 #The Caml compilers.
 #for warning:  -w A
 #for profiling:  -p -inline 0   with OCAMLOPT
-OCAMLCFLAGS ?= -g -dtypes
 OCAMLC_CMD=$(OCAMLC) $(OCAMLCFLAGS) $(INCLUDES)
 OCAMLOPT_CMD=$(OCAMLOPT) $(OPTFLAGS) $(INCLUDES)
 OCAMLDEP_CMD=$(OCAMLDEP) $(INCLUDES)
@@ -54,8 +56,10 @@ OPTLIB=$(LIB:.cma=.cmxa)
 OBJS = $(SRC:.ml=.cmo)
 OPTOBJS = $(SRC:.ml=.cmx)
 
+ifneq ($(FEATURE_OCAMLBUILD),yes)
 all: $(LIB)
-all.opt: $(OPTLIB)
+all.opt:
+       @$(MAKE) $(OPTLIB) BUILD_OPT=yes
 
 $(TARGET).top: $(LIB)
        $(OCAMLMKTOP_CMD) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS)
@@ -65,6 +69,16 @@ $(LIB):  $(OBJS)
 
 clean::
        rm -f $(LIB) $(TARGET).top
+else
+all:
+       cd .. && $(OCAMLBUILD) popl09/popl09.cma
+
+all.opt:
+       cd .. && $(OCAMLBUILD) popl09/popl09.cmxa
+
+clean::
+       cd .. && $(OCAMLBUILD) -clean
+endif
 
 
 $(OPTLIB): $(OPTOBJS)
@@ -102,6 +116,10 @@ distclean: clean
 
 ifneq ($(MAKECMDGOALS),clean)
 ifneq ($(MAKECMDGOALS),distclean)
+ifneq ($(FEATURE_OCAMLBUILD),yes)
 -include .depend
 endif
 endif
+endif
+
+include ../Makefile.common