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
$(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
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
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