]> git.saurik.com Git - apple/dyld.git/blobdiff - unit-tests/include/common.makefile
dyld-195.5.tar.gz
[apple/dyld.git] / unit-tests / include / common.makefile
index f94abba7dca7e28b2971aa2f0d9049d119cb7e43..461ebb0f2602c95d504660588e6c1e2e4ccd703e 100644 (file)
@@ -2,21 +2,66 @@
 
 SHELL = /bin/sh
 
-# set default to be host
-ARCH ?= $(shell arch)
+# set default OS to be current Mac OS X 
+OS_NAME ?= MacOSX
+ifeq "$(OS_NAME)" "iPhoneOS"
+       OS_VERSION ?= 3.1
+       ifeq "$(OS_VERSION)" "4.3"
+               OS_BAROLO_FEATURES = 1
+       endif
+       ARCH ?= armv6
+       VALID_ARCHS ?= armv6
+else
+       OS_VERSION ?= 10.7
+       ifeq "$(OS_VERSION)" "10.7"
+               OS_BAROLO_FEATURES = 1
+       endif
+       ARCH ?= $(shell arch)
+       VALID_ARCHS ?= "i386 x86_64"
+endif
 
-# set default to be all
-VALID_ARCHS ?= "ppc i386 x86_64"
+ifeq "$(OS_NAME)" "iPhoneOS"
+       CC                      = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch ${ARCH} -miphoneos-version-min=$(OS_VERSION) -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.Internal.sdk
+       CXX                     = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-4.2 -arch ${ARCH} -miphoneos-version-min=$(OS_VERSION) -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.Internal.sdk
+#      CC                      = gcc-4.2 -arch ${ARCH} -miphoneos-version-min=$(OS_VERSION)
+#      CXX                     = g++-4.2 -arch ${ARCH} -miphoneos-version-min=$(OS_VERSION)
+else
+       CC                      = gcc-4.2 -arch ${ARCH} -mmacosx-version-min=$(OS_VERSION)
+       CXX                     = g++-4.2 -arch ${ARCH} -mmacosx-version-min=$(OS_VERSION)
+endif
 
-CC              = gcc-4.2 -arch ${ARCH}
-CCFLAGS = -Wall -std=c99
-
-CXX              = g++-4.2 -arch ${ARCH}
-CXXFLAGS = -Wall 
+CCFLAGS                = -Wall -std=c99
+CXXFLAGS       = -Wall 
 
 RM      = rm
 RMFLAGS = -rf
 
 SAFE_RUN       = ${TESTROOT}/bin/fail-if-non-zero.pl
 PASS_IFF       = ${TESTROOT}/bin/pass-iff-exit-zero.pl
+PASS_IFF_FAILURE = $(TESTROOT)/bin/exit-non-zero-pass.pl
+
+ifeq ($(ARCH),armv7)
+  CCFLAGS += -mno-thumb
+  CXXFLAGS += -mno-thumb
+  override FILEARCH = arm
+else
+  FILEARCH = $(ARCH)
+endif
+
+ifeq ($(ARCH),thumb)
+  CCFLAGS += -mthumb
+  CXXFLAGS += -mthumb
+  override ARCH = armv6
+  override FILEARCH = arm
+else
+  FILEARCH = $(ARCH)
+endif
 
+ifeq ($(ARCH),thumb2)
+  CCFLAGS += -mthumb
+  CXXFLAGS += -mthumb
+  override ARCH = armv7
+  override FILEARCH = arm
+else
+  FILEARCH = $(ARCH)
+endif