]> git.saurik.com Git - apple/xnu.git/blame - tools/tests/affinity/Makefile
xnu-6153.141.1.tar.gz
[apple/xnu.git] / tools / tests / affinity / Makefile
CommitLineData
3e170ce0 1include ../Makefile.common
2d21ac55 2
fe8ab488 3CC:=$(shell xcrun -sdk "$(SDKROOT)" -find cc)
2d21ac55 4
39236c6e 5SYMROOT?=$(shell /bin/pwd)
2d21ac55 6
39236c6e
A
7ifdef RC_ARCHS
8 ARCHS:=$(RC_ARCHS)
9 else
10 ifeq "$(Embedded)" "YES"
fe8ab488 11 ARCHS:=armv7 armv7s arm64
39236c6e
A
12 else
13 ARCHS:=x86_64 i386
14 endif
15endif
2d21ac55 16
d9a64523
A
17# These are convenience functions for filtering based on substrings, as the
18# normal filter functions only accept one wildcard.
19FILTER_OUT_SUBSTRING=$(strip $(foreach string,$(2),$(if $(findstring $(1),$(string)),,$(string))))
20FILTER_SUBSTRING=$(strip $(foreach string,$(2),$(if $(findstring $(1),$(string)),$(string),)))
21
22ARCH_32:=$(call FILTER_OUT_SUBSTRING,64,$(ARCHS))
23ARCH_64:=$(call FILTER_SUBSTRING,64,$(ARCHS))
24
39236c6e 25ARCH_32_FLAGS := $(patsubst %, -arch %, $(ARCH_32))
39236c6e
A
26ARCH_64_FLAGS := $(patsubst %, -arch %, $(ARCH_64))
27
39037602 28CFLAGS :=-g -isysroot $(SDKROOT) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
39236c6e
A
29
30DSTROOT?=$(shell /bin/pwd)
31SRCROOT?=$(shell /bin/pwd)
32
33SOURCES := sets.c pool.c tags.c
34ARCH_32_TARGETS := $(addprefix $(DSTROOT)/, sets pool tags)
35ARCH_64_TARGETS := $(addprefix $(DSTROOT)/, sets64 pool64 tags64)
36
37TARGETS := $(if $(ARCH_64), $(ARCH_64_TARGETS)) $(if $(ARCH_32), $(ARCH_32_TARGETS))
38
39
40all: $(TARGETS)
41
42$(ARCH_32_TARGETS): $(DSTROOT)/%: $(SRCROOT)/%.c
39037602 43 $(CC) $(CFLAGS) $(ARCH_32_FLAGS) $< -o $(SYMROOT)/$(notdir $@) # 32-bit fat
39236c6e
A
44 if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
45
46.SECONDEXPANSION:
47$(ARCH_64_TARGETS): $(DSTROOT)/%: $(SRCROOT)/$$(subst 64,,%).c
48 $(CC) $(CFLAGS) $(ARCH_64_FLAGS) $< -o $(SYMROOT)/$(notdir $@) # 64-bit fat
49 if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
2d21ac55
A
50
51clean:
39037602 52 rm -f $(TARGETS)
39236c6e 53 rm -rf $(SYMROOT)/*.dSYM