mitz@apple.com | 10955a5a | 2010-12-18 00:02:12 +0000 | [diff] [blame] | 1 | SCRIPTS_PATH ?= ../Tools/Scripts |
commit-queue@webkit.org | c5fe5e8 | 2013-02-08 00:56:03 +0000 | [diff] [blame] | 2 | |
mitz@apple.com | bdecfa01a | 2014-01-15 06:10:54 +0000 | [diff] [blame] | 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) |
commit-queue@webkit.org | c5fe5e8 | 2013-02-08 00:56:03 +0000 | [diff] [blame] | 5 | |
| 6 | ifneq (,$(SDKROOT)) |
dbates@webkit.org | 069a691 | 2015-11-06 16:58:31 +0000 | [diff] [blame] | 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 |
commit-queue@webkit.org | c5fe5e8 | 2013-02-08 00:56:03 +0000 | [diff] [blame] | 15 | endif |
| 16 | |
| 17 | ifneq (,$(ARCHS)) |
dbates@webkit.org | 069a691 | 2015-11-06 16:58:31 +0000 | [diff] [blame] | 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 |
ap@apple.com | fc3873f | 2016-07-18 16:17:52 +0000 | [diff] [blame] | 27 | # Make Plugin.32 and Plugin.64 build even when they can't be built for the specified architecture. |
| 28 | ifeq ($(ARCHS),i386) |
| 29 | XCODE_OPTIONS += VALID_ARCHS=i386 |
| 30 | endif |
| 31 | ifeq ($(ARCHS),x86_64) |
| 32 | XCODE_OPTIONS += VALID_ARCHS=x86_64 |
| 33 | endif |
dbates@webkit.org | 069a691 | 2015-11-06 16:58:31 +0000 | [diff] [blame] | 34 | endif |
commit-queue@webkit.org | c5fe5e8 | 2013-02-08 00:56:03 +0000 | [diff] [blame] | 35 | endif |
thatcher | fab2077 | 2006-01-08 04:14:06 +0000 | [diff] [blame] | 36 | |
mrowe@apple.com | aac5dab | 2012-02-03 07:44:38 +0000 | [diff] [blame] | 37 | DEFAULT_VERBOSITY := $(shell defaults read org.webkit.BuildConfiguration BuildTranscriptVerbosity 2>/dev/null || echo "default") |
| 38 | VERBOSITY ?= $(DEFAULT_VERBOSITY) |
| 39 | |
| 40 | ifeq ($(VERBOSITY),default) |
mitz@apple.com | 0fb0575 | 2016-07-04 05:59:26 +0000 | [diff] [blame] | 41 | OUTPUT_FILTER = cat |
| 42 | XCODE_OPTIONS += -hideShellScriptEnvironment |
mrowe@apple.com | aac5dab | 2012-02-03 07:44:38 +0000 | [diff] [blame] | 43 | else |
| 44 | ifeq ($(VERBOSITY),noisy) |
| 45 | OUTPUT_FILTER = cat |
| 46 | else |
| 47 | OUTPUT_FILTER = $(SCRIPTS_PATH)/filter-build-webkit |
| 48 | endif |
| 49 | endif |
| 50 | |
ap@apple.com | 224b70f | 2014-12-24 00:13:16 +0000 | [diff] [blame] | 51 | ifeq ($(ASAN),YES) |
| 52 | ASAN_OPTION=--asan |
| 53 | else |
| 54 | ifeq ($(ASAN),NO) |
| 55 | ASAN_OPTION=--no-asan |
| 56 | endif |
| 57 | endif |
| 58 | |
dfarler@apple.com | bad8b08 | 2014-08-06 23:33:55 +0000 | [diff] [blame] | 59 | export DSYMUTIL_NUM_THREADS = $(shell sysctl -n hw.activecpu) |
dfarler@apple.com | 101233e | 2014-08-06 20:38:15 +0000 | [diff] [blame] | 60 | |
mitz@apple.com | ffd5821 | 2015-01-10 21:57:32 +0000 | [diff] [blame] | 61 | # Run xcodebuild with the same PATH with which the Xcode IDE runs, to mitigate unnecessary rebuilds due to PATH differences. |
| 62 | # See <rdar://problem/16466196>. |
| 63 | export PATH = $(shell getconf PATH) |
| 64 | |
ap@apple.com | 224b70f | 2014-12-24 00:13:16 +0000 | [diff] [blame] | 65 | all: set_asan_configuration |
mitz@apple.com | bdecfa01a | 2014-01-15 06:10:54 +0000 | [diff] [blame] | 66 | ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} ) |
thatcher | fab2077 | 2006-01-08 04:14:06 +0000 | [diff] [blame] | 67 | |
commit-queue@webkit.org | 8da3ed1 | 2013-01-28 04:22:30 +0000 | [diff] [blame] | 68 | debug d development dev develop: force |
ap@apple.com | 224b70f | 2014-12-24 00:13:16 +0000 | [diff] [blame] | 69 | $(SCRIPTS_PATH)/set-webkit-configuration --debug $(ASAN_OPTION) |
mitz@apple.com | bdecfa01a | 2014-01-15 06:10:54 +0000 | [diff] [blame] | 70 | ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} ) |
thatcher | fab2077 | 2006-01-08 04:14:06 +0000 | [diff] [blame] | 71 | |
commit-queue@webkit.org | 8da3ed1 | 2013-01-28 04:22:30 +0000 | [diff] [blame] | 72 | release r deployment dep deploy: force |
ap@apple.com | 224b70f | 2014-12-24 00:13:16 +0000 | [diff] [blame] | 73 | $(SCRIPTS_PATH)/set-webkit-configuration --release $(ASAN_OPTION) |
mitz@apple.com | bdecfa01a | 2014-01-15 06:10:54 +0000 | [diff] [blame] | 74 | ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} ) |
thatcher | fab2077 | 2006-01-08 04:14:06 +0000 | [diff] [blame] | 75 | |
dburkart@apple.com | e8fc8f4 | 2014-07-18 22:39:39 +0000 | [diff] [blame] | 76 | analyze: |
dburkart@apple.com | 94be07c | 2015-10-26 21:45:23 +0000 | [diff] [blame] | 77 | $(SCRIPTS_PATH)/set-webkit-configuration --debug $(ASAN_OPTION) |
dburkart@apple.com | e8fc8f4 | 2014-07-18 22:39:39 +0000 | [diff] [blame] | 78 | ifndef PATH_TO_SCAN_BUILD |
| 79 | ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) RUN_CLANG_STATIC_ANALYZER=YES | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} ) |
| 80 | else |
| 81 | ( $(SET_COLOR_DIAGNOSTICS_ARG); $(PATH_TO_SCAN_BUILD) xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} ) |
| 82 | endif |
| 83 | |
ap@apple.com | 224b70f | 2014-12-24 00:13:16 +0000 | [diff] [blame] | 84 | set_asan_configuration: |
| 85 | ifneq (,$(ASAN_OPTION)) |
| 86 | $(SCRIPTS_PATH)/set-webkit-configuration $(ASAN_OPTION) |
| 87 | endif |
| 88 | |
thatcher | fab2077 | 2006-01-08 04:14:06 +0000 | [diff] [blame] | 89 | clean: |
mitz@apple.com | bdecfa01a | 2014-01-15 06:10:54 +0000 | [diff] [blame] | 90 | ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) -alltargets clean $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} ) |
thatcher | 8abc374 | 2006-03-07 23:35:12 +0000 | [diff] [blame] | 91 | |
| 92 | force: ; |