X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=bindings%2Focaml%2FMakefile.ocaml;h=c8e826f77e995cc8739c4791ca16f77e17c47082;hb=f368dadd9425de65fea4283daef5d197e98cc1cd;hp=9466c2361ab6a2187af8494cbdba5eeabc18ad59;hpb=4e20a09b6fcf616f1a7bbe0dba4b5fa133b8a5e5;p=oota-llvm.git diff --git a/bindings/ocaml/Makefile.ocaml b/bindings/ocaml/Makefile.ocaml index 9466c2361ab..c8e826f77e9 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 @@ -37,10 +38,16 @@ endif # Tools OCAMLCFLAGS += -I $(OcamlDir) -I $(ObjDir) +ifneq ($(ObjectsO),) OCAMLAFLAGS += $(patsubst %,-cclib %, \ $(filter-out -L$(LibDir),-l$(LIBRARYNAME) \ $(shell $(LLVM_CONFIG) --ldflags)) \ $(UsedLibs)) +else +OCAMLAFLAGS += $(patsubst %,-cclib %, \ + $(filter-out -L$(LibDir),$(shell $(LLVM_CONFIG) --ldflags)) \ + $(UsedLibs)) +endif # -g was introduced in 3.10.0. #ifneq ($(ENABLE_OPTIMIZED),1) @@ -97,7 +104,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) @@ -106,6 +113,7 @@ $(ObjectsCMI): $(UsedOcamlInterfaces:%=$(OcamlDir)/%.cmi) ##===- Build static library from C sources --------------------------------===## +ifneq ($(ObjectsO),) all-local:: $(LibraryA) clean-local:: clean-a install-local:: install-a @@ -129,6 +137,7 @@ install-a:: $(LibraryA) uninstall-a:: $(Echo) "Uninstalling $(DestA)" -$(Verb) $(RM) -f $(DestA) +endif ##===- Deposit dependent libraries adjacent to Ocaml libs -----------------===## @@ -259,7 +268,7 @@ $(ObjDir)/%.cmx: $(ObjDir)/%.ml $(Verb) $(Compile.CMX) $@ $< clean-cmxa:: - $(Verb) $(RM) -f $(OutputCMXA) $(OutputCMXA:.cmxa=.o) $(OutputsCMX) + $(Verb) $(RM) -f $(OutputCMXA) $(OutputCMXA:.cmxa=.a) $(OutputsCMX) install-cmxa:: $(OutputCMXA) $(OutputsCMX) $(Verb) $(MKDIR) $(PROJ_libocamldir) @@ -284,6 +293,13 @@ uninstall-cmxa:: endif +##===- Generate documentation ---------------------------------------------===## + +$(ObjDir)/$(LIBRARYNAME).odoc: $(ObjectsCMI) + $(Echo) "Documenting $(notdir $@)" + $(Verb) $(OCAMLDOC) -I $(OcamlDir) -I $(ObjDir) -dump $@ $(OcamlHeaders) + +ocamldoc: $(ObjDir)/$(LIBRARYNAME).odoc ##===- Debugging gunk -----------------------------------------------------===## printvars:: printcamlvars