]>
Commit | Line | Data |
---|---|---|
0959b6d4 A |
1 | # stuff to include in every test Makefile |
2 | ||
3 | SHELL = /bin/sh | |
4 | ||
412ebb8e A |
5 | # set default OS to be current Mac OS X |
6 | OS_NAME ?= MacOSX | |
7 | ifeq "$(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 |
14 | else |
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" |
21 | endif | |
0959b6d4 | 22 | |
832b6fce A |
23 | IOSROOT = |
24 | ||
412ebb8e | 25 | ifeq "$(OS_NAME)" "iPhoneOS" |
2fd3f4e8 | 26 | #IOSROOT = $(shell xcodebuild -version -sdk iphoneos.internal Path) |
df9d6cf7 | 27 | IOSROOT = /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.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 | 33 | else |
df9d6cf7 A |
34 | ifeq "$(OSX_SDK_ROOT)" "" |
35 | OSX_SDK_ROOT = $(shell xcodebuild -version -sdk macosx.internal Path) | |
36 | endif | |
37 | CC = $(shell xcrun -find cc) -arch ${ARCH} -mmacosx-version-min=$(OS_VERSION) -isysroot $(OSX_SDK_ROOT) | |
38 | CXX = $(shell xcrun -find c++) -arch ${ARCH} -mmacosx-version-min=$(OS_VERSION) -isysroot $(OSX_SDK_ROOT) | |
2fd3f4e8 A |
39 | LIPO = $(shell xcrun -find lipo) |
40 | STRIP = $(shell xcrun -find strip) | |
41 | INSTALL_NAME_TOOL = $(shell xcrun -find install_name_tool) | |
412ebb8e | 42 | endif |
bac542e6 | 43 | |
412ebb8e A |
44 | CCFLAGS = -Wall -std=c99 |
45 | CXXFLAGS = -Wall | |
0959b6d4 A |
46 | |
47 | RM = rm | |
48 | RMFLAGS = -rf | |
9e225d03 A |
49 | |
50 | SAFE_RUN = ${TESTROOT}/bin/fail-if-non-zero.pl | |
39a8cd10 | 51 | PASS_IFF = ${TESTROOT}/bin/pass-iff-exit-zero.pl |
412ebb8e A |
52 | PASS_IFF_FAILURE = $(TESTROOT)/bin/exit-non-zero-pass.pl |
53 | ||
54 | ifeq ($(ARCH),armv7) | |
55 | CCFLAGS += -mno-thumb | |
56 | CXXFLAGS += -mno-thumb | |
57 | override FILEARCH = arm | |
58 | else | |
59 | FILEARCH = $(ARCH) | |
60 | endif | |
61 | ||
62 | ifeq ($(ARCH),thumb) | |
63 | CCFLAGS += -mthumb | |
64 | CXXFLAGS += -mthumb | |
65 | override ARCH = armv6 | |
66 | override FILEARCH = arm | |
67 | else | |
68 | FILEARCH = $(ARCH) | |
69 | endif | |
39a8cd10 | 70 | |
412ebb8e A |
71 | ifeq ($(ARCH),thumb2) |
72 | CCFLAGS += -mthumb | |
73 | CXXFLAGS += -mthumb | |
74 | override ARCH = armv7 | |
75 | override FILEARCH = arm | |
76 | else | |
77 | FILEARCH = $(ARCH) | |
78 | endif | |
2fd3f4e8 | 79 |