1 #############################################################################
2 # Configuration section
3 #############################################################################
4 -include ..
/Makefile.config
6 ##############################################################################
8 ##############################################################################
11 SOURCES
= pycocci_aux.ml pycocci.ml
13 INCLUDEDIRS
= ..
/commons ..
/commons
/ocamlextra ..
/globals ..
/pycaml \
14 ..
/parsing_c ..
/parsing_cocci
16 SYSLIBS
= str.cma unix.cma
17 LIBS
=..
/commons
/commons.cma ..
/globals
/globals.cma
20 # ../parsing_c/c_parser.cma ../parsing_cocci/cocci_parser.cma
24 ##############################################################################
26 ##############################################################################
28 INCLUDES
=$(INCLUDEDIRS
:%=-I
%) $(INCLUDESEXTRA
)
30 ##############################################################################
31 # Generic ocaml variables
32 ##############################################################################
35 OCAMLCFLAGS ?
= -g
-dtypes
36 OCAMLC
=ocamlc
$(OPTBIN
) $(OCAMLCFLAGS
) $(INCLUDES
)
37 OCAMLOPT
= ocamlopt
$(OPTBIN
) $(OPTFLAGS
) $(INCLUDES
)
38 OCAMLDEP
= ocamldep
$(OPTBIN
) $(INCLUDES
)
41 ##############################################################################
43 ##############################################################################
47 OPTLIB
=$(LIB
:.cma
=.cmxa
)
51 OBJS
= $(SOURCES
:.ml
=.cmo
)
52 OPTOBJS
= $(OBJS
:.cmo
=.cmx
)
54 CTLOBJS
= $(CTLSOURCES
:.ml
=.cmo
)
55 CTLOPTOBJS
= $(CTLOBJS
:.cmo
=.cmx
)
67 $(OCAMLC
) -a
-o
$(LIB
) $(OBJS
)
74 $(OCAMLOPT
) -a
-o
$(OPTLIB
) $(OPTOBJS
)
77 $(EXEC
): $(OBJS
) main.cmo
$(LIBS
)
78 $(OCAMLC
) -o
$(EXEC
) $(SYSLIBS
) $(LIBS
) $(OBJS
) main.cmo
80 $(CTLEXEC
): $(CTLOBJS
) $(LIBS
)
81 $(OCAMLC
) -o
$(CTLEXEC
) $(SYSLIBS
) $(LIBS
) $(CTLOBJS
)
85 rm -f
$(OPTLIB
) $(LIB
:.cma
=.a
)
86 rm -f
$(TARGET
) rm -f
$(TARGET
).byte
90 #pycocci.ml: ../pycaml/pycaml.ml ../pycaml/pycaml_ml.c
91 #pycocci_aux.ml: ../pycaml/pycaml.ml ../pycaml/pycaml_ml.c
93 @echo
"\n\n\t*** pycocci_aux.ml not found ! ***\n\n\tRun 'configure && make depend' first.\n\n"
96 rm -f pycocci.ml pycocci_aux.ml
98 ##############################################################################
100 ##############################################################################
103 .SUFFIXES
: .ml .mli .cmo .cmi .cmx
115 # clean rule for others files
117 rm -f
*.cm
[iox
] *.o
*.annot
126 $(OCAMLDEP
) *.mli
*.ml
> .depend
129 $(OCAMLDEP
) *.mli
*.ml
> .depend