]> git.saurik.com Git - apple/dyld.git/blame - unit-tests/include/common.makefile
dyld-353.2.3.tar.gz
[apple/dyld.git] / unit-tests / include / common.makefile
CommitLineData
0959b6d4
A
1# stuff to include in every test Makefile
2
3SHELL = /bin/sh
4
412ebb8e
A
5# set default OS to be current Mac OS X
6OS_NAME ?= MacOSX
7ifeq "$(OS_NAME)" "iPhoneOS"
8 OS_VERSION ?= 3.1
832b6fce
A
9 ifeq "$(findstring -$(OS_VERSION)-,-3.0-3.1-3.2-4.0-4.1-4.2-4.3-)" ""
10 OS_LION_FEATURES = 1
412ebb8e 11 endif
832b6fce
A
12 ARCH ?= armv7
13 VALID_ARCHS ?= armv7
412ebb8e
A
14else
15 OS_VERSION ?= 10.7
832b6fce
A
16 ifeq "$(findstring -$(OS_VERSION)-,-10.4-10.5-10.6-)" ""
17 OS_LION_FEATURES = 1
412ebb8e 18 endif
832b6fce 19 ARCH ?= x86_64
412ebb8e
A
20 VALID_ARCHS ?= "i386 x86_64"
21endif
0959b6d4 22
832b6fce
A
23IOSROOT =
24
412ebb8e 25ifeq "$(OS_NAME)" "iPhoneOS"
2fd3f4e8 26 #IOSROOT = $(shell xcodebuild -version -sdk iphoneos.internal Path)
19894a12 27 IOSROOT = /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.Internal.sdk
2fd3f4e8
A
28 CC = $(shell xcrun -sdk iphoneos.internal -find cc) -arch ${ARCH} -miphoneos-version-min=$(OS_VERSION) -isysroot $(IOSROOT)
29 CXX = $(shell xcrun -sdk iphoneos.internal -find c++) -arch ${ARCH} -miphoneos-version-min=$(OS_VERSION) -isysroot $(IOSROOT)
30 LIPO = $(shell xcrun -sdk iphoneos.internal -find lipo)
31 STRIP = $(shell xcrun -sdk iphoneos.internal -find strip)
32 INSTALL_NAME_TOOL = $(shell xcrun -sdk iphoneos.internal -find install_name_tool)
412ebb8e 33else
2fd3f4e8
A
34 CC = $(shell xcrun -find cc) -arch ${ARCH} -mmacosx-version-min=$(OS_VERSION)
35 CXX = $(shell xcrun -find c++) -arch ${ARCH} -mmacosx-version-min=$(OS_VERSION)
36 LIPO = $(shell xcrun -find lipo)
37 STRIP = $(shell xcrun -find strip)
38 INSTALL_NAME_TOOL = $(shell xcrun -find install_name_tool)
412ebb8e 39endif
bac542e6 40
412ebb8e
A
41CCFLAGS = -Wall -std=c99
42CXXFLAGS = -Wall
0959b6d4
A
43
44RM = rm
45RMFLAGS = -rf
9e225d03
A
46
47SAFE_RUN = ${TESTROOT}/bin/fail-if-non-zero.pl
39a8cd10 48PASS_IFF = ${TESTROOT}/bin/pass-iff-exit-zero.pl
412ebb8e
A
49PASS_IFF_FAILURE = $(TESTROOT)/bin/exit-non-zero-pass.pl
50
51ifeq ($(ARCH),armv7)
52 CCFLAGS += -mno-thumb
53 CXXFLAGS += -mno-thumb
54 override FILEARCH = arm
55else
56 FILEARCH = $(ARCH)
57endif
58
59ifeq ($(ARCH),thumb)
60 CCFLAGS += -mthumb
61 CXXFLAGS += -mthumb
62 override ARCH = armv6
63 override FILEARCH = arm
64else
65 FILEARCH = $(ARCH)
66endif
39a8cd10 67
412ebb8e
A
68ifeq ($(ARCH),thumb2)
69 CCFLAGS += -mthumb
70 CXXFLAGS += -mthumb
71 override ARCH = armv7
72 override FILEARCH = arm
73else
74 FILEARCH = $(ARCH)
75endif
2fd3f4e8 76