]> git.saurik.com Git - apple/xnu.git/blame - tools/tests/darwintests/Makefile
xnu-3789.51.2.tar.gz
[apple/xnu.git] / tools / tests / darwintests / Makefile
CommitLineData
39037602
A
1PROJECT := xnu/darwintests
2
3# When building as part of xnu_tests, we get passed a DSTROOT that's got the
4# unit test path in it already. But, BASEDSTROOT doesn't, so use that instead.
5ifdef BASEDSTROOT
6override DSTROOT = $(BASEDSTROOT)
7endif
8
9DEVELOPER_DIR ?= /Applications/Xcode.app/Contents/Developer/
10
11# the xnu build system will only ever call us with the default target
12.DEFAULT_GOAL := install
13
14include $(DEVELOPER_DIR)/AppleInternal/Makefiles/darwintest/Makefile.common
15
16OTHER_CFLAGS = -Weverything -Wno-gnu-union-cast -Wno-missing-field-initializers -Wno-partial-availability
17OTHER_CFLAGS += -Wno-missing-noreturn -Wno-vla -Wno-reserved-id-macro -Wno-documentation-unknown-command
813fb2f6 18OTHER_CFLAGS += -Wno-padded -Wno-used-but-marked-unused -Wno-covered-switch-default
39037602 19OTHER_CFLAGS += --std=gnu11 -isystem $(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
813fb2f6
A
20OTHER_CFLAGS += -DT_NAMESPACE=xnu
21
22CODESIGN:=$(shell xcrun -sdk "$(TARGETSDK)" -find codesign)
23CODESIGN_ALLOCATE:=$(shell xcrun -sdk "$(TARGETSDK)" -find codesign_allocate)
39037602
A
24
25# to have custom compiler flags to
26# target: OTHER_CFLAGS += <my flags>
27
28backtracing: OTHER_CFLAGS += -F $(SDKROOT)/System/Library/PrivateFrameworks
29backtracing: OTHER_LDFLAGS += -framework CoreSymbolication
30
813fb2f6
A
31data_protection: OTHER_LDFLAGS += -framework IOKit
32
39037602
A
33kdebug: INVALID_ARCHS = i386
34kdebug: OTHER_LDFLAGS = -lktrace
35
36EXCLUDED_SOURCES += kperf_helpers.c
37
813fb2f6
A
38ifeq ($(PLATFORM),iPhoneOS)
39CONFIG_FREEZE_DEFINE:= -DCONFIG_FREEZE
40else
41CONFIG_FREEZE_DEFINE:=
42EXCLUDED_SOURCES += jumbo_va_spaces_28530648.c
43endif
44
45perf_compressor: OTHER_CFLAGS += $(CONFIG_FREEZE_DEFINE)
46
39037602
A
47kperf: INVALID_ARCHS = i386
48kperf: OTHER_CFLAGS += kperf_helpers.c
49kperf: OTHER_CFLAGS += -F $(SDKROOT)/System/Library/PrivateFrameworks
50kperf: OTHER_LDFLAGS += -framework kperf -framework kperfdata -lktrace
51
52kperf_backtracing: INVALID_ARCHS = i386
53kperf_backtracing: OTHER_CFLAGS += kperf_helpers.c
54kperf_backtracing: OTHER_CFLAGS += -F $(SDKROOT)/System/Library/PrivateFrameworks
55kperf_backtracing: OTHER_LDFLAGS += -framework kperf -framework kperfdata -lktrace
56kperf_backtracing: OTHER_LDFLAGS += -framework CoreSymbolication
57
58mach_get_times: OTHER_LDFLAGS += -ldarwintest_utils
59
60perf_exit: OTHER_LDFLAGS = -lktrace
61perf_exit: INVALID_ARCHS = i386
62
813fb2f6
A
63task_inspect: CODE_SIGN_ENTITLEMENTS = task_inspect.entitlements
64task_inspect: OTHER_CFLAGS += -DENTITLED=1
65
66CUSTOM_TARGETS += perf_exit_proc
67
68perf_exit_proc:
69 $(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) perf_exit_proc.c -o $(SYMROOT)/perf_exit_proc
70
71install-perf_exit_proc: perf_exit_proc
72 mkdir -p $(INSTALLDIR)
73 cp $(SYMROOT)/perf_exit_proc $(INSTALLDIR)/
74
75perf_kdebug: INVALID_ARCHS = i386
76
39037602
A
77stackshot_idle_25570396: INVALID_ARCHS = i386
78stackshot_idle_25570396: OTHER_LDFLAGS += -lkdd -framework Foundation
79
813fb2f6
A
80stackshot_block_owner_14362384: INVALID_ARCHS = i386
81stackshot_block_owner_14362384: OTHER_LDFLAGS += -framework Foundation -lpthread -lkdd
82
83ifeq ($(PLATFORM),iPhoneOS)
84OTHER_TEST_TARGETS += jumbo_va_spaces_28530648_unentitled
85jumbo_va_spaces_28530648: CODE_SIGN_ENTITLEMENTS = jumbo_va_spaces_28530648.entitlements
86jumbo_va_spaces_28530648: OTHER_CFLAGS += -DENTITLED=1
87jumbo_va_spaces_28530648: OTHER_LDFLAGS += -ldarwintest_utils
88
89jumbo_va_spaces_28530648_unentitled: OTHER_LDFLAGS += -ldarwintest_utils
90jumbo_va_spaces_28530648_unentitled: jumbo_va_spaces_28530648.c
91 $(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $< -o $(SYMROOT)/$@
92endif
93
39037602 94include $(DEVELOPER_DIR)/AppleInternal/Makefiles/darwintest/Makefile.targets