Commit | Line | Data |
---|---|---|
485bce71 C |
1 | ############################################################################## |
2 | # Variables | |
3 | ############################################################################## | |
4 | #TARGET=matcher | |
0708f913 C |
5 | -include ../Makefile.config |
6 | ||
34e49164 C |
7 | TARGET=cocciengine |
8 | CTLTARGET=engine | |
9 | ||
485bce71 C |
10 | SRC= flag_matcher.ml lib_engine.ml pretty_print_engine.ml \ |
11 | check_exhaustive_pattern.ml \ | |
12 | check_reachability.ml \ | |
13 | c_vs_c.ml isomorphisms_c_c.ml \ | |
14 | cocci_vs_c.ml pattern_c.ml sgrep.ml transformation_c.ml \ | |
15 | asttomember.ml asttoctl2.ml ctltotex.ml \ | |
0708f913 | 16 | postprocess_transinfo.ml ctlcocci_integration.ml |
485bce71 C |
17 | |
18 | #c_vs_c.ml | |
19 | #SRC= flag_matcher.ml \ | |
20 | # c_vs_c.ml cocci_vs_c.ml \ | |
21 | # lib_engine.ml \ | |
b1b2de81 | 22 | # pattern_c.ml transformation_c.ml |
485bce71 C |
23 | |
24 | #LIBS=../commons/commons.cma ../parsing_c/parsing_c.cma | |
25 | #INCLUDES= -I ../commons -I ../parsing_c | |
26 | INCLUDES = -I ../commons -I ../commons/ocamlextra -I ../globals \ | |
b1b2de81 | 27 | -I ../ctl -I ../parsing_cocci -I ../parsing_c |
485bce71 C |
28 | LIBS=../commons/commons.cma ../globals/globals.cma \ |
29 | ../ctl/ctl.cma ../parsing_c/parsing_c.cma ../parsing_cocci/cocci_parser.cma | |
30 | ||
b1b2de81 | 31 | SYSLIBS= str.cma unix.cma |
485bce71 | 32 | |
34e49164 C |
33 | |
34 | # just to test asttoctl | |
35 | # CTLSOURCES = lib_engine.ml pretty_print_engine.ml asttoctl.ml ctltotex.ml \ | |
36 | # main.ml | |
37 | ||
485bce71 C |
38 | ############################################################################## |
39 | # Generic variables | |
40 | ############################################################################## | |
34e49164 | 41 | |
b1b2de81 | 42 | #for warning: -w A |
485bce71 | 43 | #for profiling: -p -inline 0 with OCAMLOPT |
34e49164 | 44 | OCAMLCFLAGS ?= -g -dtypes |
34e49164 | 45 | |
485bce71 C |
46 | OCAMLC=ocamlc$(OPTBIN) $(OCAMLCFLAGS) $(INCLUDES) |
47 | OCAMLOPT=ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES) | |
48 | OCAMLLEX=ocamllex$(OPTBIN) #-ml | |
49 | OCAMLYACC=ocamlyacc -v | |
0708f913 | 50 | OCAMLDEP=ocamldep$(OPTBIN) $(INCLUDES) |
485bce71 | 51 | OCAMLMKTOP=ocamlmktop -g -custom $(INCLUDES) |
34e49164 | 52 | |
34e49164 | 53 | |
485bce71 C |
54 | OBJS = $(SRC:.ml=.cmo) |
55 | OPTOBJS = $(SRC:.ml=.cmx) | |
34e49164 | 56 | |
34e49164 | 57 | |
485bce71 C |
58 | ############################################################################## |
59 | # Top rules | |
60 | ############################################################################## | |
61 | all: $(TARGET).cma | |
62 | all.opt: $(TARGET).cmxa | |
34e49164 | 63 | |
485bce71 C |
64 | $(TARGET).cma: $(OBJS) |
65 | $(OCAMLC) -a -o $(TARGET).cma $(OBJS) | |
34e49164 | 66 | |
485bce71 C |
67 | $(TARGET).cmxa: $(OPTOBJS) $(LIBS:.cma=.cmxa) |
68 | $(OCAMLOPT) -a -o $(TARGET).cmxa $(OPTOBJS) | |
34e49164 | 69 | |
485bce71 C |
70 | $(TARGET).top: $(OBJS) $(LIBS) |
71 | $(OCAMLMKTOP) -o $(TARGET).top $(SYSLIBS) $(LIBS) $(OBJS) | |
34e49164 | 72 | |
34e49164 | 73 | clean:: |
485bce71 | 74 | rm -f $(TARGET).top |
34e49164 C |
75 | |
76 | ||
34e49164 | 77 | |
485bce71 C |
78 | ############################################################################## |
79 | # Pad's rules | |
80 | ############################################################################## | |
34e49164 | 81 | |
485bce71 C |
82 | ############################################################################## |
83 | # Generic rules | |
84 | ############################################################################## | |
34e49164 | 85 | |
34e49164 C |
86 | .SUFFIXES: .ml .mli .cmo .cmi .cmx |
87 | ||
88 | .ml.cmo: | |
89 | $(OCAMLC) -c $< | |
34e49164 C |
90 | .mli.cmi: |
91 | $(OCAMLC) -c $< | |
34e49164 C |
92 | .ml.cmx: |
93 | $(OCAMLOPT) -c $< | |
94 | ||
b1b2de81 | 95 | .ml.mldepend: |
485bce71 | 96 | $(OCAMLC) -i $< |
34e49164 | 97 | |
34e49164 | 98 | clean:: |
485bce71 | 99 | rm -f *.cm[ioxa] *.o *.a *.cmxa *.annot |
485bce71 | 100 | rm -f *~ .*~ gmon.out #*# |
34e49164 | 101 | |
b1b2de81 C |
102 | distclean:: |
103 | rm -f .depend | |
104 | ||
485bce71 | 105 | beforedepend:: |
34e49164 | 106 | |
485bce71 C |
107 | depend:: beforedepend |
108 | $(OCAMLDEP) *.mli *.ml > .depend | |
34e49164 C |
109 | |
110 | -include .depend |