Commit 85afd108 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2003-05-26 22:11:24 by cvscast] get rid of Cduce_config

Original author: cvscast
Date: 2003-05-26 22:11:25+00:00
parent 8a5d5614
......@@ -5,6 +5,8 @@ include Makefile.distrib
pull: tools/pull.$(EXTENSION)
$(LINK) -o $@ $^
PREPRO = $(SYNTAX) pr_o.cmo
profile:
rm -Rf prepro
mkdir prepro
......
......@@ -9,7 +9,16 @@ else
PACKAGES += -package pxp-lex-utf8
endif
SYNTAX = camlp4o pa_extend.cmo
SYNTAX = camlp4o -I misc/ pa_extend.cmo \
q_symbol.cmo \
-symbol cduce_version=\"$(VERSION)\" \
-symbol build_date=\"$(shell date +%Y-%m-%d)\"
ifeq ($(NATIVE), true)
SYNTAX += -symbol ocaml_compiler=\"native\"
else
SYNTAX += -symbol ocaml_compiler=\"bytecode\"
endif
VERSION = 0.0.9
......@@ -45,7 +54,6 @@ CLEAN_DIRS = $(DIRS) tools tests
# Objects to build
OBJECTS = \
misc/cduce_config.cmo \
misc/state.cmo misc/pool.cmo misc/encodings.cmo misc/bool.cmo \
misc/pretty.cmo \
\
......@@ -70,21 +78,11 @@ DTD2CDUCE = tools/dtd2cduce.cmo
DEPEND = $(DIRS:=/*.ml) $(DIRS:=/*.mli)
INCLUDES = $(DIRS:%=-I %)
PREPRO = $(SYNTAX) pr_o.cmo
misc/cduce_config.cmo: misc/cduce_config.ml
$(CAMLC) -c $(SYNTAX_PARSER) $(INCLUDES) $<
rm -f misc/cduce_config.ml
misc/cduce_config.cmx: misc/cduce_config.ml
$(CAMLOPT) -c $(SYNTAX_PARSER) $(INCLUDES) $<
rm -f misc/cduce_config.ml
misc/cduce_config.ml:
sed -e 's|%%VERSION%%|$(VERSION)|' \
-e 's|%%BUILD_DATE%%|$(shell date +%Y-%m-%d)|' \
-e 's|%%NATIVE%%|$(NATIVE)|' \
misc/cduce_config.mlp > misc/cduce_config.ml
#misc/cduce_config.ml:
# sed -e 's|%%VERSION%%|$(VERSION)|' \
# -e 's|%%BUILD_DATE%%|$(shell date +%Y-%m-%d)|' \
# -e 's|%%NATIVE%%|$(NATIVE)|' \
# misc/cduce_config.mlp > misc/cduce_config.ml
cduce: $(CDUCE:.cmo=.$(EXTENSION))
......@@ -97,9 +95,10 @@ dtd2cduce: $(DTD2CDUCE:.cmo=.$(EXTENSION))
$(LINK) -o $@ $^
.PHONY: compute_depend
compute_depend:
compute_depend: misc/q_symbol.cmo
@echo "Computing dependencies ..."
ocamldep $(INCLUDES) $(SYNTAX_PARSER) $(DEPEND) > depend
ocamldep $(INCLUDES) $(SYNTAX_PARSER) $(DEPEND) | \
sed -e "s|: |: misc/q_symbol.cmo |" > depend
parser/wlexer.ml: parser/wlexer.mll
wlex parser/wlexer.mll
......@@ -118,6 +117,9 @@ clean:
.SUFFIXES: .ml .mli .cmo .cmi .cmx
misc/q_symbol.cmo: misc/q_symbol.ml
$(CAMLC) -c $<
.ml.cmo:
$(CAMLC) -c $(SYNTAX_PARSER) $(INCLUDES) $<
......
misc/bool.cmo: misc/bool.cmi
misc/bool.cmx: misc/bool.cmi
misc/encodings.cmo: misc/encodings.cmi
misc/encodings.cmx: misc/encodings.cmi
misc/pool.cmo: misc/state.cmi misc/pool.cmi
misc/pool.cmx: misc/state.cmx misc/pool.cmi
misc/pretty.cmo: misc/pretty.cmi
misc/pretty.cmx: misc/pretty.cmi
misc/state.cmo: misc/state.cmi
misc/state.cmx: misc/state.cmi
parser/ast.cmo: types/ident.cmo parser/location.cmi types/types.cmi
parser/ast.cmx: types/ident.cmx parser/location.cmx types/types.cmx
parser/location.cmo: parser/location.cmi
parser/location.cmx: parser/location.cmi
parser/parser.cmo: parser/ast.cmo types/atoms.cmi types/chars.cmi \
misc/bool.cmo: misc/q_symbol.cmo misc/bool.cmi
misc/bool.cmx: misc/q_symbol.cmo misc/bool.cmi
misc/encodings.cmo: misc/q_symbol.cmo misc/encodings.cmi
misc/encodings.cmx: misc/q_symbol.cmo misc/encodings.cmi
misc/pool.cmo: misc/q_symbol.cmo misc/state.cmi misc/pool.cmi
misc/pool.cmx: misc/q_symbol.cmo misc/state.cmx misc/pool.cmi
misc/pretty.cmo: misc/q_symbol.cmo misc/pretty.cmi
misc/pretty.cmx: misc/q_symbol.cmo misc/pretty.cmi
misc/state.cmo: misc/q_symbol.cmo misc/state.cmi
misc/state.cmx: misc/q_symbol.cmo misc/state.cmi
parser/ast.cmo: misc/q_symbol.cmo types/ident.cmo parser/location.cmi types/types.cmi
parser/ast.cmx: misc/q_symbol.cmo types/ident.cmx parser/location.cmx types/types.cmx
parser/location.cmo: misc/q_symbol.cmo parser/location.cmi
parser/location.cmx: misc/q_symbol.cmo parser/location.cmi
parser/parser.cmo: misc/q_symbol.cmo parser/ast.cmo types/atoms.cmi types/chars.cmi \
misc/encodings.cmi types/ident.cmo types/intervals.cmi \
parser/location.cmi types/sequence.cmi types/types.cmi parser/wlexer.cmo \
parser/parser.cmi
parser/parser.cmx: parser/ast.cmx types/atoms.cmx types/chars.cmx \
parser/parser.cmx: misc/q_symbol.cmo parser/ast.cmx types/atoms.cmx types/chars.cmx \
misc/encodings.cmx types/ident.cmx types/intervals.cmx \
parser/location.cmx types/sequence.cmx types/types.cmx parser/wlexer.cmx \
parser/parser.cmi
parser/wlexer.cmo: misc/encodings.cmi parser/location.cmi
parser/wlexer.cmx: misc/encodings.cmx parser/location.cmx
typing/typed.cmo: types/ident.cmo parser/location.cmi types/patterns.cmi \
parser/wlexer.cmo: misc/q_symbol.cmo misc/encodings.cmi parser/location.cmi
parser/wlexer.cmx: misc/q_symbol.cmo misc/encodings.cmx parser/location.cmx
typing/typed.cmo: misc/q_symbol.cmo types/ident.cmo parser/location.cmi types/patterns.cmi \
types/types.cmi runtime/value.cmi
typing/typed.cmx: types/ident.cmx parser/location.cmx types/patterns.cmx \
typing/typed.cmx: misc/q_symbol.cmo types/ident.cmx parser/location.cmx types/patterns.cmx \
types/types.cmx runtime/value.cmx
typing/typer.cmo: parser/ast.cmo types/ident.cmo parser/location.cmi \
typing/typer.cmo: misc/q_symbol.cmo parser/ast.cmo types/ident.cmo parser/location.cmi \
types/patterns.cmi types/sequence.cmi misc/state.cmi typing/typed.cmo \
types/types.cmi typing/typer.cmi
typing/typer.cmx: parser/ast.cmx types/ident.cmx parser/location.cmx \
typing/typer.cmx: misc/q_symbol.cmo parser/ast.cmx types/ident.cmx parser/location.cmx \
types/patterns.cmx types/sequence.cmx misc/state.cmx typing/typed.cmx \
types/types.cmx typing/typer.cmi
types/atoms.cmo: misc/encodings.cmi misc/pool.cmi types/sortedList.cmi \
types/atoms.cmo: misc/q_symbol.cmo misc/encodings.cmi misc/pool.cmi types/sortedList.cmi \
types/atoms.cmi
types/atoms.cmx: misc/encodings.cmx misc/pool.cmx types/sortedList.cmx \
types/atoms.cmx: misc/q_symbol.cmo misc/encodings.cmx misc/pool.cmx types/sortedList.cmx \
types/atoms.cmi
types/boolean.cmo: types/sortedList.cmi types/boolean.cmi
types/boolean.cmx: types/sortedList.cmx types/boolean.cmi
types/builtin.cmo: parser/ast.cmo types/atoms.cmi types/chars.cmi \
types/boolean.cmo: misc/q_symbol.cmo types/sortedList.cmi types/boolean.cmi
types/boolean.cmx: misc/q_symbol.cmo types/sortedList.cmx types/boolean.cmi
types/builtin.cmo: misc/q_symbol.cmo parser/ast.cmo types/atoms.cmi types/chars.cmi \
types/ident.cmo types/intervals.cmi runtime/load_xml.cmi \
parser/location.cmi runtime/print_xml.cmo types/sequence.cmi \
typing/typed.cmo typing/typer.cmi types/types.cmi runtime/value.cmi
types/builtin.cmx: parser/ast.cmx types/atoms.cmx types/chars.cmx \
types/builtin.cmx: misc/q_symbol.cmo parser/ast.cmx types/atoms.cmx types/chars.cmx \
types/ident.cmx types/intervals.cmx runtime/load_xml.cmx \
parser/location.cmx runtime/print_xml.cmx types/sequence.cmx \
typing/typed.cmx typing/typer.cmx types/types.cmx runtime/value.cmx
types/chars.cmo: types/chars.cmi
types/chars.cmx: types/chars.cmi
types/ident.cmo: misc/encodings.cmi misc/pool.cmi types/sortedList.cmi
types/ident.cmx: misc/encodings.cmx misc/pool.cmx types/sortedList.cmx
types/intervals.cmo: types/intervals.cmi
types/intervals.cmx: types/intervals.cmi
types/normal.cmo: types/normal.cmi
types/normal.cmx: types/normal.cmi
types/patterns.cmo: types/atoms.cmi types/chars.cmi types/ident.cmo \
types/chars.cmo: misc/q_symbol.cmo types/chars.cmi
types/chars.cmx: misc/q_symbol.cmo types/chars.cmi
types/ident.cmo: misc/q_symbol.cmo misc/encodings.cmi misc/pool.cmi types/sortedList.cmi
types/ident.cmx: misc/q_symbol.cmo misc/encodings.cmx misc/pool.cmx types/sortedList.cmx
types/intervals.cmo: misc/q_symbol.cmo types/intervals.cmi
types/intervals.cmx: misc/q_symbol.cmo types/intervals.cmi
types/normal.cmo: misc/q_symbol.cmo types/normal.cmi
types/normal.cmx: misc/q_symbol.cmo types/normal.cmi
types/patterns.cmo: misc/q_symbol.cmo types/atoms.cmi types/chars.cmi types/ident.cmo \
types/sortedList.cmi misc/state.cmi types/types.cmi types/patterns.cmi
types/patterns.cmx: types/atoms.cmx types/chars.cmx types/ident.cmx \
types/patterns.cmx: misc/q_symbol.cmo types/atoms.cmx types/chars.cmx types/ident.cmx \
types/sortedList.cmx misc/state.cmx types/types.cmx types/patterns.cmi
types/sample.cmo: types/ident.cmo types/types.cmi types/sample.cmi
types/sample.cmx: types/ident.cmx types/types.cmx types/sample.cmi
types/sequence.cmo: types/atoms.cmi types/types.cmi types/sequence.cmi
types/sequence.cmx: types/atoms.cmx types/types.cmx types/sequence.cmi
types/sortedList.cmo: types/sortedList.cmi
types/sortedList.cmx: types/sortedList.cmi
types/types.cmo: types/atoms.cmi misc/bool.cmi types/chars.cmi \
types/sample.cmo: misc/q_symbol.cmo types/ident.cmo types/types.cmi types/sample.cmi
types/sample.cmx: misc/q_symbol.cmo types/ident.cmx types/types.cmx types/sample.cmi
types/sequence.cmo: misc/q_symbol.cmo types/atoms.cmi types/types.cmi types/sequence.cmi
types/sequence.cmx: misc/q_symbol.cmo types/atoms.cmx types/types.cmx types/sequence.cmi
types/sortedList.cmo: misc/q_symbol.cmo types/sortedList.cmi
types/sortedList.cmx: misc/q_symbol.cmo types/sortedList.cmi
types/types.cmo: misc/q_symbol.cmo types/atoms.cmi misc/bool.cmi types/chars.cmi \
misc/encodings.cmi types/ident.cmo types/intervals.cmi types/normal.cmi \
misc/pretty.cmi types/sortedList.cmi misc/state.cmi types/types.cmi
types/types.cmx: types/atoms.cmx misc/bool.cmx types/chars.cmx \
types/types.cmx: misc/q_symbol.cmo types/atoms.cmx misc/bool.cmx types/chars.cmx \
misc/encodings.cmx types/ident.cmx types/intervals.cmx types/normal.cmx \
misc/pretty.cmx types/sortedList.cmx misc/state.cmx types/types.cmi
runtime/eval.cmo: types/ident.cmo types/patterns.cmi runtime/run_dispatch.cmi \
runtime/eval.cmo: misc/q_symbol.cmo types/ident.cmo types/patterns.cmi runtime/run_dispatch.cmi \
typing/typed.cmo types/types.cmi runtime/value.cmi runtime/eval.cmi
runtime/eval.cmx: types/ident.cmx types/patterns.cmx runtime/run_dispatch.cmx \
runtime/eval.cmx: misc/q_symbol.cmo types/ident.cmx types/patterns.cmx runtime/run_dispatch.cmx \
typing/typed.cmx types/types.cmx runtime/value.cmx runtime/eval.cmi
runtime/load_xml.cmo: types/atoms.cmi misc/encodings.cmi types/ident.cmo \
runtime/load_xml.cmo: misc/q_symbol.cmo types/atoms.cmi misc/encodings.cmi types/ident.cmo \
parser/location.cmi runtime/value.cmi runtime/load_xml.cmi
runtime/load_xml.cmx: types/atoms.cmx misc/encodings.cmx types/ident.cmx \
runtime/load_xml.cmx: misc/q_symbol.cmo types/atoms.cmx misc/encodings.cmx types/ident.cmx \
parser/location.cmx runtime/value.cmx runtime/load_xml.cmi
runtime/print_xml.cmo: types/atoms.cmi misc/encodings.cmi types/ident.cmo \
runtime/print_xml.cmo: misc/q_symbol.cmo types/atoms.cmi misc/encodings.cmi types/ident.cmo \
parser/location.cmi types/sequence.cmi runtime/value.cmi
runtime/print_xml.cmx: types/atoms.cmx misc/encodings.cmx types/ident.cmx \
runtime/print_xml.cmx: misc/q_symbol.cmo types/atoms.cmx misc/encodings.cmx types/ident.cmx \
parser/location.cmx types/sequence.cmx runtime/value.cmx
runtime/run_dispatch.cmo: types/atoms.cmi types/chars.cmi misc/encodings.cmi \
runtime/run_dispatch.cmo: misc/q_symbol.cmo types/atoms.cmi types/chars.cmi misc/encodings.cmi \
types/ident.cmo types/patterns.cmi types/types.cmi runtime/value.cmi \
runtime/run_dispatch.cmi
runtime/run_dispatch.cmx: types/atoms.cmx types/chars.cmx misc/encodings.cmx \
runtime/run_dispatch.cmx: misc/q_symbol.cmo types/atoms.cmx types/chars.cmx misc/encodings.cmx \
types/ident.cmx types/patterns.cmx types/types.cmx runtime/value.cmx \
runtime/run_dispatch.cmi
runtime/value.cmo: types/atoms.cmi types/chars.cmi misc/encodings.cmi \
runtime/value.cmo: misc/q_symbol.cmo types/atoms.cmi types/chars.cmi misc/encodings.cmi \
types/ident.cmo types/intervals.cmi types/sequence.cmi types/types.cmi \
runtime/value.cmi
runtime/value.cmx: types/atoms.cmx types/chars.cmx misc/encodings.cmx \
runtime/value.cmx: misc/q_symbol.cmo types/atoms.cmx types/chars.cmx misc/encodings.cmx \
types/ident.cmx types/intervals.cmx types/sequence.cmx types/types.cmx \
runtime/value.cmi
driver/cduce.cmo: parser/ast.cmo runtime/eval.cmi types/ident.cmo \
driver/cduce.cmo: misc/q_symbol.cmo parser/ast.cmo runtime/eval.cmi types/ident.cmo \
parser/location.cmi parser/parser.cmi types/patterns.cmi types/sample.cmi \
misc/state.cmi typing/typed.cmo typing/typer.cmi types/types.cmi \
runtime/value.cmi parser/wlexer.cmo driver/cduce.cmi
driver/cduce.cmx: parser/ast.cmx runtime/eval.cmx types/ident.cmx \
driver/cduce.cmx: misc/q_symbol.cmo parser/ast.cmx runtime/eval.cmx types/ident.cmx \
parser/location.cmx parser/parser.cmx types/patterns.cmx types/sample.cmx \
misc/state.cmx typing/typed.cmx typing/typer.cmx types/types.cmx \
runtime/value.cmx parser/wlexer.cmx driver/cduce.cmi
driver/run.cmo: driver/cduce.cmi types/ident.cmo parser/location.cmi \
driver/run.cmo: misc/q_symbol.cmo driver/cduce.cmi types/ident.cmo parser/location.cmi \
types/sequence.cmi misc/state.cmi runtime/value.cmi parser/wlexer.cmo
driver/run.cmx: driver/cduce.cmx types/ident.cmx parser/location.cmx \
driver/run.cmx: misc/q_symbol.cmo driver/cduce.cmx types/ident.cmx parser/location.cmx \
types/sequence.cmx misc/state.cmx runtime/value.cmx parser/wlexer.cmx
driver/webiface.cmo: driver/cduce.cmi driver/examples.cmo parser/location.cmi \
driver/webiface.cmo: misc/q_symbol.cmo driver/cduce.cmi driver/examples.cmo parser/location.cmi \
misc/state.cmi
driver/webiface.cmx: driver/cduce.cmx driver/examples.cmx parser/location.cmx \
driver/webiface.cmx: misc/q_symbol.cmo driver/cduce.cmx driver/examples.cmx parser/location.cmx \
misc/state.cmx
parser/parser.cmi: parser/ast.cmo
typing/typer.cmi: parser/ast.cmo types/ident.cmo parser/location.cmi \
parser/parser.cmi: misc/q_symbol.cmo parser/ast.cmo
typing/typer.cmi: misc/q_symbol.cmo parser/ast.cmo types/ident.cmo parser/location.cmi \
typing/typed.cmo types/types.cmi
types/atoms.cmi: misc/encodings.cmi
types/boolean.cmi: types/sortedList.cmi
types/patterns.cmi: types/atoms.cmi types/chars.cmi types/ident.cmo \
types/atoms.cmi: misc/q_symbol.cmo misc/encodings.cmi
types/boolean.cmi: misc/q_symbol.cmo types/sortedList.cmi
types/patterns.cmi: misc/q_symbol.cmo types/atoms.cmi types/chars.cmi types/ident.cmo \
types/types.cmi
types/sample.cmi: types/types.cmi
types/sequence.cmi: types/atoms.cmi types/types.cmi
types/types.cmi: types/atoms.cmi types/chars.cmi types/ident.cmo \
types/sample.cmi: misc/q_symbol.cmo types/types.cmi
types/sequence.cmi: misc/q_symbol.cmo types/atoms.cmi types/types.cmi
types/types.cmi: misc/q_symbol.cmo types/atoms.cmi types/chars.cmi types/ident.cmo \
types/intervals.cmi types/sortedList.cmi
runtime/eval.cmi: types/ident.cmo typing/typed.cmo runtime/value.cmi
runtime/load_xml.cmi: runtime/value.cmi
runtime/run_dispatch.cmi: types/patterns.cmi runtime/value.cmi
runtime/value.cmi: types/atoms.cmi types/chars.cmi misc/encodings.cmi \
runtime/eval.cmi: misc/q_symbol.cmo types/ident.cmo typing/typed.cmo runtime/value.cmi
runtime/load_xml.cmi: misc/q_symbol.cmo runtime/value.cmi
runtime/run_dispatch.cmi: misc/q_symbol.cmo types/patterns.cmi runtime/value.cmi
runtime/value.cmi: misc/q_symbol.cmo types/atoms.cmi types/chars.cmi misc/encodings.cmi \
types/ident.cmo types/intervals.cmi types/types.cmi
driver/cduce.cmi: types/ident.cmo types/types.cmi runtime/value.cmi
driver/cduce.cmi: misc/q_symbol.cmo types/ident.cmo types/types.cmi runtime/value.cmi
......@@ -7,10 +7,9 @@ let src = ref []
let args = ref []
let version () =
Printf.eprintf "CDuce, version %s\n" Cduce_config.version;
Printf.eprintf "built on %s\n" Cduce_config.build_date;
Printf.eprintf "using OCaml %s compiler\n"
(if Cduce_config.native then "native" else "bytecode");
Printf.eprintf "CDuce, version %s\n" <:symbol<cduce_version>>;
Printf.eprintf "built on %s\n" <:symbol<build_date>>;
Printf.eprintf "using OCaml %s compiler\n" <:symbol<ocaml_compiler>>;
exit 0
let specs =
......@@ -69,7 +68,7 @@ let toploop () =
restore ();
exit 0
in
Format.fprintf ppf " CDuce version %s\n@." Cduce_config.version;
Format.fprintf ppf " CDuce version %s\n@." <:symbol<cduce_version>>;
Unix.tcsetattr Unix.stdin Unix.TCSADRAIN
{ tcio with Unix.c_vquit = '\004' };
Sys.set_signal Sys.sigquit (Sys.Signal_handle (fun _ -> quit ()));
......
......@@ -304,8 +304,8 @@ and uses several OCaml packages:
<a href='http://www.ocaml-programming.de/programming/pxp.html'>PXP</a>,
<a href='http://www.eleves.ens.fr/home/frisch/soft#wlex'>wlex</a>.</p>
<p><a href='mailto:Alain.Frisch@ens.fr'>Webmaster</a></p>
<p>Prototype version "^Cduce_config.version^",
built on "^Cduce_config.build_date^".</p></div>");
<p>Prototype version "^ <:symbol<cduce_version>> ^",
built on "^ <:symbol<build_date>> ^".</p></div>");
html_footer p;
cgi # output # commit_work()
with
......
let version = "%%VERSION%%"
let build_date = "%%BUILD_DATE%%"
let build_host = "%%BUILD_HOST%%"
let native = %%NATIVE%%
let symbols = ref []
let define s =
try
let i = String.index s '=' in
symbols :=
(String.sub s 0 i, String.sub s (i + 1) (String.length s - i - 1)) ::
!symbols
with Not_found ->
failwith ("Invalid symbol definition :" ^ s)
let expr _ s =
try List.assoc s !symbols
with Not_found ->
failwith ("No definition for symbol " ^ s)
let _ =
Quotation.add "symbol" (Quotation.ExStr expr);
Pcaml.add_option "-symbol" (Arg.String define)
"<symbol=value> Define a symbol"
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