Implementation for AXIsolatedObject::nextSibling and previousSibling.
[WebKit-https.git] / Makefile.shared
1 SCRIPTS_PATH ?= ../Tools/Scripts
2
3 SET_COLOR_DIAGNOSTICS_ARG = if [[ -t 1 ]]; then COLOR_DIAGNOSTICS_ARG="COLOR_DIAGNOSTICS=YES"; fi
4 XCODE_OPTIONS = `perl -I$(SCRIPTS_PATH) -Mwebkitdirs -e 'print XcodeOptionString()' -- $(BUILD_WEBKIT_OPTIONS)` $${COLOR_DIAGNOSTICS_ARG} $(ARGS)
5
6 ifneq (,$(SDKROOT))
7         ifneq (,$(OVERRIDE_SDKROOT))
8                 ifneq (default,$(OVERRIDE_SDKROOT))
9                         XCODE_OPTIONS := $(XCODE_OPTIONS) SDKROOT=$(OVERRIDE_SDKROOT)
10                 endif
11                 OVERRIDE_SDKROOT =
12         else
13                 XCODE_OPTIONS := $(XCODE_OPTIONS) SDKROOT=$(SDKROOT)
14         endif
15 endif
16
17 ifneq (,$(ARCHS))
18         ifneq (,$(OVERRIDE_ARCHS))
19                 ifneq (default,$(OVERRIDE_ARCHS))
20                         XCODE_OPTIONS := $(XCODE_OPTIONS) ARCHS="$(OVERRIDE_ARCHS)"
21                         XCODE_OPTIONS += ONLY_ACTIVE_ARCH=NO
22                 endif
23                 OVERRIDE_ARCHS =
24         else
25                 XCODE_OPTIONS := $(XCODE_OPTIONS) ARCHS="$(ARCHS)"
26                 XCODE_OPTIONS += ONLY_ACTIVE_ARCH=NO
27         endif
28 endif
29
30 ifneq (,$(SDK_VARIANT))
31         XCODE_OPTIONS += SDK_VARIANT="$(SDK_VARIANT)"
32 endif
33
34 ifeq (, $(findstring WK_USE_CCACHE, $(ARGS)))
35         ifneq (, $(shell which ccache))
36                 XCODE_OPTIONS += WK_USE_CCACHE=YES
37         endif
38 endif
39
40 ifeq ($(findstring UseNewBuildSystem,$(ARGS)),)
41         CAN_USE_XCBUILD = $(shell perl -I$(SCRIPTS_PATH) -Mwebkitdirs -e 'print canUseXCBuild()')
42         ifeq ($(CAN_USE_XCBUILD),1)
43                 # Temporarily disable default use of XCBuild until issues with it are ironed out.
44                 #XCODE_OPTIONS += -UseNewBuildSystem=YES
45                 XCODE_OPTIONS += -UseNewBuildSystem=NO
46         else
47                 XCODE_OPTIONS += -UseNewBuildSystem=NO
48         endif
49 endif
50
51 DEFAULT_VERBOSITY := $(shell defaults read org.webkit.BuildConfiguration BuildTranscriptVerbosity 2>/dev/null || echo "default")
52 VERBOSITY ?= $(DEFAULT_VERBOSITY)
53
54 ifeq ($(VERBOSITY),default)
55 OUTPUT_FILTER = cat
56 XCODE_OPTIONS += -hideShellScriptEnvironment
57 else
58 ifeq ($(VERBOSITY),noisy)
59 OUTPUT_FILTER = cat
60 else
61 OUTPUT_FILTER = $(SCRIPTS_PATH)/filter-build-webkit
62 endif
63 endif
64
65 ifeq ($(ASAN),YES)
66 ASAN_OPTION=--asan
67 else
68 ifeq ($(ASAN),NO)
69 ASAN_OPTION=--no-asan
70 endif
71 endif
72
73 ifeq ($(TSAN),YES)
74 TSAN_OPTION=--tsan
75 else
76 ifeq ($(TSAN),NO)
77 TSAN_OPTION=--no-tsan
78 endif
79 endif
80
81 ifeq ($(WK_LTO_MODE),full)
82 WK_LTO_OPTION=--lto-mode=full
83 else ifeq ($(WK_LTO_MODE),thin)
84 WK_LTO_OPTION=--lto-mode=thin
85 else ifeq ($(WK_LTO_MODE),none)
86 WK_LTO_OPTION=--lto-mode=none
87 endif
88
89 export DSYMUTIL_NUM_THREADS = $(shell sysctl -n hw.activecpu)
90
91 # Run xcodebuild with the same PATH with which the Xcode IDE runs, to mitigate unnecessary rebuilds due to PATH differences.
92 # See <rdar://problem/16466196>.
93 export PATH = $(shell getconf PATH)
94
95 all: set_sanitizer_configuration
96         ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) $$(inherited)' | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
97
98 debug d development dev develop: force
99         $(SCRIPTS_PATH)/set-webkit-configuration --debug $(ASAN_OPTION) $(TSAN_OPTION) $(WK_LTO_OPTION)
100         ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) $$(inherited)' | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
101
102 release r deployment dep deploy: force
103         $(SCRIPTS_PATH)/set-webkit-configuration --release $(ASAN_OPTION) $(TSAN_OPTION) $(WK_LTO_OPTION)
104         ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) $$(inherited)' | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
105
106 release+assert ra: force
107         $(SCRIPTS_PATH)/set-webkit-configuration --release $(ASAN_OPTION) $(TSAN_OPTION) $(WK_LTO_OPTION)
108         ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) ASSERT_ENABLED=1 $$(inherited)' | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
109
110 testing t: force
111         $(SCRIPTS_PATH)/set-webkit-configuration --debug $(ASAN_OPTION) $(TSAN_OPTION) $(WK_LTO_OPTION) --force-optimization-level=O3
112         ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) $$(inherited)' | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
113
114 analyze:
115         $(SCRIPTS_PATH)/set-webkit-configuration --debug $(ASAN_OPTION) $(TSAN_OPTION) $(WK_LTO_OPTION)
116 ifndef PATH_TO_SCAN_BUILD
117         ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) $$(inherited)' RUN_CLANG_STATIC_ANALYZER=YES | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
118 else
119         ( $(SET_COLOR_DIAGNOSTICS_ARG); $(PATH_TO_SCAN_BUILD) xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) $$(inherited)' | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
120 endif
121
122 set_sanitizer_configuration:
123 ifneq (,$(ASAN_OPTION))
124         $(SCRIPTS_PATH)/set-webkit-configuration $(ASAN_OPTION)
125 endif
126 ifneq (,$(TSAN_OPTION))
127         $(SCRIPTS_PATH)/set-webkit-configuration $(TSAN_OPTION)
128 endif
129
130 clean:
131         ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) -alltargets clean $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
132
133 force: ;