]> git.saurik.com Git - apple/xnu.git/blame - tools/tests/affinity/Makefile
xnu-2782.40.9.tar.gz
[apple/xnu.git] / tools / tests / affinity / Makefile
CommitLineData
39236c6e
A
1SDKROOT ?= /
2ifeq "$(RC_TARGET_CONFIG)" "iPhone"
3Embedded?=YES
4else
5Embedded?=$(shell echo $(SDKROOT) | grep -iq iphoneos && echo YES || echo NO)
6endif
2d21ac55 7
fe8ab488 8CC:=$(shell xcrun -sdk "$(SDKROOT)" -find cc)
2d21ac55 9
39236c6e 10SYMROOT?=$(shell /bin/pwd)
2d21ac55 11
39236c6e
A
12ifdef RC_ARCHS
13 ARCHS:=$(RC_ARCHS)
14 else
15 ifeq "$(Embedded)" "YES"
fe8ab488 16 ARCHS:=armv7 armv7s arm64
39236c6e
A
17 else
18 ARCHS:=x86_64 i386
19 endif
20endif
2d21ac55 21
39236c6e
A
22ARCH_32 := $(filter-out %64, $(ARCHS))
23ARCH_32_FLAGS := $(patsubst %, -arch %, $(ARCH_32))
24ARCH_64 := $(filter %64, $(ARCHS))
25ARCH_64_FLAGS := $(patsubst %, -arch %, $(ARCH_64))
26
fe8ab488 27CFLAGS :=-g -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
39236c6e
A
28
29DSTROOT?=$(shell /bin/pwd)
30SRCROOT?=$(shell /bin/pwd)
31
32SOURCES := sets.c pool.c tags.c
33ARCH_32_TARGETS := $(addprefix $(DSTROOT)/, sets pool tags)
34ARCH_64_TARGETS := $(addprefix $(DSTROOT)/, sets64 pool64 tags64)
35
36TARGETS := $(if $(ARCH_64), $(ARCH_64_TARGETS)) $(if $(ARCH_32), $(ARCH_32_TARGETS))
37
38
39all: $(TARGETS)
40
41$(ARCH_32_TARGETS): $(DSTROOT)/%: $(SRCROOT)/%.c
42 $(CC) $(CFLAGS) $(ARCH_32_FLAGS) $< -o $(SYMROOT)/$(notdir $@) # 32-bit fat
43 if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
44
45.SECONDEXPANSION:
46$(ARCH_64_TARGETS): $(DSTROOT)/%: $(SRCROOT)/$$(subst 64,,%).c
47 $(CC) $(CFLAGS) $(ARCH_64_FLAGS) $< -o $(SYMROOT)/$(notdir $@) # 64-bit fat
48 if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
2d21ac55
A
49
50clean:
39236c6e
A
51 rm -f $(TARGETS)
52 rm -rf $(SYMROOT)/*.dSYM