Commit 1bc7d0b1 authored by gerd's avatar gerd

Updated.


git-svn-id: https://godirepo.camlcity.org/svn/lib-pxp/trunk@381 dbe99aee-44db-0310-b2b3-d33182c8eb97
parent 1edbed18
......@@ -4,13 +4,22 @@ all:
clean:
distclean:
$(MAKE) -C pxp distclean
$(MAKE) -C pxp-engine distclean
$(MAKE) -C pxp-lex-iso88591 distclean
$(MAKE) -C pxp-lex-utf8 distclean
$(MAKE) -C pxp-wlex distclean
CLEAN:
$(MAKE) -C pxp CLEAN
$(MAKE) -C pxp-engine CLEAN
$(MAKE) -C pxp-lex-iso88591 CLEAN
$(MAKE) -C pxp-lex-utf8 CLEAN
$(MAKE) -C pxp-wlex CLEAN
uninstall:
$(MAKE) -C pxp uninstall
$(MAKE) -C pxp-engine uninstall
$(MAKE) -C pxp-lex-iso88591 uninstall
$(MAKE) -C pxp-lex-utf8 uninstall
$(MAKE) -C pxp-wlex uninstall
......@@ -56,6 +56,7 @@ clean:
rm -f $(FROM_GENERIC)
rm -f pxp_lex_aux_iso88591.ml
rm -f insertion_done
rm -f META
CLEAN: clean
......@@ -63,3 +64,10 @@ distclean: clean
depend: *.ml
$(OCAMLDEP) *.ml >depend
install:
files=`$(COLLECT_FILES) *.cmi *.cma *.cmxa *.a pxp_lex_link_iso88591.cmo pxp_lex_link_iso88591.cmx pxp_lex_link_iso88591.o META` && \
$(OCAMLFIND) install pxp-lex-iso88591 $$files
uninstall:
$(OCAMLFIND) remove pxp-lex-iso88591
......@@ -4,3 +4,5 @@ version = "@VERSION@"
archive(byte) = "pxp_lex_utf8.cma pxp_lex_link_utf8.cmo"
archive(native) = "pxp_lex_utf8.cmxa pxp_lex_link_utf8.cmx"
archive(byte,pxp_without_utf8) = ""
archive(native,pxp_without_utf8) = ""
......@@ -57,6 +57,7 @@ clean:
rm -f pxp_lex_aux_utf8.ml
rm -f insertion_done
rm -f pxp_lex_defs_utf8.def
rm -f META
CLEAN: clean
......@@ -69,3 +70,10 @@ depend: *.ml
pxp_lex_defs_utf8.def: pxp_lex_defs_generic.def pxp_lex_defs_drv_utf8.def
$(UCS2_TO_UTF8) pxp_lex_defs_generic.def pxp_lex_defs_utf8.def
cat pxp_lex_defs_drv_utf8.def >>pxp_lex_defs_utf8.def
install:
files=`$(COLLECT_FILES) *.cmi *.cma *.cmxa *.a pxp_lex_link_utf8.cmo pxp_lex_link_utf8.cmx pxp_lex_link_utf8.o META` && \
$(OCAMLFIND) install pxp-lex-utf8 $$files
uninstall:
$(OCAMLFIND) remove pxp-lex-utf8
......@@ -4,59 +4,34 @@
#----------------------------------------------------------------------
TOP_DIR = ../../..
include $(TOP_DIR)/Makefile.rules
SRC = ast.ml lexer.ml parser.ml generator.ml
OBJ = $(SRC:.ml=.cmo)
#----------------------------------------------------------------------
.PHONY: all
all: m2parsergen
all: m2parsergen$(EXEC_SUFFIX)
.PHONY: clean
clean:
rm -f *.cmi *.cmo *.cma *.cmx *.o *.a *.cmxa lexer.ml parser.ml \
parser.mli
rm -f $(CLEAN_LIST) lexer.ml parser.ml parser.mli
rm -f depend m2parsergen$(EXEC_SUFFIX) a.out x.ml
.PHONY: CLEAN
CLEAN: clean
.PHONY: distclean
distclean: clean
rm -f *~ depend depend.pkg m2parsergen a.out x.ml
#----------------------------------------------------------------------
# general rules:
OPTIONS =
OCAMLC = ocamlc -g $(OPTIONS) $(ROPTIONS)
OCAMLOPT = ocamlopt -p $(OPTIONS) $(ROPTIONS)
OCAMLDEP = ocamldep $(OPTIONS)
OCAMLFIND = ocamlfind
#----------------------------------------------------------------------
depend: $(SRC)
$(OCAMLDEP) $(SRC) >depend
m2parsergen: $(OBJ)
$(OCAMLC) -o m2parsergen $(OBJ)
.SUFFIXES: .cmo .cmi .cmx .ml .mli .mll .mly
.ml.cmx:
$(OCAMLOPT) -c $<
.ml.cmo:
$(OCAMLC) -c $<
.mli.cmi:
$(OCAMLC) -c $<
.mll.ml:
ocamllex $<
m2parsergen$(EXEC_SUFFIX): $(OBJ)
$(OCAMLC) -o m2parsergen$(EXEC_SUFFIX) $(OBJ)
.mly.ml:
ocamlyacc $<
# Include dependencies:
include depend
......@@ -14,7 +14,7 @@ type token =
r():
one:s()
{{ }}
$ {{ }}
b:B
two:B?
three:s()
......@@ -23,13 +23,13 @@ r():
s():
A
{{ }}
$ {{ }}
{{ prerr_endline "A"; 0 }}
| B
{{ }}
$ {{ }}
{{ prerr_endline "B"; 0 }}
| n:C
{{ }}
$ {{ }}
{{ prerr_endline ("C: " ^ string_of_int n); n }}
%%
......
......@@ -3,14 +3,13 @@
#(* 14/05/2000 *)
#(******************************************************)
OCAMLC = ocamlc
OCAMLOPT = ocamlopt
OCAMLDEP = ocamldep
OCAMLLEX = ocamllex
OCAMLYACC = ocamlyacc
# [14-Jun-2001] Modified by Gerd Stolpmann
all: ucs2_to_utf8
opt: ucs2_to_utf8.opt
TOP_DIR = ../../..
include $(TOP_DIR)/Makefile.rules
all: ucs2_to_utf8$(EXEC_SUFFIX)
opt: ucs2_to_utf8.opt$(EXEC_SUFFIX)
DEPOBJS = ucs2_to_utf8.ml lexer.ml parser.ml parser.mli types.ml
......@@ -29,22 +28,18 @@ parser.mli:
depend: lexer.ml parser.ml parser.mli
$(OCAMLDEP) $(DEPOBJS) > depend
ucs2_to_utf8: $(UCS2_TO_UTF8OBJS)
$(OCAMLC) -o ucs2_to_utf8 $(UCS2_TO_UTF8OBJS)
ucs2_to_utf8.opt: $(UCS2_TO_UTF8OPTOBJS)
$(OCAMLOPT) -o ucs2_to_utf8.opt $(UCS2_TO_UTF8OPTOBJS)
ucs2_to_utf8$(EXEC_SUFFIX): $(UCS2_TO_UTF8OBJS)
$(OCAMLC) -o ucs2_to_utf8$(EXEC_SUFFIX) $(UCS2_TO_UTF8OBJS)
.SUFFIXES: .ml .mli .cmo .cmi .cmx
.ml.cmo:
$(OCAMLC) -c $<
.mli.cmi:
$(OCAMLC) -c $<
.ml.cmx:
$(OCAMLOPT) -c $<
ucs2_to_utf8.opt$(EXEC_SUFFIX): $(UCS2_TO_UTF8OPTOBJS)
$(OCAMLOPT) -o ucs2_to_utf8.opt$(EXEC_SUFFIX) $(UCS2_TO_UTF8OPTOBJS)
clean:
rm -f *.cm[iox] *.o lexer.ml parser.ml parser.mli \
ucs2_to_utf8 ucs2_to_utf8.opt
rm -f $(CLEAN_LIST) lexer.ml parser.ml parser.mli \
ucs2_to_utf8$(EXEC_SUFFIX) ucs2_to_utf8.opt$(EXEC_SUFFIX)
CLEAN: clean
distclean: clean
include depend
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