4 CUSTOM_TARGETS += osvariantutil subsystem_test_helper
6 ifeq ($(DEVELOPER_DIR),)
7 DEVELOPER_DIR := $(shell xcode-select -p)
10 include $(DEVELOPER_DIR)/AppleInternal/Makefiles/darwintest/Makefile.common
12 ifneq ($(PLATFORM),MacOSX)
13 EXCLUDED_SOURCES += locale.c
14 EXCLUDED_SOURCES += os_boot_mode.c
17 FRAMEWORK_CFLAGS := $(patsubst %,-iframework %,$(SYSTEM_FRAMEWORK_SEARCH_PATHS))
18 WARNING_CFLAGS := -Weverything \
19 -Wno-vla -Wno-missing-field-initializers -Wno-padded \
20 -Wno-gnu-flexible-array-initializer -Wno-gnu-empty-initializer \
21 -Wno-partial-availability -Wno-used-but-marked-unused \
22 -Wno-reserved-id-macro -fmacro-backtrace-limit=0 \
23 -Wno-c++98-compat -Wno-extra-semi -Wno-language-extension-token
24 OTHER_CFLAGS := -DDARWINTEST --std=gnu11 $(FRAMEWORK_CFLAGS) $(WARNING_CFLAGS) -I$(SDK_SYSTEM_FRAMEWORK_HEADERS) -L/usr/lib/system -lsystem_collections
25 DT_LDFLAGS += -ldarwintest_utils
26 ASAN_DYLIB_PATH := /usr/appleinternal/lib/sanitizers/
28 OTHER_LDFLAGS := -umbrella System -L/usr/lib/system -lsystem_collections
30 nxheap: OTHER_CFLAGS += -Wno-cast-align
31 strlcat: OTHER_CFLAGS += -Wno-pointer-arith
32 psort: OTHER_CFLAGS += -Wno-cast-qual -Wno-sign-conversion
33 net: OTHER_CFLAGS += -Wno-sign-conversion -Wno-cast-align -Wno-incompatible-pointer-types-discards-qualifiers -Wno-sign-compare
34 printf: OTHER_CFLAGS += -Wno-format-nonliteral
35 strlcpy: OTHER_CFLAGS += -D_FORTIFY_SOURCE=0
36 realpath_edge: OTHER_CFLAGS += -fsanitize=address -I../fbsdcompat
37 realpath_edge: OTHER_LDFLAGS += -Wl,-rpath -Wl,$(ASAN_DYLIB_PATH)
38 qsort freebsd_qsort: OTHER_CFLAGS += -Wno-unused-function
39 ifeq ($(PLATFORM),MacOSX)
40 qsort_perf: OTHER_CFLAGS += -Wno-sign-compare -Wno-sign-conversion -Wno-cast-align -Wno-shorten-64-to-32
42 EXCLUDED_SOURCES += qsort_perf.c
44 os_variant: OTHER_CFLAGS += -DOS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE
46 osvariantutil: OTHER_CFLAGS += -Wno-gnu-statement-expression -Wno-covered-switch-default -DOS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE
48 include $(DEVELOPER_DIR)/AppleInternal/Makefiles/darwintest/Makefile.targets
50 OSVARIANTUTIL_INSTALLDIR = $(DSTROOT)/usr/local/bin
52 install-osvariantutil: osvariantutil
53 mkdir -p $(OSVARIANTUTIL_INSTALLDIR)
54 cp $(SYMROOT)/osvariantutil $(OSVARIANTUTIL_INSTALLDIR)/
55 ifeq ($(DWARF_DSYM_FILE_SHOULD_ACCOMPANY_PRODUCT),YES)
56 cp -R $(SYMROOT)/osvariantutil.dSYM $(OSVARIANTUTIL_INSTALLDIR)/
59 subsystem_test: subsystem_test.c subsystem_test-entitlements.plist
60 subsystem_test: CODE_SIGN_ENTITLEMENTS=subsystem_test-entitlements.plist
62 install-subsystem_test_helper: subsystem_test_helper
63 mkdir -p $(INSTALLDIR)
64 cp $(SYMROOT)/subsystem_test_helper $(INSTALLDIR)/
65 ifeq ($(DWARF_DSYM_FILE_SHOULD_ACCOMPANY_PRODUCT),YES)
66 cp -R $(SYMROOT)/subsystem_test_helper.dSYM $(INSTALLDIR)/