1 # stuff to include in every test Makefile
5 # set default to be host
8 # set default to be all
9 VALID_ARCHS ?= "i386 x86_64 armv6"
11 MYDIR=$(shell cd ../../bin;pwd)
13 OBJECTDUMP = ObjectDump
14 MACHOCHECK = machocheck
19 ifdef BUILT_PRODUCTS_DIR
20 # if run within Xcode, add the just built tools to the command path
21 PATH := ${BUILT_PRODUCTS_DIR}:${MYDIR}:${PATH}
22 COMPILER_PATH := ${BUILT_PRODUCTS_DIR}:${MYDIR}:${COMPILER_PATH}
23 LD = ${BUILT_PRODUCTS_DIR}/ld
24 OBJECTDUMP = ${BUILT_PRODUCTS_DIR}/ObjectDump
25 MACHOCHECK = ${BUILT_PRODUCTS_DIR}/machocheck
26 REBASE = ${BUILT_PRODUCTS_DIR}/rebase
27 UNWINDDUMP = ${BUILT_PRODUCTS_DIR}/unwinddump
28 DYLDINFO = ${BUILT_PRODUCTS_DIR}/dyldinfo
30 ifneq "$(findstring /unit-tests/test-cases/, $(shell pwd))" ""
31 # if run from Terminal inside unit-test directory
32 RELEASEDIR=$(shell cd ../../../build/Release;pwd)
33 RELEASEADIR=$(shell cd ../../../build/Release-assert;pwd)
34 DEBUGDIR=$(shell cd ../../../build/Debug;pwd)
35 PATH := ${RELEASEADIR}:${RELEASEDIR}:${DEBUGDIR}:${MYDIR}:${PATH}
36 COMPILER_PATH := ${RELEASEADIR}:${RELEASEDIR}:${DEBUGDIR}:${MYDIR}:${COMPILER_PATH}
38 OBJECTDUMP = ${DEBUGDIR}/ObjectDump
39 MACHOCHECK = ${DEBUGDIR}/machocheck
40 REBASE = ${DEBUGDIR}/rebase
41 UNWINDDUMP = ${DEBUGDIR}/unwinddump
42 DYLDINFO = ${DEBUGDIR}/dyldinfo
44 PATH := ${MYDIR}:${PATH}:
45 COMPILER_PATH := ${MYDIR}:${COMPILER_PATH}:
52 SDKExtra = -isysroot /Developer/SDKs/MacOSX10.6.sdk
55 CC = cc -arch ${ARCH} ${SDKExtra}
56 CCFLAGS = -Wall -std=c99
59 CXX = c++ -arch ${ARCH} ${SDKExtra}
63 SDKExtra = -isysroot /Developer/SDKs/Extra
64 LDFLAGS := -syslibroot /Developer/SDKs/Extra
65 override FILEARCH = arm
71 SDKExtra = -isysroot /Developer/SDKs/Extra
72 LDFLAGS := -syslibroot /Developer/SDKs/Extra
73 override FILEARCH = arm
79 SDKExtra = -isysroot /Developer/SDKs/Extra
80 LDFLAGS := -syslibroot /Developer/SDKs/Extra
84 override FILEARCH = arm
90 SDKExtra = -isysroot /Developer/SDKs/Extra
91 LDFLAGS := -syslibroot /Developer/SDKs/Extra
95 override FILEARCH = arm
96 CC = /Volumes/Leopard/Developer/Platforms/iPhoneOS.platform/usr/bin/gcc-4.2 -arch ${ARCH}
105 # utilites for Makefiles
106 PASS_IFF = ${MYDIR}/pass-iff-exit-zero.pl
107 PASS_IFF_SUCCESS = ${PASS_IFF}
108 PASS_IFF_EMPTY = ${MYDIR}/pass-iff-no-stdin.pl
109 PASS_IFF_STDIN = ${MYDIR}/pass-iff-stdin.pl
110 FAIL_IFF = ${MYDIR}/fail-iff-exit-zero.pl
111 FAIL_IFF_SUCCESS = ${FAIL_IFF}
112 PASS_IFF_ERROR = ${MYDIR}/pass-iff-exit-non-zero.pl
113 FAIL_IF_ERROR = ${MYDIR}/fail-if-exit-non-zero.pl
114 FAIL_IF_SUCCESS = ${MYDIR}/fail-if-exit-zero.pl
115 FAIL_IF_EMPTY = ${MYDIR}/fail-if-no-stdin.pl
116 FAIL_IF_STDIN = ${MYDIR}/fail-if-stdin.pl
117 PASS_IFF_GOOD_MACHO = ${PASS_IFF} ${MACHOCHECK}
118 FAIL_IF_BAD_MACHO = ${FAIL_IF_ERROR} ${MACHOCHECK}
119 FAIL_IF_BAD_OBJ = ${FAIL_IF_ERROR} ${OBJECTDUMP} >/dev/null