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