Commit | Line | Data |
---|---|---|
34e49164 C |
1 | #note: if you add a file (a .mli or .ml), dont forget to do a make depend |
2 | ||
0708f913 C |
3 | -include ../Makefile.config |
4 | ||
34e49164 C |
5 | TARGET=ctl |
6 | ||
7 | SRC=flag_ctl.ml ast_ctl.ml pretty_print_ctl.ml ctl_engine.ml wrapper_ctl.ml | |
8 | ||
9 | SYSLIBS=str.cma unix.cma | |
10 | LIBS=../commons/commons.cma ../globals/globals.cma | |
11 | ||
12 | INCLUDES=-I ../commons -I ../commons/ocamlextra -I ../globals | |
13 | ||
14 | ||
15 | #The Caml compilers. | |
b1b2de81 | 16 | #for warning: -w A |
34e49164 C |
17 | #for profiling: -p -inline 0 with OCAMLOPT |
18 | OCAMLCFLAGS ?= -g -dtypes | |
19 | OCAMLC =ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(INCLUDES) | |
20 | OCAMLOPT = ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES) | |
0708f913 | 21 | OCAMLDEP = ocamldep$(OPTBIN) $(INCLUDES) |
34e49164 C |
22 | OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDES) |
23 | ||
24 | ||
25 | ||
26 | LIB=$(TARGET).cma | |
27 | OPTLIB=$(LIB:.cma=.cmxa) | |
28 | ||
29 | OBJS = $(SRC:.ml=.cmo) | |
30 | OPTOBJS = $(SRC:.ml=.cmx) | |
31 | ||
32 | all: $(LIB) | |
33 | all.opt: $(OPTLIB) | |
34 | ||
35 | $(TARGET).top: $(LIB) test_ctl.cmo | |
36 | $(OCAMLMKTOP) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS) test_ctl.cmo | |
37 | ||
38 | $(LIB): $(OBJS) | |
39 | $(OCAMLC) -a -o $(LIB) $(OBJS) | |
40 | ||
41 | $(OPTLIB): $(OPTOBJS) | |
42 | $(OCAMLOPT) -a -o $(OPTLIB) $(OPTOBJS) | |
43 | ||
44 | clean:: | |
45 | rm -f $(LIB) $(OPTLIB) $(LIB:.cma=.a) $(TARGET).top | |
46 | ||
47 | ||
48 | .SUFFIXES: | |
49 | .SUFFIXES: .ml .mli .cmo .cmi .cmx | |
50 | ||
51 | .ml.cmo: | |
52 | $(OCAMLC) -c $< | |
53 | ||
54 | .mli.cmi: | |
55 | $(OCAMLC) -c $< | |
56 | ||
57 | .ml.cmx: | |
58 | $(OCAMLOPT) -c $< | |
59 | ||
60 | ||
61 | ||
62 | ||
63 | # clean rule for others files | |
64 | clean:: | |
65 | rm -f *.cm[iox] *.o *.annot | |
b1b2de81 | 66 | rm -f *~ .*~ #*# |
34e49164 | 67 | |
b1b2de81 | 68 | depend: |
34e49164 C |
69 | $(OCAMLDEP) *.mli *.ml > .depend |
70 | ||
71 | distclean:: | |
72 | rm -f .depend | |
73 | ||
74 | .depend: | |
75 | $(OCAMLDEP) *.mli *.ml > .depend | |
76 | ||
77 | -include .depend |