This file is part of MXE. See LICENSE.md for licensing information. Contains ad hoc patches for cross building. From 8f7239bcdd0f1c3879d548ddfb34c8befa70c9fb Mon Sep 17 00:00:00 2001 From: MXE Date: Fri, 11 May 2012 00:50:32 +0200 Subject: [PATCH 1/2] allows use of ocaml tools for cross-compilation diff --git a/Makefile b/Makefile index c978890..5c15ace 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,11 @@ # Makefile generated by OCamake # http://tech.motion-twin.com .SUFFIXES : .ml .mli .cmo .cmx .cmi .mll .mly +OCAMLC=@target@-ocamlc +OCAMLOPT=@target@-ocamlopt -INSTALLDIR=`ocamlc -where` + +INSTALLDIR=@installdir@ CFLAGS= LFLAGS= -a LIBS= @@ -19,16 +22,16 @@ doc: ocamldoc -sort -html -d doc xml.mli dtd.mli xmlParser.mli test.exe: xml-light.cma - ocamlc xml-light.cma test.ml -o test.exe - + $(OCAMLC) xml-light.cma test.ml -o test.exe + test_opt.exe: xml-light.cmxa - ocamlopt xml-light.cmxa test.ml -o test_opt.exe + $(OCAMLOPT) xml-light.cmxa test.ml -o test_opt.exe xml-light.cma: xml_parser.cmo xml_lexer.cmo dtd.cmo xmlParser.cmo xml.cmo - ocamlc -o xml-light.cma $(LFLAGS) $(LIBS) xml_parser.cmo xml_lexer.cmo dtd.cmo xmlParser.cmo xml.cmo + $(OCAMLC) -o xml-light.cma $(LFLAGS) $(LIBS) xml_parser.cmo xml_lexer.cmo dtd.cmo xmlParser.cmo xml.cmo xml-light.cmxa: xml_parser.cmx xml_lexer.cmx dtd.cmx xmlParser.cmx xml.cmx - ocamlopt -o xml-light.cmxa $(LFLAGS) $(LIBS) xml_parser.cmx xml_lexer.cmx dtd.cmx xmlParser.cmx xml.cmx + $(OCAMLOPT) -o xml-light.cmxa $(LFLAGS) $(LIBS) xml_parser.cmx xml_lexer.cmx dtd.cmx xmlParser.cmx xml.cmx dtd.cmo: xml.cmi xml_lexer.cmi dtd.cmi @@ -68,13 +71,13 @@ wclean: # SUFFIXES .ml.cmo: - ocamlc $(CFLAGS) -c $< + $(OCAMLC) $(CFLAGS) -c $< .ml.cmx: - ocamlopt $(CFLAGS) -c $< + $(OCAMLOPT) $(CFLAGS) -c $< .mli.cmi: - ocamlc $(CFLAGS) $< + $(OCAMLC) $(CFLAGS) $< .mll.ml: ocamllex $< -- 1.7.9.5 From 4ec44e9cba7be6abfe9c121b753f8d6bd5b3ee8b Mon Sep 17 00:00:00 2001 From: MXE Date: Sun, 30 Sep 2012 21:38:52 +0200 Subject: [PATCH 2/2] use prefixed ocamldoc diff --git a/Makefile b/Makefile index 5c15ace..0e60588 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ .SUFFIXES : .ml .mli .cmo .cmx .cmi .mll .mly OCAMLC=@target@-ocamlc OCAMLOPT=@target@-ocamlopt +OCAMLDOC=@target@-ocamldoc INSTALLDIR=@installdir@ @@ -19,7 +20,7 @@ install: all opt doc: mkdir doc - ocamldoc -sort -html -d doc xml.mli dtd.mli xmlParser.mli + $(OCAMLDOC) -sort -html -d doc xml.mli dtd.mli xmlParser.mli test.exe: xml-light.cma $(OCAMLC) xml-light.cma test.ml -o test.exe -- 1.7.9.5