Commit a31c13a2 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2004-02-19 04:07:32 by afrisch] Simplifie crion de cdo2cmo, renommn cduce2ocaml

Original author: afrisch
Date: 2004-02-19 04:07:33+00:00
parent 242bd87b
......@@ -78,9 +78,13 @@ CAMLOPT = $(OCAMLFIND) $(CAMLOPT_P) $(OPT) -package "$(PACKAGES)"
ifeq ($(NATIVE), true)
EXTENSION = cmx
EXTENSION_LIB = cmxa
COMPILE = $(CAMLOPT)
LINK = $(CAMLOPT) -linkpkg gramlib.cmxa
else
EXTENSION = cmo
EXTENSION_LIB = cma
COMPILE = $(CAMLC)
LINK = $(CAMLC) -custom -linkpkg gramlib.cma
endif
......@@ -184,9 +188,9 @@ INCLUDES = $(DIRS:%=-I %)
cduce: $(CDUCE:.cmo=.$(EXTENSION))
$(LINK) $(INCLUDES) -o $@ $^ $(EXTRA_LINK_OPTS)
cDuce_all: $(OBJECTS)
$(CAMLC) -o cDuce_all.cmo -pack $(OBJECTS)
$(CAMLC) -a -o cDuce_all.cma -linkpkg gramlib.cma cDuce_all.cmo
cDuce_all.$(EXTENSION_LIB): $(OBJECTS:.cmo=.$(EXTENSION))
$(COMPILE) -o cDuce_all.$(EXTENSION) -pack $^
$(LINK) -a -o $@ cDuce_all.$(EXTENSION)
webiface: $(WEBIFACE:.cmo=.$(EXTENSION))
$(LINK) -verbose $(INCLUDES) -o $@ $^ -ccopt -static
......@@ -261,3 +265,8 @@ install_web: website
fi;
cp web/img/*.* $(HTML_DIR)/img
#*: help
cduce2ocaml: cDuce_all.$(EXTENSION_LIB)
rm -f cduce2ocaml
(cd cdo2cmo; $(MAKE) clean; $(MAKE) NATIVE=$(NATIVE))
......@@ -24,21 +24,12 @@ If you install all your sources in /usr/local/src/ then
and optionally
make install_liball.opt
make install_liball.opt
5) Go in the cduce source directory and create cDuce_all
5) Create the cduce2ocaml binary by running from the root of CDuce source tree:
cd /usr/local/src/cduce
make cDuce_all
make cduce2ocaml
Now look at the README file to see how to use the command cduce2ocaml.
6) Go in the cdo2cmo dir create a new lilb directory and copy
there the cDuce_all.* files and make all
cd cdo2cmo
mkdir lib
cp ../cDuce_all.* lib
make
Now look at the README file to see how to use the command cdo2cmo
ifeq ($(NATIVE), true)
EXTENSION = cmx
EXTENSION_LIB = cmxa
LINK = ocamlopt
else
EXTENSION = cmo
EXTENSION_LIB = cma
LINK = ocamlc
endif
OBJECTS=src/types.cmo src/ocaml.cmo src/cduce.cmo src/checker.cmo \
src/generator.cmo src/main.cmo
INTERFACES=$(shell for o in $(OBJECTS); do echo $${o%cmo}cmi; done )
BIN=cdo2cmo
INCLUDES=-I src -I lib
LIBS=oCaml_all.cma lib/cDuce_all.cma
BIN=../cduce2ocaml
INCLUDES=-I src -I ..
LIBS=oCaml_all.cma ../cDuce_all.cma
all: $(BIN)
$(BIN):$(OBJECTS)
ocamlc -g -o $(BIN) $(LIBS) $(OBJECTS)
$(BIN):$(OBJECTS:.cmo=.$(EXTENSION))
$(LINK) -o $@ $(LIBS:.cma=.$(EXTENSION_LIB)) $^
.SUFFIXES: .mli .ml .cmi .cmo
.SUFFIXES: .mli .ml .cmi .cmo .cmx
.mli.cmi:
ocamlc -g $(INCLUDES) $(LIBS) -c $<
ocamlc $(INCLUDES) -c $<
.ml.cmo:
ocamlc -g $(INCLUDES) $(LIBS) -c $<
ocamlc $(INCLUDES) -c $<
.ml.cmx:
ocamlopt $(INCLUDES) -c $<
clean:
rm -f $(OBJECTS) $(INTERFACES) $(BIN) src/*~
rm -f src/*.cmi src/*.cmo src/*.cmx src/*.o $(BIN) src/*~
.depend depend:
rm -f .depend
ocamldep src/*.ml src/*.mli > .depend
include .depend
......@@ -23,7 +23,7 @@ let f ( Printer -> [ ML_int * ] -> [] ) g ->
4) Generate test.cmo from test.cdo
cdo2cmo test.cmi test.cdo
cduce2ocaml test.cmi test.cdo
5) Now you can call f from a ocaml program say main.ml
......
......@@ -24,7 +24,7 @@
+ install_liball.opt: $(ALLLIB:.cmo=.cmx)
+ $(CAMLOPT) -pack -o oCaml_all.cmx $(ALLLIB:.cmo=.cmx)
+ $(CAMLOPT) -a -o oCaml_all.cmxa oCaml_all.cmx
+ cp -f oCaml_all.cmxa oCaml_all.cmi $(LIBDIR)
+ cp -f oCaml_all.cmxa oCaml_all.cmi oCaml_all.a $(LIBDIR)
+
partialclean::
rm -f ocaml toplevel/toplevellib.cma
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment