| 1 |
# This file is part of Coccinelle, licensed under the terms of the GPL v2. |
| 2 |
# See copyright.txt in the Coccinelle source code for more information. |
| 3 |
# The Coccinelle source code can be obtained at http://coccinelle.lip6.fr |
| 4 |
|
| 5 |
#note: if you add a file (a .mli or .ml), don't forget to do a make depend |
| 6 |
|
| 7 |
ifneq ($(MAKECMDGOALS),distclean) |
| 8 |
include ../Makefile.config |
| 9 |
-include ../Makefile.local |
| 10 |
endif |
| 11 |
|
| 12 |
TARGET = popl |
| 13 |
|
| 14 |
OCAMLCFLAGS ?= -g |
| 15 |
OPTFLAGS ?= -g |
| 16 |
|
| 17 |
SRC = ast_popl.ml asttopopl.ml insert_quantifiers.ml insert_befaft.ml \ |
| 18 |
pretty_print_popl.ml popltoctl.ml popl.ml flag_popl.ml |
| 19 |
|
| 20 |
SYSLIBS=str.cma unix.cma |
| 21 |
LIBS=../commons/commons.cma ../globals/globals.cma |
| 22 |
|
| 23 |
INCLUDE_PATH = -I ../commons -I ../globals \ |
| 24 |
-I ../ctl -I ../parsing_c -I ../parsing_cocci -I ../engine |
| 25 |
|
| 26 |
#The Caml compilers. |
| 27 |
#for warning: -w A |
| 28 |
#for profiling: -p -inline 0 with OCAMLOPT |
| 29 |
OCAMLC_CMD=$(OCAMLC) $(OCAMLCFLAGS) |
| 30 |
OCAMLOPT_CMD=$(OCAMLOPT) $(OPTFLAGS) |
| 31 |
OCAMLDEP_CMD=$(OCAMLDEP) |
| 32 |
OCAMLMKTOP_CMD=$(OCAMLMKTOP) -g -custom |
| 33 |
|
| 34 |
LIB=$(TARGET).cma |
| 35 |
OPTLIB=$(LIB:.cma=.cmxa) |
| 36 |
|
| 37 |
OBJS = $(SRC:.ml=.cmo) |
| 38 |
OPTOBJS = $(SRC:.ml=.cmx) |
| 39 |
|
| 40 |
all: $(LIB) |
| 41 |
all.opt: |
| 42 |
@$(MAKE) $(OPTLIB) BUILD_OPT=yes |
| 43 |
|
| 44 |
$(TARGET).top: $(LIB) |
| 45 |
$(OCAMLMKTOP_CMD) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS) |
| 46 |
|
| 47 |
$(LIB): $(OBJS) |
| 48 |
$(OCAMLC_CMD) -a -o $(LIB) $(OBJS) |
| 49 |
|
| 50 |
clean:: |
| 51 |
rm -f $(LIB) $(TARGET).top |
| 52 |
|
| 53 |
|
| 54 |
$(OPTLIB): $(OPTOBJS) |
| 55 |
$(OCAMLOPT_CMD) -a -o $(OPTLIB) $(OPTOBJS) |
| 56 |
|
| 57 |
# clean rule for LIB.opt |
| 58 |
clean:: |
| 59 |
rm -f $(OPTLIB) $(LIB:.cma=.a) |
| 60 |
|
| 61 |
|
| 62 |
.SUFFIXES: |
| 63 |
.SUFFIXES: .ml .mli .cmo .cmi .cmx |
| 64 |
|
| 65 |
.ml.cmo: |
| 66 |
$(OCAMLC_CMD) $(INCLUDE_PATH) -c $< |
| 67 |
|
| 68 |
.mli.cmi: |
| 69 |
$(OCAMLC_CMD) $(INCLUDE_PATH) -c $< |
| 70 |
|
| 71 |
.ml.cmx: |
| 72 |
$(OCAMLOPT_CMD) $(INCLUDE_PATH) -c $< |
| 73 |
|
| 74 |
|
| 75 |
# clean rule for others files |
| 76 |
clean:: |
| 77 |
rm -f *.cm[iox] *.o *.annot |
| 78 |
rm -f *~ .*~ #*# |
| 79 |
rm -f .depend |
| 80 |
|
| 81 |
distclean: clean |
| 82 |
|
| 83 |
.PHONY: depend |
| 84 |
.depend depend: |
| 85 |
$(OCAMLDEP_CMD) $(INCLUDE_PATH) *.mli *.ml > .depend |
| 86 |
|
| 87 |
ifneq ($(MAKECMDGOALS),clean) |
| 88 |
ifneq ($(MAKECMDGOALS),distclean) |
| 89 |
-include .depend |
| 90 |
endif |
| 91 |
endif |
| 92 |
|
| 93 |
include ../Makefile.common |