Polymorphic call inlining should be based on polymorphic call inline caching rather...
[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         XCODE_OPTIONS += SDKROOT=$(SDKROOT)
8 endif
9
10 ifneq (,$(ARCHS))
11         XCODE_OPTIONS += ARCHS="$(ARCHS)"
12         XCODE_OPTIONS += ONLY_ACTIVE_ARCH=NO
13 endif
14
15 XCODE_OPTIONS += TOOLCHAINS=com.apple.dt.toolchain.OSX10_11
16
17 DEFAULT_VERBOSITY := $(shell defaults read org.webkit.BuildConfiguration BuildTranscriptVerbosity 2>/dev/null || echo "default")
18 VERBOSITY ?= $(DEFAULT_VERBOSITY)
19
20 ifeq ($(VERBOSITY),default)
21 OUTPUT_FILTER = grep -v setenv
22 else
23 ifeq ($(VERBOSITY),noisy)
24 OUTPUT_FILTER = cat
25 else
26 OUTPUT_FILTER = $(SCRIPTS_PATH)/filter-build-webkit
27 endif
28 endif
29
30 ifeq ($(ASAN),YES)
31 ASAN_OPTION=--asan
32 else
33 ifeq ($(ASAN),NO)
34 ASAN_OPTION=--no-asan
35 endif
36 endif
37
38 export DSYMUTIL_NUM_THREADS = $(shell sysctl -n hw.activecpu)
39
40 # Run xcodebuild with the same PATH with which the Xcode IDE runs, to mitigate unnecessary rebuilds due to PATH differences.
41 # See <rdar://problem/16466196>.
42 export PATH = $(shell getconf PATH)
43
44 all: set_asan_configuration
45         ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
46
47 debug d development dev develop: force
48         $(SCRIPTS_PATH)/set-webkit-configuration --debug $(ASAN_OPTION)
49         ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
50
51 release r deployment dep deploy: force
52         $(SCRIPTS_PATH)/set-webkit-configuration --release $(ASAN_OPTION)
53         ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
54
55 analyze:
56         $(SCRIPTS_PATH)/set-webkit-configuration --release $(ASAN_OPTION)
57 ifndef PATH_TO_SCAN_BUILD
58         ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) RUN_CLANG_STATIC_ANALYZER=YES | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
59 else
60         ( $(SET_COLOR_DIAGNOSTICS_ARG); $(PATH_TO_SCAN_BUILD) xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
61 endif
62
63 set_asan_configuration:
64 ifneq (,$(ASAN_OPTION))
65         $(SCRIPTS_PATH)/set-webkit-configuration $(ASAN_OPTION)
66 endif
67
68 clean:
69         ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) -alltargets clean $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
70
71 force: ;