Fix compiling the ocaml kaleidoscope tutorials
authorErick Tryzelaar <idadesub@users.sourceforge.net>
Wed, 9 Feb 2011 18:32:02 +0000 (18:32 +0000)
committerErick Tryzelaar <idadesub@users.sourceforge.net>
Wed, 9 Feb 2011 18:32:02 +0000 (18:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125202 91177308-0d34-0410-b5e6-96231b3b80d8

bindings/ocaml/Makefile.ocaml
examples/OCaml-Kaleidoscope/Chapter6/Makefile
examples/OCaml-Kaleidoscope/Chapter7/Makefile

index 1cff422c28d400138e52255eb91873dca1e6fb06..40ecc9c08e0912f50647f935b9b25d84958da1f7 100644 (file)
@@ -73,8 +73,13 @@ Archive.EXE := $(strip $(OCAMLC) -cc $(CXX) $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG:%=%.
 endif
 
 # Source files
+ifndef OcamlSources1
 OcamlSources1 := $(sort $(wildcard $(PROJ_SRC_DIR)/*.ml))
+endif
+
+ifndef OcamlHeaders1
 OcamlHeaders1 := $(sort $(wildcard $(PROJ_SRC_DIR)/*.mli))
+endif
 
 OcamlSources2 := $(filter-out $(ExcludeSources),$(OcamlSources1))
 OcamlHeaders2 := $(filter-out $(ExcludeHeaders),$(OcamlHeaders1))
@@ -352,11 +357,11 @@ $(OutputEXE): $(ToolEXE) $(OcamlDir)/.dir
 ifndef OCAMLOPT
 $(ToolEXE): $(ObjectsCMO) $(OcamlDir)/.dir
        $(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
-       $(Verb) $(Archive.EXE) $@ $<
+       $(Verb) $(Archive.EXE) $@ $(ObjectsCMO)
 else
 $(ToolEXE): $(ObjectsCMX) $(OcamlDir)/.dir
        $(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
-       $(Verb) $(Archive.EXE) $@ $<
+       $(Verb) $(Archive.EXE) $@ $(ObjectsCMX)
 endif
 endif
 
index 831213863a6e26d31eee7b786f2ed2c1db91b570..21f0c53df4b9d5bf2cd62196ae62f86f3ed6fac0 100644 (file)
@@ -20,6 +20,15 @@ UsedOcamLibs := llvm llvm_analysis llvm_executionengine llvm_target \
 
 OCAMLCFLAGS += -pp camlp4of
 
+OcamlSources1 = \
+       $(PROJ_SRC_DIR)/ast.ml \
+       $(PROJ_SRC_DIR)/parser.ml \
+       $(PROJ_SRC_DIR)/codegen.ml \
+       $(PROJ_SRC_DIR)/lexer.ml \
+       $(PROJ_SRC_DIR)/token.ml \
+       $(PROJ_SRC_DIR)/toplevel.ml \
+       $(PROJ_SRC_DIR)/toy.ml
+
 ExcludeSources = $(PROJ_SRC_DIR)/myocamlbuild.ml
 
 include $(LEVEL)/bindings/ocaml/Makefile.ocaml
index ddf667b0e123a7ca3782f1519984de5b435faf7d..99686e17ea80d5fa785cb13a129d9930147feef1 100644 (file)
@@ -20,6 +20,15 @@ UsedOcamLibs := llvm llvm_analysis llvm_executionengine llvm_target \
 
 OCAMLCFLAGS += -pp camlp4of
 
+OcamlSources1 = \
+       $(PROJ_SRC_DIR)/ast.ml \
+       $(PROJ_SRC_DIR)/parser.ml \
+       $(PROJ_SRC_DIR)/codegen.ml \
+       $(PROJ_SRC_DIR)/lexer.ml \
+       $(PROJ_SRC_DIR)/token.ml \
+       $(PROJ_SRC_DIR)/toplevel.ml \
+       $(PROJ_SRC_DIR)/toy.ml
+
 ExcludeSources = $(PROJ_SRC_DIR)/myocamlbuild.ml
 
 include $(LEVEL)/bindings/ocaml/Makefile.ocaml