X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=bindings%2Focaml%2FMakefile.ocaml;h=9b7e19f571c151c4610eb4b4f19b8994a6779b78;hp=b7f4fdec29fcdfdbfb2e08ebfbea5911583f5bf8;hb=e6074a027fd78939cc69a8c5db72f789b4e1b2c7;hpb=516276edd4adadf8d521ae6ba29713dacc353c0a diff --git a/bindings/ocaml/Makefile.ocaml b/bindings/ocaml/Makefile.ocaml index b7f4fdec29f..9b7e19f571c 100644 --- a/bindings/ocaml/Makefile.ocaml +++ b/bindings/ocaml/Makefile.ocaml @@ -2,8 +2,8 @@ # # The LLVM Compiler Infrastructure # -# This file was developed by Gordon Henriksen and is distributed under the -# University of Illinois Open Source License. See LICENSE.TXT for details. +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. # ##===----------------------------------------------------------------------===## # @@ -20,7 +20,8 @@ include $(LEVEL)/Makefile.config # CFLAGS needs to be set before Makefile.rules is included. -CFLAGS += -I$(shell $(OCAMLC) -where) +CXX.Flags += -I"$(shell $(OCAMLC) -where)" +C.Flags += -I"$(shell $(OCAMLC) -where)" include $(LEVEL)/Makefile.common @@ -41,13 +42,19 @@ OCAMLAFLAGS += $(patsubst %,-cclib %, \ $(filter-out -L$(LibDir),-l$(LIBRARYNAME) \ $(shell $(LLVM_CONFIG) --ldflags)) \ $(UsedLibs)) + +# -g was introduced in 3.10.0. +#ifneq ($(ENABLE_OPTIMIZED),1) +# OCAMLDEBUGFLAG := -g +#endif -Compile.CMI := $(strip $(OCAMLC) -c $(OCAMLCFLAGS) -o) -Compile.CMO := $(strip $(OCAMLC) -c $(OCAMLCFLAGS) -o) -Archive.CMA := $(strip $(OCAMLC) -a -custom $(OCAMLAFLAGS) -o) +Compile.CMI := $(strip $(OCAMLC) -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o) +Compile.CMO := $(strip $(OCAMLC) -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o) +Archive.CMA := $(strip $(OCAMLC) -a -custom $(OCAMLAFLAGS) $(OCAMLDEBUGFLAG) \ + -o) -Compile.CMX := $(strip $(OCAMLOPT) -c $(OCAMLCFLAGS) -o) -Archive.CMXA := $(strip $(OCAMLOPT) -a $(OCAMLAFLAGS) -o) +Compile.CMX := $(strip $(OCAMLOPT) -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o) +Archive.CMXA := $(strip $(OCAMLOPT) -a $(OCAMLAFLAGS) $(OCAMLDEBUGFLAG) -o) # Source files OcamlSources1 := $(sort $(wildcard $(PROJ_SRC_DIR)/*.ml)) @@ -91,7 +98,7 @@ $(ObjDir)/%.ml: $(PROJ_SRC_DIR)/%.ml $(ObjDir)/.dir $(ObjDir)/$(LIBRARYNAME).ocamldep: $(OcamlSources) $(OcamlHeaders) \ $(OcamlDir)/.dir $(ObjDir)/.dir - $(Verb) $(OCAMLDEP) $(OCAMLCFLAGS) $(OcamlSources) $(OcamlHeader) > $@ + $(Verb) $(OCAMLDEP) $(OCAMLCFLAGS) $(OcamlSources) $(OcamlHeaders) > $@ $(ObjectsCMI): $(UsedOcamlInterfaces:%=$(OcamlDir)/%.cmi) @@ -137,6 +144,9 @@ build-deplibs: $(OutputLibs) $(OcamlDir)/%.a: $(LibDir)/%.a $(Verb) ln -sf $< $@ +$(OcamlDir)/%.o: $(LibDir)/%.o + $(Verb) ln -sf $< $@ + clean-deplibs: $(Verb) rm -f $(OutputLibs)