]> git.saurik.com Git - apple/xnu.git/blame_incremental - tools/tests/affinity/Makefile
xnu-2782.40.9.tar.gz
[apple/xnu.git] / tools / tests / affinity / Makefile
... / ...
CommitLineData
1SDKROOT ?= /
2ifeq "$(RC_TARGET_CONFIG)" "iPhone"
3Embedded?=YES
4else
5Embedded?=$(shell echo $(SDKROOT) | grep -iq iphoneos && echo YES || echo NO)
6endif
7
8CC:=$(shell xcrun -sdk "$(SDKROOT)" -find cc)
9
10SYMROOT?=$(shell /bin/pwd)
11
12ifdef RC_ARCHS
13 ARCHS:=$(RC_ARCHS)
14 else
15 ifeq "$(Embedded)" "YES"
16 ARCHS:=armv7 armv7s arm64
17 else
18 ARCHS:=x86_64 i386
19 endif
20endif
21
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
27CFLAGS :=-g -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
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
49
50clean:
51 rm -f $(TARGETS)
52 rm -rf $(SYMROOT)/*.dSYM