]>
Commit | Line | Data |
---|---|---|
974e3884 A |
1 | PROJECT := Libc |
2 | TEST_DIR := tests/ | |
3 | ||
a9aaacca | 4 | CUSTOM_TARGETS += osvariantutil subsystem_test_helper |
507116e3 | 5 | |
974e3884 A |
6 | ifeq ($(DEVELOPER_DIR),) |
7 | DEVELOPER_DIR := $(shell xcode-select -p) | |
8 | endif | |
9 | ||
10 | include $(DEVELOPER_DIR)/AppleInternal/Makefiles/darwintest/Makefile.common | |
11 | ||
e1ee4b85 | 12 | ifneq ($(PLATFORM),MacOSX) |
b061a43b | 13 | EXCLUDED_SOURCES += locale.c |
a9aaacca | 14 | EXCLUDED_SOURCES += os_boot_mode.c |
b061a43b A |
15 | endif |
16 | ||
507116e3 | 17 | FRAMEWORK_CFLAGS := $(patsubst %,-iframework %,$(SYSTEM_FRAMEWORK_SEARCH_PATHS)) |
b061a43b A |
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 \ | |
507116e3 | 23 | -Wno-c++98-compat -Wno-extra-semi -Wno-language-extension-token |
a9aaacca | 24 | OTHER_CFLAGS := -DDARWINTEST --std=gnu11 $(FRAMEWORK_CFLAGS) $(WARNING_CFLAGS) -I$(SDK_SYSTEM_FRAMEWORK_HEADERS) -L/usr/lib/system -lsystem_collections |
507116e3 | 25 | DT_LDFLAGS += -ldarwintest_utils |
a9aaacca A |
26 | ASAN_DYLIB_PATH := /usr/appleinternal/lib/sanitizers/ |
27 | ||
28 | OTHER_LDFLAGS := -umbrella System -L/usr/lib/system -lsystem_collections | |
974e3884 A |
29 | |
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 | |
b061a43b A |
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 | |
41 | else | |
42 | EXCLUDED_SOURCES += qsort_perf.c | |
43 | endif | |
6dccf0e0 | 44 | os_variant: OTHER_CFLAGS += -DOS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE |
974e3884 | 45 | |
507116e3 A |
46 | osvariantutil: OTHER_CFLAGS += -Wno-gnu-statement-expression -Wno-covered-switch-default -DOS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE |
47 | ||
974e3884 | 48 | include $(DEVELOPER_DIR)/AppleInternal/Makefiles/darwintest/Makefile.targets |
b061a43b | 49 | |
507116e3 A |
50 | OSVARIANTUTIL_INSTALLDIR = $(DSTROOT)/usr/local/bin |
51 | ||
52 | install-osvariantutil: osvariantutil | |
53 | mkdir -p $(OSVARIANTUTIL_INSTALLDIR) | |
54 | cp $(SYMROOT)/osvariantutil $(OSVARIANTUTIL_INSTALLDIR)/ | |
55 | ifeq ($(DWARF_DSYM_FILE_SHOULD_ACCOMPANY_PRODUCT),YES) | |
a9aaacca A |
56 | cp -R $(SYMROOT)/osvariantutil.dSYM $(OSVARIANTUTIL_INSTALLDIR)/ |
57 | endif | |
58 | ||
59 | subsystem_test: subsystem_test.c subsystem_test-entitlements.plist | |
60 | subsystem_test: CODE_SIGN_ENTITLEMENTS=subsystem_test-entitlements.plist | |
61 | ||
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)/ | |
507116e3 | 67 | endif |
a9aaacca | 68 |