]> git.saurik.com Git - apple/ld64.git/blobdiff - unit-tests/include/common.makefile
ld64-95.2.12.tar.gz
[apple/ld64.git] / unit-tests / include / common.makefile
old mode 100755 (executable)
new mode 100644 (file)
index 70e05f8..7222efa
@@ -9,16 +9,31 @@ ARCH ?= $(shell arch)
 VALID_ARCHS ?= "ppc ppc64 i386 x86_64 armv6"
 
 MYDIR=$(shell cd ../../bin;pwd)
+LD                     = ld
+OBJECTDUMP     = ObjectDump
+MACHOCHECK     = machocheck
+OTOOL          = otool
+REBASE         = rebase
 
-# if run within Xcode, add the just built tools to the command path
 ifdef BUILT_PRODUCTS_DIR
+       # if run within Xcode, add the just built tools to the command path
        PATH := ${BUILT_PRODUCTS_DIR}:${MYDIR}:${PATH}
        COMPILER_PATH := ${BUILT_PRODUCTS_DIR}:${MYDIR}:${COMPILER_PATH}
+       LD                      = ${BUILT_PRODUCTS_DIR}/ld
+       OBJECTDUMP      = ${BUILT_PRODUCTS_DIR}/ObjectDump
+       MACHOCHECK      = ${BUILT_PRODUCTS_DIR}/machocheck
+       REBASE          = ${BUILT_PRODUCTS_DIR}/rebase
 else
        ifneq "$(findstring /unit-tests/test-cases/, $(shell pwd))" ""
+               # if run from Terminal inside unit-test directory
                RELEASEDIR=$(shell cd ../../../build/Release;pwd)
-               PATH := ${RELEASEDIR}:${MYDIR}:${PATH}
-               COMPILER_PATH := ${RELEASEDIR}:${MYDIR}:${COMPILER_PATH}
+               DEBUGDIR=$(shell cd ../../../build/Debug;pwd)
+               PATH := ${RELEASEDIR}:${DEBUGDIR}:${MYDIR}:${PATH}
+               COMPILER_PATH := ${RELEASEDIR}:${DEBUGDIR}:${MYDIR}:${COMPILER_PATH}
+               LD                      = ${RELEASEDIR}/ld
+               OBJECTDUMP      = ${RELEASEDIR}/ObjectDump
+               MACHOCHECK      = ${RELEASEDIR}/machocheck
+               REBASE          = ${RELEASEDIR}/rebase
        else
                PATH := ${MYDIR}:${PATH}:
                COMPILER_PATH := ${MYDIR}:${COMPILER_PATH}:
@@ -27,27 +42,33 @@ endif
 export PATH
 export COMPILER_PATH
 
-LD                     = ld
-OBJECTDUMP     = ObjectDump
-MACHOCHECK     = machocheck
-OTOOL = otool
 
-CC              = gcc-4.0 -arch ${ARCH}
+CC              = gcc-4.2 -arch ${ARCH} ${SDKExtra}
 CCFLAGS = -Wall -std=c99
 ASMFLAGS =
 
-CXX              = g++-4.0 -arch ${ARCH}
+CXX              = g++-4.2 -arch ${ARCH} ${SDKExtra}
 CXXFLAGS = -Wall
 
 ifeq ($(ARCH),armv6)
-  LDFLAGS := -syslibroot /Developer/SDKs/Purple
+       SDKExtra = -isysroot /Developer/SDKs/Extra
+  LDFLAGS := -syslibroot /Developer/SDKs/Extra
+  override FILEARCH = arm
+else
+  FILEARCH = $(ARCH)
+endif
+
+ifeq ($(ARCH),armv7)
+       SDKExtra = -isysroot /Developer/SDKs/Extra
+  LDFLAGS := -syslibroot /Developer/SDKs/Extra
   override FILEARCH = arm
 else
   FILEARCH = $(ARCH)
 endif
 
 ifeq ($(ARCH),thumb)
-  LDFLAGS := -syslibroot /Developer/SDKs/Purple
+       SDKExtra = -isysroot /Developer/SDKs/Extra
+  LDFLAGS := -syslibroot /Developer/SDKs/Extra
   CCFLAGS += -mthumb
   CXXFLAGS += -mthumb
   override ARCH = armv6
@@ -56,21 +77,33 @@ else
   FILEARCH = $(ARCH)
 endif
 
+ifeq ($(ARCH),thumb2)
+       SDKExtra = -isysroot /Developer/SDKs/Extra
+  LDFLAGS := -syslibroot /Developer/SDKs/Extra
+  CCFLAGS += -mthumb
+  CXXFLAGS += -mthumb
+  override ARCH = armv7
+  override FILEARCH = arm
+       CC = /Volumes/Leopard/Developer/Platforms/iPhoneOS.platform/usr/bin/gcc-4.2 -arch ${ARCH}
+else
+  FILEARCH = $(ARCH)
+endif
+
 RM      = rm
 RMFLAGS = -rf
 
 # utilites for Makefiles
-PASS_IFF                       = pass-iff-exit-zero.pl
+PASS_IFF                       = ${MYDIR}/pass-iff-exit-zero.pl
 PASS_IFF_SUCCESS       = ${PASS_IFF}
-PASS_IFF_EMPTY         = pass-iff-no-stdin.pl
-PASS_IFF_STDIN         = pass-iff-stdin.pl
-FAIL_IFF                       = fail-iff-exit-zero.pl
+PASS_IFF_EMPTY         = ${MYDIR}/pass-iff-no-stdin.pl
+PASS_IFF_STDIN         = ${MYDIR}/pass-iff-stdin.pl
+FAIL_IFF                       = ${MYDIR}/fail-iff-exit-zero.pl
 FAIL_IFF_SUCCESS       = ${FAIL_IFF}
-PASS_IFF_ERROR         = pass-iff-exit-non-zero.pl
-FAIL_IF_ERROR          = fail-if-exit-non-zero.pl
-FAIL_IF_SUCCESS     = fail-if-exit-zero.pl
-FAIL_IF_EMPTY          = fail-if-no-stdin.pl
-FAIL_IF_STDIN          = fail-if-stdin.pl
+PASS_IFF_ERROR         = ${MYDIR}/pass-iff-exit-non-zero.pl
+FAIL_IF_ERROR          = ${MYDIR}/fail-if-exit-non-zero.pl
+FAIL_IF_SUCCESS     = ${MYDIR}/fail-if-exit-zero.pl
+FAIL_IF_EMPTY          = ${MYDIR}/fail-if-no-stdin.pl
+FAIL_IF_STDIN          = ${MYDIR}/fail-if-stdin.pl
 PASS_IFF_GOOD_MACHO    = ${PASS_IFF} ${MACHOCHECK}
 FAIL_IF_BAD_MACHO      = ${FAIL_IF_ERROR} ${MACHOCHECK}
 FAIL_IF_BAD_OBJ                = ${FAIL_IF_ERROR} ${OBJECTDUMP} >/dev/null