From 1233298563ffb1d2b72a7caecd0c6c4e275100eb Mon Sep 17 00:00:00 2001 From: xleroy Date: Sat, 19 Apr 2008 08:29:17 +0000 Subject: Compilo C, preprocesseur, assembleur sont determines par configure et mis dans Makefile.config git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@622 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- caml/Driver.ml | 10 ++++++---- configure | 5 +++++ extraction/Makefile | 6 +++++- runtime/Makefile | 3 +-- test/c/Makefile | 5 +++-- test/cminor/Makefile | 8 +++++--- 6 files changed, 25 insertions(+), 12 deletions(-) diff --git a/caml/Driver.ml b/caml/Driver.ml index 09c4622..659422e 100644 --- a/caml/Driver.ml +++ b/caml/Driver.ml @@ -98,7 +98,8 @@ module Cil2CsyntaxTranslator = Cil2Csyntax.Make(TypeSpecifierTranslator) let preprocess ifile ofile = let cmd = - sprintf "gcc -arch ppc -D__COMPCERT__ -I%s %s -E %s > %s" + sprintf "%s -D__COMPCERT__ -I%s %s %s > %s" + Configuration.prepro !stdlib_path (quote_options !prepro_options) ifile ofile in @@ -190,8 +191,8 @@ let compile_cminor_file ifile ofile = let assemble ifile ofile = let cmd = - sprintf "gcc -arch ppc -c -o %s %s" - ofile ifile in + sprintf "%s -o %s %s" + Configuration.asm ofile ifile in let retcode = command cmd in if not !option_dasm then safe_remove ifile; if retcode <> 0 then begin @@ -204,7 +205,8 @@ let assemble ifile ofile = let linker exe_name files = let cmd = - sprintf "gcc -arch ppc -o %s %s -L%s -lcompcert" + sprintf "%s -o %s %s -L%s -lcompcert" + Configuration.linker (Filename.quote exe_name) (quote_options files) !stdlib_path in diff --git a/configure b/configure index 7214a31..bd1b7bb 100755 --- a/configure +++ b/configure @@ -40,6 +40,11 @@ cat > Makefile.config < ../caml/Configuration.ml + (echo 'let stdlib_path = "$(LIBDIR)"'; \ + echo 'let prepro = "$(CPREPRO)"'; \ + echo 'let asm = "$(CASM)"'; \ + echo 'let linker = "$(CLINKER)"') \ + > ../caml/Configuration.ml beforedepend:: ../caml/Configuration.ml clean:: diff --git a/runtime/Makefile b/runtime/Makefile index 9a3f621..5f1ddc6 100644 --- a/runtime/Makefile +++ b/runtime/Makefile @@ -1,7 +1,6 @@ include ../Makefile.config -CFLAGS=-arch ppc -O1 -g -Wall -#CFLAGS=-O1 -g -Wall +CFLAGS=-O1 -g -Wall OBJS=stdio.o calloc.o LIB=libcompcert.a INCLUDES=stdio.h diff --git a/test/c/Makefile b/test/c/Makefile index 43b7b15..c6cd928 100644 --- a/test/c/Makefile +++ b/test/c/Makefile @@ -1,10 +1,11 @@ +include ../../Makefile.config + CCOMP=../../ccomp CCOMPFLAGS=-stdlib ../../runtime -dclight -dasm -CC=gcc -arch ppc CFLAGS=-O1 -Wall -LIBS= +LIBS=$(LIBMATH) TIME=xtime -o /dev/null -mintime 1.0 # Xavier's hack #TIME=time >/dev/null # Otherwise diff --git a/test/cminor/Makefile b/test/cminor/Makefile index 1d0af21..887d1a9 100644 --- a/test/cminor/Makefile +++ b/test/cminor/Makefile @@ -1,9 +1,11 @@ +include ../../Makefile.config + CCOMP=../../ccomp FLAGS=-S CPP=cpp -P -CC=gcc -CFLAGS=-arch ppc -g -ASFLAGS=-arch ppc +AS=$(CASM) +CFLAGS=-g +ASFLAGS= VPATH=../harness ../lib PROGS=fib integr qsort fft sha1 aes almabench manyargs lists \ -- cgit v1.2.3