Commits

Anonymous committed 8f96853

Adding the link options necessary for llvm.

Comments (0)

Files changed (1)

 OCAMLYACC=ocamlyacc
 OCAMLDEP=ocamldep
 OCAMLFIND=ocamlfind
+OCAMLFLAGS=-cc g++
 INCLUDES=-package extlib,unix 
 LINKFLAGS=-linkpkg
 OCAMLOPTFLAGS=
 .SUFFIXES:
 
 %.cmi: %.mli
-	$(OCAMLFIND) $(OCAMLOPT) $(INCLUDES) $(OCAMLOPTFLAGS) -c $<
+	$(OCAMLFIND) $(OCAMLOPT) $(OCAMLFLAGS) $(INCLUDES) $(OCAMLOPTFLAGS) -c $<
 
 %.cmo: %.ml
-	$(OCAMLFIND) $(OCAMLC) $(INCLUDES) $(OCAMLFLAGS) -c $<
+	$(OCAMLFIND) $(OCAMLC) $(OCAMLFLAGS) $(INCLUDES) $(OCAMLFLAGS) -c $<
 
 %.cmx %.o: %.ml
-	$(OCAMLFIND) $(OCAMLOPT) $(INCLUDES) $(OCAMLOPTFLAGS) -c $<
+	$(OCAMLFIND) $(OCAMLOPT) $(OCAMLFLAGS) $(INCLUDES) $(OCAMLOPTFLAGS) -c $<
 
 %.mli %.ml: %.mly
 	$(OCAMLYACC) $<
 
 all : interpreter test
 
+LLVMMODULES:=llvm_bitwriter llvm_executionengine llvm
+LLVMOC:=$(LLVMMODULES:%=%.cmxa)
+LLVML:=$(addprefix -cclib ,$(LLVMMODULES:%=-l%))
 interpreter : $(CMX_FILES)
-	$(OCAMLFIND) $(OCAMLOPT) $(INCLUDES) $(LINKFLAGS) -o interpreter $(OCAMLOPTFLAGS) $^
+	$(OCAMLFIND) $(OCAMLOPT) $(OCAMLFLAGS) $(INCLUDES) $(LINKFLAGS) -o interpreter $(LLVMOC) $(OCAMLOPTFLAGS) $^ $(LLVML)
 
 test : interpreter $(SCM_FILES)
 	./interpreter $(SCM_FILES) --no-repl