Browse Source

update makefile to be able to define a target platform prefix

Steffen Jaeckel 12 years ago
parent
commit
d0a83df7f8
1 changed files with 10 additions and 5 deletions
  1. 10 5
      makefile

+ 10 - 5
makefile

@@ -9,8 +9,13 @@ VERSION=1.17
 PLATFORM := $(shell uname | sed -e 's/_.*//')
 PLATFORM := $(shell uname | sed -e 's/_.*//')
 
 
 # Compiler and Linker Names
 # 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]
 # Archiver [makes .a files]
 #AR=ar
 #AR=ar
@@ -23,9 +28,9 @@ endif
 # ranlib tools
 # ranlib tools
 ifndef RANLIB
 ifndef RANLIB
 ifeq ($(PLATFORM), Darwin)
 ifeq ($(PLATFORM), Darwin)
-RANLIB=ranlib -c
+RANLIB=$(PREFIX)ranlib -c
 else
 else
-RANLIB=ranlib
+RANLIB=$(PREFIX)ranlib
 endif
 endif
 endif
 endif
 
 
@@ -274,7 +279,7 @@ library: $(LIBNAME)
 $(OBJECTS): $(HEADERS)
 $(OBJECTS): $(HEADERS)
 
 
 testprof/$(LIBTEST): 
 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)
 $(LIBNAME): $(OBJECTS)
 	$(AR) $(ARFLAGS) $@ $(OBJECTS) 
 	$(AR) $(ARFLAGS) $@ $(OBJECTS)