Commit 30d81c6b authored by Pietro Abate's avatar Pietro Abate

[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 1d92f641
......@@ -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) $<
......
This diff is collapsed.
......@@ -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