summaryrefslogtreecommitdiff
path: root/cparser/Makefile
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2010-03-03 10:22:27 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2010-03-03 10:22:27 +0000
commit891377ce1962cdb31357d6580d6546ec22df2b4f (patch)
tree4ff7c38749cc7a4c1af411c5aa3eb7225c4ae6a1 /cparser/Makefile
parent018edf2d81bf94197892cf1df221f7eeac1f96f6 (diff)
Switching to the new C parser/elaborator/simplifier
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1269 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cparser/Makefile')
-rw-r--r--cparser/Makefile89
1 files changed, 89 insertions, 0 deletions
diff --git a/cparser/Makefile b/cparser/Makefile
new file mode 100644
index 0000000..0ecd8f7
--- /dev/null
+++ b/cparser/Makefile
@@ -0,0 +1,89 @@
+OCAMLC=ocamlc -g
+OCAMLOPT=ocamlopt -g
+OCAMLLEX=ocamllex
+OCAMLYACC=ocamlyacc -v
+OCAMLDEP=ocamldep
+OCAMLMKLIB=ocamlmklib
+
+LIBDIR=`$(OCAMLC) -where`/cparser
+
+INTFS=C.mli
+
+SRCS=Errors.ml Cabs.ml Cabshelper.ml Parse_aux.ml Parser.ml Lexer.ml \
+ Machine.ml \
+ Env.ml Cprint.ml Cutil.ml Ceval.ml Cleanup.ml \
+ Builtins.ml Elab.ml Rename.ml \
+ Transform.ml \
+ Unblock.ml SimplExpr.ml AddCasts.ml StructByValue.ml StructAssign.ml \
+ Bitfields.ml \
+ Parse.ml
+
+COBJS=uint64.o
+BOBJS=$(SRCS:.ml=.cmo)
+NOBJS=$(SRCS:.ml=.cmx)
+IOBJS=$(INTFS:.mli=.cmi)
+
+all: cparser.cma cparser.cmxa cparser cparser.byte
+
+install:
+ mkdir -p $(LIBDIR)
+ cp -p Cparser.cmi cparser.cma cparser.cmxa cparser.a libcparser.a dllcparser.so $(LIBDIR)
+
+cparser: $(COBJS) $(NOBJS) Main.cmx
+ $(OCAMLOPT) -o cparser $(COBJS) $(NOBJS) Main.cmx
+
+clean::
+ rm -f cparser
+
+cparser.byte: $(COBJS) $(BOBJS) Main.cmo
+ $(OCAMLC) -custom -o cparser.byte $(COBJS) $(BOBJS) Main.cmo
+
+clean::
+ rm -f cparser
+
+cparser.cma libcparser.a: uint64.o Cparser.cmo
+ $(OCAMLMKLIB) -o cparser uint64.o Cparser.cmo
+
+cparser.cmxa: uint64.o Cparser.cmx
+ $(OCAMLMKLIB) -o cparser uint64.o Cparser.cmx
+
+Cparser.cmo Cparser.cmi: $(IOBJS) $(BOBJS)
+ $(OCAMLC) -pack -o Cparser.cmo $(IOBJS) $(BOBJS)
+
+Cparser.cmx: $(IOBJS) $(NOBJS)
+ $(OCAMLOPT) -pack -o Cparser.cmx $(IOBJS) $(NOBJS)
+
+Parser.ml Parser.mli: Parser.mly
+ $(OCAMLYACC) Parser.mly
+
+clean::
+ rm -f Parser.ml Parser.mli Parser.output
+
+beforedepend:: Parser.ml Parser.mli
+
+Lexer.ml: Lexer.mll
+ $(OCAMLLEX) Lexer.mll
+
+clean::
+ rm -f Lexer.ml
+
+beforedepend:: Lexer.ml
+
+.SUFFIXES: .ml .mli .cmi .cmo .cmx
+
+.mli.cmi:
+ $(OCAMLC) -c $*.mli
+.ml.cmo:
+ $(OCAMLC) -c $*.ml
+.ml.cmx:
+ $(OCAMLOPT) -c -for-pack Cparser $*.ml
+.c.o:
+ $(OCAMLC) -c $*.c
+
+clean::
+ rm -f *.cm? *.o *.so
+
+depend: beforedepend
+ $(OCAMLDEP) *.mli *.ml > .depend
+
+include .depend