Skip to content

Commit

Permalink
Fix compiling the ocaml kaleidoscope tutorials
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125202 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Erick Tryzelaar committed Feb 9, 2011
1 parent ffeb98a commit 01b4ccb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bindings/ocaml/Makefile.ocaml
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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

Expand Down
9 changes: 9 additions & 0 deletions examples/OCaml-Kaleidoscope/Chapter6/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions examples/OCaml-Kaleidoscope/Chapter7/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 01b4ccb

Please sign in to comment.