From 6550b3528c90859d519f2b74391bc606553289c6 Mon Sep 17 00:00:00 2001 From: Vincent Hanquez Date: Fri, 9 Oct 2009 08:33:29 +0100 Subject: [PATCH] compile with ocamlc not gcc. contributed by David Allsopp --- Makefile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index e41bfa7..c4fc114 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,7 @@ -CC = gcc -CFLAGS = -Wall -O3 -funroll-loops +CFLAGS = -Wall -O3 -funroll-loops -I/usr/include OCAMLC = ocamlc OCAMLOPT = ocamlopt -OCAML_PATH = $(shell $(OCAMLC) -where) -CFLAGS += -I $(OCAML_PATH) +OCAMLMKLIB = ocamlmklib OCAMLOPTFLAGS = @@ -67,10 +65,10 @@ sha.test: sha1.cmxa sha256.cmxa sha512.cmxa sha.test.cmx $(OCAMLOPT) $(OCAMLOPTFLAGS) -c -o $@ $< %.o: %.c - $(CC) $(CFLAGS) -c -o $@ $< + $(OCAMLC) -ccopt "$(CFLAGS)" -c -o $@ $< %.lib.o: %.c - $(CC) $(CFLAGS) -c -o $@ $< + $(OCAMLC) -ccopt "$(CFLAGS)" -c -o $@ $< clean: rm -f *.o *.a *.cmo *.cmi *.cma *.cmx *.cmxa sha.test $(PROGRAMS)