Commit | Line | Data |
---|---|---|
951c7801 C |
1 | #note: if you add a file (a .mli or .ml), dont forget to do a make depend |
2 | ||
3 | -include ../Makefile.config | |
4 | ||
5 | TARGET = popl | |
6 | ||
7 | SRC = ast_popl.ml asttopopl.ml insert_quantifiers.ml insert_befaft.ml \ | |
8 | pretty_print_popl.ml popltoctl.ml popl.ml flag_popl.ml | |
9 | ||
10 | SYSLIBS=str.cma unix.cma | |
11 | LIBS=../commons/commons.cma ../globals/globals.cma | |
12 | ||
13 | INCLUDE_PATH = -I ../commons -I ../globals \ | |
14 | -I ../ctl -I ../parsing_c -I ../parsing_cocci -I ../engine | |
15 | ||
16 | #The Caml compilers. | |
17 | #for warning: -w A | |
18 | #for profiling: -p -inline 0 with OCAMLOPT | |
19 | CAMLC =ocamlc$(OPTBIN) -dtypes -g | |
20 | CAMLOPT=ocamlopt$(OPTBIN) $(OPTFLAGS) | |
21 | CAMLLEX = ocamllex$(OPTBIN) | |
22 | CAMLYACC= ocamlyacc | |
23 | CAMLDEP = ocamldep$(OPTBIN) | |
24 | CAMLMKTOP=ocamlmktop -g -custom | |
25 | ||
26 | ||
27 | ||
28 | LIB=$(TARGET).cma | |
29 | OPTLIB=$(LIB:.cma=.cmxa) | |
30 | ||
31 | OBJS = $(SRC:.ml=.cmo) | |
32 | OPTOBJS = $(SRC:.ml=.cmx) | |
33 | ||
34 | all: $(LIB) | |
35 | all.opt: $(OPTLIB) | |
36 | ||
37 | $(TARGET).top: $(LIB) | |
38 | $(CAMLMKTOP) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS) | |
39 | ||
40 | $(LIB): $(OBJS) | |
41 | $(CAMLC) -a -o $(LIB) $(OBJS) | |
42 | ||
43 | clean:: | |
44 | rm -f $(LIB) $(TARGET).top | |
45 | ||
46 | ||
47 | $(OPTLIB): $(OPTOBJS) | |
48 | $(CAMLOPT) -a -o $(OPTLIB) $(OPTOBJS) | |
49 | ||
50 | # clean rule for LIB.opt | |
51 | clean:: | |
52 | rm -f $(OPTLIB) $(LIB:.cma=.a) | |
53 | ||
54 | ||
55 | .SUFFIXES: | |
56 | .SUFFIXES: .ml .mli .cmo .cmi .cmx | |
57 | ||
58 | .ml.cmo: | |
59 | $(CAMLC) $(INCLUDE_PATH) -c $< | |
60 | ||
61 | .mli.cmi: | |
62 | $(CAMLC) $(INCLUDE_PATH) -c $< | |
63 | ||
64 | .ml.cmx: | |
65 | $(CAMLOPT) $(INCLUDE_PATH) -c $< | |
66 | ||
67 | ||
68 | ||
69 | ||
70 | # clean rule for others files | |
71 | clean:: | |
72 | rm -f *.cm[iox] *.o *.annot | |
73 | rm -f *~ .*~ #*# | |
74 | ||
75 | depend: | |
76 | $(CAMLDEP) $(INCLUDE_PATH) *.mli *.ml > .depend | |
77 | ||
78 | distclean:: | |
79 | rm -f .depend | |
80 | ||
81 | .depend: | |
82 | $(CAMLDEP) $(INCLUDE_PATH) *.mli *.ml > .depend | |
83 | ||
84 | -include .depend |