From: Prashanth Mundkur Date: Tue, 23 Jun 2009 16:40:50 +0000 (-0700) Subject: [json-rpc] The json_conv and rpc generator are compiled to bytecode so that X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=43f16ae69d3e81525ee919e857b8404dab478b97;p=xenclient%2Ftoolstack.git [json-rpc] The json_conv and rpc generator are compiled to bytecode so that they may be invoked in the 2 environments (buildroot + host). We could potentially move this to the toolchain directory once it stabilizes. For the moment, having everything in toolstack.git compiled with the toolchain compiler is perhaps simpler. [Makefile.rules] The bytecode dependencies have been added as prg_BYTE_LIBS in Makefile.rules. Conflicts: gen/rpc/Makefile --- diff --git a/Makefile.rules b/Makefile.rules index de84067..ee06b73 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -77,7 +77,7 @@ define OCAML_PROGRAM_template $(1): $(foreach obj,$($(1)_OBJS),$(obj).cmx) $($(1)_EXTRA_DEPS) $(call quiet-command, $(OCAMLOPT) $(OCAMLOPTFLAGS) -o $$@ $($(1)_LIBS) $$+,MLBIN,$$@) $(1).byte: $(foreach obj,$($(1)_OBJS),$(obj).cmo) - $(call quiet-command, $(OCAMLC) $(OCAMLCFLAGS) -o $$@ $$+,MLBIN,$$@) + $(call quiet-command, $(OCAMLC) $(OCAMLCFLAGS) -o $$@ $($(1)_BYTE_LIBS) $$+,MLBIN,$$@) endef define C_PROGRAM_template diff --git a/gen/json_conv/Makefile b/gen/json_conv/Makefile index 5fa6ed5..6f022f9 100644 --- a/gen/json_conv/Makefile +++ b/gen/json_conv/Makefile @@ -1,19 +1,19 @@ TOPLEVEL=../.. include $(TOPLEVEL)/common.make -GENERATED_FILES = lexer.ml parser.mli parser.ml - gen_json_conv_OBJS = syntax lexer parser codegen gen_json_conv gen_json_conv_LIBS = unix.cmxa +gen_json_conv_BYTE_LIBS = unix.cma ALL_OCAML_OBJS = $(gen_json_conv_OBJS) OCAML_PROGRAM = gen_json_conv PROGRAMS = $(OCAML_PROGRAM) +GENERATED_FILES = lexer.ml parser.mli parser.ml -all: $(PROGRAMS) +all: $(PROGRAMS) gen_json_conv.byte -bins: $(PROGRAMS) +bins: gen_json_conv include $(TOPLEVEL)/Makefile.rules diff --git a/gen/rpc/Makefile b/gen/rpc/Makefile index 5ef3192..8cfc548 100644 --- a/gen/rpc/Makefile +++ b/gen/rpc/Makefile @@ -11,15 +11,16 @@ OCAMLINCLUDE += -I $(TOPLEVEL)/libs/json gen_rpc_OBJS = syntax syntax_json_conv rpc_decl codegen gen_rpc gen_rpc_LIBS = unix.cmxa $(TOPLEVEL)/libs/json/json.cmxa +gen_rpc_BYTE_LIBS = unix.cma $(TOPLEVEL)/libs/json/json.cma ALL_OCAML_OBJS = $(gen_rpc_OBJS) OCAML_PROGRAM = gen_rpc -PROGRAMS = $(OCAML_PROGRAM) +PROGRAMS = $(OCAML_PROGRAM) gen_rpc.byte all: $(PROGRAMS) -bins: $(PROGRAMS) +bins: gen_rpc include $(TOPLEVEL)/Makefile.rules