]> git.saurik.com Git - apple/libc.git/blame - tests/Makefile
Libc-1439.40.11.tar.gz
[apple/libc.git] / tests / Makefile
CommitLineData
974e3884
A
1PROJECT := Libc
2TEST_DIR := tests/
3
a9aaacca 4CUSTOM_TARGETS += osvariantutil subsystem_test_helper
507116e3 5
974e3884
A
6ifeq ($(DEVELOPER_DIR),)
7 DEVELOPER_DIR := $(shell xcode-select -p)
8endif
9
10include $(DEVELOPER_DIR)/AppleInternal/Makefiles/darwintest/Makefile.common
11
e1ee4b85 12ifneq ($(PLATFORM),MacOSX)
b061a43b 13EXCLUDED_SOURCES += locale.c
a9aaacca 14EXCLUDED_SOURCES += os_boot_mode.c
b061a43b
A
15endif
16
507116e3 17FRAMEWORK_CFLAGS := $(patsubst %,-iframework %,$(SYSTEM_FRAMEWORK_SEARCH_PATHS))
b061a43b
A
18WARNING_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 \
507116e3 23 -Wno-c++98-compat -Wno-extra-semi -Wno-language-extension-token
a9aaacca 24OTHER_CFLAGS := -DDARWINTEST --std=gnu11 $(FRAMEWORK_CFLAGS) $(WARNING_CFLAGS) -I$(SDK_SYSTEM_FRAMEWORK_HEADERS) -L/usr/lib/system -lsystem_collections
507116e3 25DT_LDFLAGS += -ldarwintest_utils
a9aaacca
A
26ASAN_DYLIB_PATH := /usr/appleinternal/lib/sanitizers/
27
28OTHER_LDFLAGS := -umbrella System -L/usr/lib/system -lsystem_collections
974e3884
A
29
30nxheap: OTHER_CFLAGS += -Wno-cast-align
31strlcat: OTHER_CFLAGS += -Wno-pointer-arith
32psort: OTHER_CFLAGS += -Wno-cast-qual -Wno-sign-conversion
33net: OTHER_CFLAGS += -Wno-sign-conversion -Wno-cast-align -Wno-incompatible-pointer-types-discards-qualifiers -Wno-sign-compare
b061a43b
A
34printf: OTHER_CFLAGS += -Wno-format-nonliteral
35strlcpy: OTHER_CFLAGS += -D_FORTIFY_SOURCE=0
36realpath_edge: OTHER_CFLAGS += -fsanitize=address -I../fbsdcompat
37realpath_edge: OTHER_LDFLAGS += -Wl,-rpath -Wl,$(ASAN_DYLIB_PATH)
38qsort freebsd_qsort: OTHER_CFLAGS += -Wno-unused-function
39ifeq ($(PLATFORM),MacOSX)
40qsort_perf: OTHER_CFLAGS += -Wno-sign-compare -Wno-sign-conversion -Wno-cast-align -Wno-shorten-64-to-32
41else
42EXCLUDED_SOURCES += qsort_perf.c
43endif
6dccf0e0 44os_variant: OTHER_CFLAGS += -DOS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE
974e3884 45
507116e3
A
46osvariantutil: OTHER_CFLAGS += -Wno-gnu-statement-expression -Wno-covered-switch-default -DOS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE
47
974e3884 48include $(DEVELOPER_DIR)/AppleInternal/Makefiles/darwintest/Makefile.targets
b061a43b 49
507116e3
A
50OSVARIANTUTIL_INSTALLDIR = $(DSTROOT)/usr/local/bin
51
52install-osvariantutil: osvariantutil
53 mkdir -p $(OSVARIANTUTIL_INSTALLDIR)
54 cp $(SYMROOT)/osvariantutil $(OSVARIANTUTIL_INSTALLDIR)/
55ifeq ($(DWARF_DSYM_FILE_SHOULD_ACCOMPANY_PRODUCT),YES)
a9aaacca
A
56 cp -R $(SYMROOT)/osvariantutil.dSYM $(OSVARIANTUTIL_INSTALLDIR)/
57endif
58
59subsystem_test: subsystem_test.c subsystem_test-entitlements.plist
60subsystem_test: CODE_SIGN_ENTITLEMENTS=subsystem_test-entitlements.plist
61
62install-subsystem_test_helper: subsystem_test_helper
63 mkdir -p $(INSTALLDIR)
64 cp $(SYMROOT)/subsystem_test_helper $(INSTALLDIR)/
65ifeq ($(DWARF_DSYM_FILE_SHOULD_ACCOMPANY_PRODUCT),YES)
66 cp -R $(SYMROOT)/subsystem_test_helper.dSYM $(INSTALLDIR)/
507116e3 67endif
a9aaacca 68