blob: 61c066dfe96fa33d4469643368cfb44a958bbb1c [file] [log] [blame]
mitz@apple.com10955a5a2010-12-18 00:02:12 +00001SCRIPTS_PATH ?= ../Tools/Scripts
commit-queue@webkit.orgc5fe5e82013-02-08 00:56:03 +00002
mitz@apple.combdecfa01a2014-01-15 06:10:54 +00003SET_COLOR_DIAGNOSTICS_ARG = if [[ -t 1 ]]; then COLOR_DIAGNOSTICS_ARG="COLOR_DIAGNOSTICS=YES"; fi
4XCODE_OPTIONS = `perl -I$(SCRIPTS_PATH) -Mwebkitdirs -e 'print XcodeOptionString()' -- $(BUILD_WEBKIT_OPTIONS)` $${COLOR_DIAGNOSTICS_ARG} $(ARGS)
commit-queue@webkit.orgc5fe5e82013-02-08 00:56:03 +00005
6ifneq (,$(SDKROOT))
7 XCODE_OPTIONS += SDKROOT=$(SDKROOT)
8endif
9
10ifneq (,$(ARCHS))
11 XCODE_OPTIONS += ARCHS="$(ARCHS)"
12 XCODE_OPTIONS += ONLY_ACTIVE_ARCH=NO
13endif
thatcherfab20772006-01-08 04:14:06 +000014
mrowe@apple.comaac5dab2012-02-03 07:44:38 +000015DEFAULT_VERBOSITY := $(shell defaults read org.webkit.BuildConfiguration BuildTranscriptVerbosity 2>/dev/null || echo "default")
16VERBOSITY ?= $(DEFAULT_VERBOSITY)
17
18ifeq ($(VERBOSITY),default)
19OUTPUT_FILTER = grep -v setenv
20else
21ifeq ($(VERBOSITY),noisy)
22OUTPUT_FILTER = cat
23else
24OUTPUT_FILTER = $(SCRIPTS_PATH)/filter-build-webkit
25endif
26endif
27
ap@apple.com224b70f2014-12-24 00:13:16 +000028ifeq ($(ASAN),YES)
29ASAN_OPTION=--asan
30else
31ifeq ($(ASAN),NO)
32ASAN_OPTION=--no-asan
33endif
34endif
35
dfarler@apple.combad8b082014-08-06 23:33:55 +000036export DSYMUTIL_NUM_THREADS = $(shell sysctl -n hw.activecpu)
dfarler@apple.com101233e2014-08-06 20:38:15 +000037
mitz@apple.comffd58212015-01-10 21:57:32 +000038# Run xcodebuild with the same PATH with which the Xcode IDE runs, to mitigate unnecessary rebuilds due to PATH differences.
39# See <rdar://problem/16466196>.
40export PATH = $(shell getconf PATH)
41
ap@apple.com224b70f2014-12-24 00:13:16 +000042all: set_asan_configuration
mitz@apple.combdecfa01a2014-01-15 06:10:54 +000043 ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
thatcherfab20772006-01-08 04:14:06 +000044
commit-queue@webkit.org8da3ed12013-01-28 04:22:30 +000045debug d development dev develop: force
ap@apple.com224b70f2014-12-24 00:13:16 +000046 $(SCRIPTS_PATH)/set-webkit-configuration --debug $(ASAN_OPTION)
mitz@apple.combdecfa01a2014-01-15 06:10:54 +000047 ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
thatcherfab20772006-01-08 04:14:06 +000048
commit-queue@webkit.org8da3ed12013-01-28 04:22:30 +000049release r deployment dep deploy: force
ap@apple.com224b70f2014-12-24 00:13:16 +000050 $(SCRIPTS_PATH)/set-webkit-configuration --release $(ASAN_OPTION)
mitz@apple.combdecfa01a2014-01-15 06:10:54 +000051 ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
thatcherfab20772006-01-08 04:14:06 +000052
dburkart@apple.come8fc8f42014-07-18 22:39:39 +000053analyze:
ap@apple.com224b70f2014-12-24 00:13:16 +000054 $(SCRIPTS_PATH)/set-webkit-configuration --release $(ASAN_OPTION)
dburkart@apple.come8fc8f42014-07-18 22:39:39 +000055ifndef PATH_TO_SCAN_BUILD
56 ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) RUN_CLANG_STATIC_ANALYZER=YES | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
57else
58 ( $(SET_COLOR_DIAGNOSTICS_ARG); $(PATH_TO_SCAN_BUILD) xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
59endif
60
ap@apple.com224b70f2014-12-24 00:13:16 +000061set_asan_configuration:
62ifneq (,$(ASAN_OPTION))
63 $(SCRIPTS_PATH)/set-webkit-configuration $(ASAN_OPTION)
64endif
65
thatcherfab20772006-01-08 04:14:06 +000066clean:
mitz@apple.combdecfa01a2014-01-15 06:10:54 +000067 ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) -alltargets clean $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
thatcher8abc3742006-03-07 23:35:12 +000068
69force: ;