]> git.saurik.com Git - apple/ld64.git/blob - unit-tests/include/common.makefile
ld64-77.tar.gz
[apple/ld64.git] / unit-tests / include / common.makefile
1 # stuff to include in every test Makefile
2
3 SHELL = /bin/sh
4
5 # set default to be host
6 ARCH ?= $(shell arch)
7
8 # set default to be all
9 VALID_ARCHS ?= "ppc ppc64 i386 x86_64"
10
11 MYDIR=$(shell cd ../../bin;pwd)
12
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}
17 else
18 PATH := ${MYDIR}:${PATH}:
19 COMPILER_PATH := ${MYDIR}:${COMPILER_PATH}:
20 endif
21 export PATH
22 export COMPILER_PATH
23
24 LD = ld
25 OBJECTDUMP = ObjectDump
26 MACHOCHECK = machocheck
27 OTOOL = otool
28
29 CC = gcc-4.0 -arch ${ARCH}
30 CCFLAGS = -Wall -std=c99
31 ASMFLAGS =
32
33 CXX = g++-4.0 -arch ${ARCH}
34 CXXFLAGS = -Wall
35
36 RM = rm
37 RMFLAGS = -rf
38
39 # utilites for Makefiles
40 PASS_IFF = pass-iff-exit-zero.pl
41 PASS_IFF_SUCCESS = ${PASS_IFF}
42 PASS_IFF_EMPTY = pass-iff-no-stdin.pl
43 PASS_IFF_STDIN = pass-iff-stdin.pl
44 FAIL_IFF = fail-iff-exit-zero.pl
45 FAIL_IFF_SUCCESS = ${FAIL_IFF}
46 PASS_IFF_ERROR = pass-iff-exit-non-zero.pl
47 FAIL_IF_ERROR = fail-if-exit-non-zero.pl
48 FAIL_IF_SUCCESS = fail-if-exit-zero.pl
49 FAIL_IF_EMPTY = fail-if-no-stdin.pl
50 FAIL_IF_STDIN = fail-if-stdin.pl
51 PASS_IFF_GOOD_MACHO = ${PASS_IFF} ${MACHOCHECK}
52 FAIL_IF_BAD_MACHO = ${FAIL_IF_ERROR} ${MACHOCHECK}
53 FAIL_IF_BAD_OBJ = ${FAIL_IF_ERROR} ${OBJECTDUMP} >/dev/null