1 # stuff to include in every test Makefile
5 # set default to be host
8 # set default to be all
9 VALID_ARCHS ?= "ppc ppc64 i386 x86_64 armv6"
11 MYDIR=$(shell cd ../../bin;pwd)
13 OBJECTDUMP = ObjectDump
14 MACHOCHECK = machocheck
18 ifdef BUILT_PRODUCTS_DIR
19 # if run within Xcode, add the just built tools to the command path
20 PATH := ${BUILT_PRODUCTS_DIR}:${MYDIR}:${PATH}
21 COMPILER_PATH := ${BUILT_PRODUCTS_DIR}:${MYDIR}:${COMPILER_PATH}
22 LD = ${BUILT_PRODUCTS_DIR}/ld
23 OBJECTDUMP = ${BUILT_PRODUCTS_DIR}/ObjectDump
24 MACHOCHECK = ${BUILT_PRODUCTS_DIR}/machocheck
25 REBASE = ${BUILT_PRODUCTS_DIR}/rebase
27 ifneq "$(findstring /unit-tests/test-cases/, $(shell pwd))" ""
28 # if run from Terminal inside unit-test directory
29 RELEASEDIR=$(shell cd ../../../build/Release;pwd)
30 DEBUGDIR=$(shell cd ../../../build/Debug;pwd)
31 PATH := ${RELEASEDIR}:${DEBUGDIR}:${MYDIR}:${PATH}
32 COMPILER_PATH := ${RELEASEDIR}:${DEBUGDIR}:${MYDIR}:${COMPILER_PATH}
34 OBJECTDUMP = ${RELEASEDIR}/ObjectDump
35 MACHOCHECK = ${RELEASEDIR}/machocheck
36 REBASE = ${RELEASEDIR}/rebase
38 PATH := ${MYDIR}:${PATH}:
39 COMPILER_PATH := ${MYDIR}:${COMPILER_PATH}:
46 CC = gcc-4.2 -arch ${ARCH} ${SDKExtra}
47 CCFLAGS = -Wall -std=c99
50 CXX = g++-4.2 -arch ${ARCH} ${SDKExtra}
54 SDKExtra = -isysroot /Developer/SDKs/Extra
55 LDFLAGS := -syslibroot /Developer/SDKs/Extra
56 override FILEARCH = arm
62 SDKExtra = -isysroot /Developer/SDKs/Extra
63 LDFLAGS := -syslibroot /Developer/SDKs/Extra
64 override FILEARCH = arm
70 SDKExtra = -isysroot /Developer/SDKs/Extra
71 LDFLAGS := -syslibroot /Developer/SDKs/Extra
75 override FILEARCH = arm
81 SDKExtra = -isysroot /Developer/SDKs/Extra
82 LDFLAGS := -syslibroot /Developer/SDKs/Extra
86 override FILEARCH = arm
87 CC = /Volumes/Leopard/Developer/Platforms/iPhoneOS.platform/usr/bin/gcc-4.2 -arch ${ARCH}
95 # utilites for Makefiles
96 PASS_IFF = ${MYDIR}/pass-iff-exit-zero.pl
97 PASS_IFF_SUCCESS = ${PASS_IFF}
98 PASS_IFF_EMPTY = ${MYDIR}/pass-iff-no-stdin.pl
99 PASS_IFF_STDIN = ${MYDIR}/pass-iff-stdin.pl
100 FAIL_IFF = ${MYDIR}/fail-iff-exit-zero.pl
101 FAIL_IFF_SUCCESS = ${FAIL_IFF}
102 PASS_IFF_ERROR = ${MYDIR}/pass-iff-exit-non-zero.pl
103 FAIL_IF_ERROR = ${MYDIR}/fail-if-exit-non-zero.pl
104 FAIL_IF_SUCCESS = ${MYDIR}/fail-if-exit-zero.pl
105 FAIL_IF_EMPTY = ${MYDIR}/fail-if-no-stdin.pl
106 FAIL_IF_STDIN = ${MYDIR}/fail-if-stdin.pl
107 PASS_IFF_GOOD_MACHO = ${PASS_IFF} ${MACHOCHECK}
108 FAIL_IF_BAD_MACHO = ${FAIL_IF_ERROR} ${MACHOCHECK}
109 FAIL_IF_BAD_OBJ = ${FAIL_IF_ERROR} ${OBJECTDUMP} >/dev/null