]> git.saurik.com Git - apple/xnu.git/blame - tools/tests/affinity/Makefile
xnu-3248.60.10.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
39236c6e
A
17ARCH_32 := $(filter-out %64, $(ARCHS))
18ARCH_32_FLAGS := $(patsubst %, -arch %, $(ARCH_32))
19ARCH_64 := $(filter %64, $(ARCHS))
20ARCH_64_FLAGS := $(patsubst %, -arch %, $(ARCH_64))
21
3e170ce0 22CFLAGS :=-g -isysroot $(SDKROOT) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
39236c6e
A
23
24DSTROOT?=$(shell /bin/pwd)
25SRCROOT?=$(shell /bin/pwd)
26
27SOURCES := sets.c pool.c tags.c
28ARCH_32_TARGETS := $(addprefix $(DSTROOT)/, sets pool tags)
29ARCH_64_TARGETS := $(addprefix $(DSTROOT)/, sets64 pool64 tags64)
30
31TARGETS := $(if $(ARCH_64), $(ARCH_64_TARGETS)) $(if $(ARCH_32), $(ARCH_32_TARGETS))
32
33
34all: $(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
2d21ac55
A
44
45clean:
39236c6e
A
46 rm -f $(TARGETS)
47 rm -rf $(SYMROOT)/*.dSYM