From d0a83df7f8538065a86fece1b87ebb98bfd343c0 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 18 Apr 2013 16:41:32 +0200 Subject: [PATCH] update makefile to be able to define a target platform prefix --- makefile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/makefile b/makefile index 6cb8d0b..c75dd2c 100644 --- a/makefile +++ b/makefile @@ -9,8 +9,13 @@ VERSION=1.17 PLATFORM := $(shell uname | sed -e 's/_.*//') # Compiler and Linker Names -#CC=gcc -#LD=ld +ifndef PREFIX + PREFIX= +endif + +CC=$(PREFIX)gcc +LD=$(PREFIX)ld +AR=$(PREFIX)ar # Archiver [makes .a files] #AR=ar @@ -23,9 +28,9 @@ endif # ranlib tools ifndef RANLIB ifeq ($(PLATFORM), Darwin) -RANLIB=ranlib -c +RANLIB=$(PREFIX)ranlib -c else -RANLIB=ranlib +RANLIB=$(PREFIX)ranlib endif endif @@ -274,7 +279,7 @@ library: $(LIBNAME) $(OBJECTS): $(HEADERS) testprof/$(LIBTEST): - cd testprof ; CFLAGS="$(CFLAGS)" LIBTEST_S=$(LIBTEST_S) $(MAKE) + cd testprof ; CFLAGS="$(CFLAGS)" LIBTEST_S=$(LIBTEST_S) CC="$(CC)" LD="$(LD)" AR="$(AR)" RANLIB="$(RANLIB)" $(MAKE) $(LIBNAME): $(OBJECTS) $(AR) $(ARFLAGS) $@ $(OBJECTS)