]> git.saurik.com Git - apple/libc.git/blob - tests/Makefile
e6cbbed6e63ecc709fad900a67a798bae246b0d5
[apple/libc.git] / tests / Makefile
1 PROJECT := Libc
2 TEST_DIR := tests/
3
4 CUSTOM_TARGETS += osvariantutil
5
6 ifeq ($(DEVELOPER_DIR),)
7 DEVELOPER_DIR := $(shell xcode-select -p)
8 endif
9
10 include $(DEVELOPER_DIR)/AppleInternal/Makefiles/darwintest/Makefile.common
11
12 ifeq ($(PLATFORM),BridgeOS)
13 EXCLUDED_SOURCES += locale.c
14 endif
15
16 FRAMEWORK_CFLAGS := $(patsubst %,-iframework %,$(SYSTEM_FRAMEWORK_SEARCH_PATHS))
17 WARNING_CFLAGS := -Weverything \
18 -Wno-vla -Wno-missing-field-initializers -Wno-padded \
19 -Wno-gnu-flexible-array-initializer -Wno-gnu-empty-initializer \
20 -Wno-partial-availability -Wno-used-but-marked-unused \
21 -Wno-reserved-id-macro -fmacro-backtrace-limit=0 \
22 -Wno-c++98-compat -Wno-extra-semi -Wno-language-extension-token
23 OTHER_CFLAGS := -DDARWINTEST --std=gnu11 $(FRAMEWORK_CFLAGS) $(WARNING_CFLAGS)
24 DT_LDFLAGS += -ldarwintest_utils
25 ASAN_DYLIB_PATH := /usr/local/lib/sanitizers/
26
27 nxheap: OTHER_CFLAGS += -Wno-cast-align
28 strlcat: OTHER_CFLAGS += -Wno-pointer-arith
29 psort: OTHER_CFLAGS += -Wno-cast-qual -Wno-sign-conversion
30 net: OTHER_CFLAGS += -Wno-sign-conversion -Wno-cast-align -Wno-incompatible-pointer-types-discards-qualifiers -Wno-sign-compare
31 printf: OTHER_CFLAGS += -Wno-format-nonliteral
32 strlcpy: OTHER_CFLAGS += -D_FORTIFY_SOURCE=0
33 realpath_edge: OTHER_CFLAGS += -fsanitize=address -I../fbsdcompat
34 realpath_edge: OTHER_LDFLAGS += -Wl,-rpath -Wl,$(ASAN_DYLIB_PATH)
35 qsort freebsd_qsort: OTHER_CFLAGS += -Wno-unused-function
36 ifeq ($(PLATFORM),MacOSX)
37 qsort_perf: OTHER_CFLAGS += -Wno-sign-compare -Wno-sign-conversion -Wno-cast-align -Wno-shorten-64-to-32
38 else
39 EXCLUDED_SOURCES += qsort_perf.c
40 endif
41 os_variant: OTHER_CFLAGS += -DOS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE
42
43 osvariantutil: OTHER_CFLAGS += -Wno-gnu-statement-expression -Wno-covered-switch-default -DOS_CRASH_ENABLE_EXPERIMENTAL_LIBTRACE
44
45 include $(DEVELOPER_DIR)/AppleInternal/Makefiles/darwintest/Makefile.targets
46
47 OSVARIANTUTIL_INSTALLDIR = $(DSTROOT)/usr/local/bin
48
49 install-osvariantutil: osvariantutil
50 mkdir -p $(OSVARIANTUTIL_INSTALLDIR)
51 cp $(SYMROOT)/osvariantutil $(OSVARIANTUTIL_INSTALLDIR)/
52 ifeq ($(DWARF_DSYM_FILE_SHOULD_ACCOMPANY_PRODUCT),YES)
53 cp $(SYMROOT)/osvariantutil.dSYM $(OSVARIANTUTIL_INSTALLDIR)/
54 endif