ocaml-clean(argv) =
rm -f *.cm[iox] *.o *.omc *.opt *.run *~ $(argv) *.cmxa *.a *.spot *.annot
+# ------------------------------
+# camlp4 rules
+# ------------------------------
+public.UseCamlp4(files) =
+ protected.CAMLP4CMO = $(addprefix $(ROOT)/camlp4/,$(addsuffix .cmo,$(files)))
+ OCAMLPPFLAGS+=-pp 'camlp4o $(CAMLP4CMO)'
+ OCAMLDEPFLAGS+=$(OCAMLPPFLAGS)
+ export
+
+ .SCANNER: scan-ocaml-%.ml: %.ml $(CAMLP4CMO)
.PHONY: all install config clean distclean example
@echo 'let path_sep="$(PATHSEP)"' >> $@
@echo 'let exe="$(EXE)"' >> $@
-.SUBDIRS: scm xml driver base lib
+.SUBDIRS: scm xml driver base lib camlp4
# ------------------------------
# all
.PHONY: clean
clean:
- rm -f *.cm[iox] *~ *.o *.omc
+ ocaml-clean
########################################################################
# OCaml configuration.
OCAMLINCLUDES += -I +camlp4
#
-# Compile native or byte code?
+# Compile native or byte code?
#
# The default values are defined as follows:
#
# Build an OCaml program
#
OCamlProgram(pa_oo,pa_oo)
-
OCamlProgram(pa_monad,pa_monad)
+++ /dev/null
-runner.opt
\ No newline at end of file
# Various options
#
#OCAMLFLAGS +=
-OCAMLPPFLAGS += -pp 'camlp4o'
-OCAMLDEPFLAGS += $(OCAMLPPFLAGS)
-
+UseCamlp4(pa_oo)
################################################
# Build an OCaml program
let index_u30 x xs=
Bytes.u30 @@ index x xs
-let accessor f =
+let make_accessor f =
let nget value map =
index value @@ PSet.to_list @@ f map in
let get value map =
index_u30 value @@ PSet.to_list @@ f map in
- nget,get
+ (nget,get)
-let int_nget,int_get =
- accessor (fun {int=map}->map)
+let (int_nget,int_get) =
+ make_accessor (fun {int=map}->map)
let uint_nget,uint_get =
- accessor (fun {uint=map}->map)
+ make_accessor (fun {uint=map}->map)
let string_nget,string_get =
- accessor (fun {string=map}->map)
+ make_accessor (fun {string=map}->map)
let double_nget,double_get =
- accessor (fun {double=map}->map)
+ make_accessor (fun {double=map}->map)
let namespace_nget,namespace_get =
- accessor (fun {namespace=map}->map)
+ make_accessor (fun {namespace=map}->map)
let multiname_nget,multiname_get =
- accessor (fun {multiname=map}->map)
+ make_accessor (fun {multiname=map}->map)
let make_qname ?(ns="") x =
QName ((Namespace ns),x)
+
.PHONY: check clean
-.SUBDIRS: test camlp4 src
+.SUBDIRS: test src
.DEFAULT: src/habc-xml$(EXE)
.PHONY: clean
+UseCamlp4(pa_oo)
+
+
########################################################################
# OCaml configuration.
#
# OCAML_BYTE_LINK_FLAGS +=
# OCAML_NATIVE_LINK_FLAGS +=
-
-################################################
-#
-# Camlp4 flags
-#
-
-CAMLP4FILES[] =
- ../camlp4/pa_oo.cmo
-
-OCAMLPPFLAGS += -pp 'camlp4o ../camlp4/pa_oo.cmo'
-OCAMLDEPFLAGS += $(OCAMLPPFLAGS)
-.SCANNER: scan-ocaml-%.ml: %.ml $(CAMLP4FILES)
-
################################################
# Build an OCaml program
#