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 # if run within Xcode, add the just built tools to the command path
14 ifdef BUILT_PRODUCTS_DIR
15 PATH := ${BUILT_PRODUCTS_DIR}:${MYDIR}:${PATH}
16 COMPILER_PATH := ${BUILT_PRODUCTS_DIR}:${MYDIR}:${COMPILER_PATH}
18 ifneq "$(findstring /unit-tests/test-cases/, $(shell pwd))" ""
19 RELEASEDIR=$(shell cd ../../../build/Release;pwd)
20 PATH := ${RELEASEDIR}:${MYDIR}:${PATH}
21 COMPILER_PATH := ${RELEASEDIR}:${MYDIR}:${COMPILER_PATH}
23 PATH := ${MYDIR}:${PATH}:
24 COMPILER_PATH := ${MYDIR}:${COMPILER_PATH}:
31 OBJECTDUMP = ObjectDump
32 MACHOCHECK = machocheck
35 CC = gcc-4.0 -arch ${ARCH}
36 CCFLAGS = -Wall -std=c99
39 CXX = g++-4.0 -arch ${ARCH}
43 LDFLAGS := -syslibroot /Developer/SDKs/Purple
44 override FILEARCH = arm
50 LDFLAGS := -syslibroot /Developer/SDKs/Purple
54 override FILEARCH = arm
62 # utilites for Makefiles
63 PASS_IFF = pass-iff-exit-zero.pl
64 PASS_IFF_SUCCESS = ${PASS_IFF}
65 PASS_IFF_EMPTY = pass-iff-no-stdin.pl
66 PASS_IFF_STDIN = pass-iff-stdin.pl
67 FAIL_IFF = fail-iff-exit-zero.pl
68 FAIL_IFF_SUCCESS = ${FAIL_IFF}
69 PASS_IFF_ERROR = pass-iff-exit-non-zero.pl
70 FAIL_IF_ERROR = fail-if-exit-non-zero.pl
71 FAIL_IF_SUCCESS = fail-if-exit-zero.pl
72 FAIL_IF_EMPTY = fail-if-no-stdin.pl
73 FAIL_IF_STDIN = fail-if-stdin.pl
74 PASS_IFF_GOOD_MACHO = ${PASS_IFF} ${MACHOCHECK}
75 FAIL_IF_BAD_MACHO = ${FAIL_IF_ERROR} ${MACHOCHECK}
76 FAIL_IF_BAD_OBJ = ${FAIL_IF_ERROR} ${OBJECTDUMP} >/dev/null