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