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)) |
| 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 |
thatcher | fab2077 | 2006-01-08 04:14:06 +0000 | [diff] [blame] | 14 | |
mrowe@apple.com | aac5dab | 2012-02-03 07:44:38 +0000 | [diff] [blame] | 15 | DEFAULT_VERBOSITY := $(shell defaults read org.webkit.BuildConfiguration BuildTranscriptVerbosity 2>/dev/null || echo "default") |
| 16 | VERBOSITY ?= $(DEFAULT_VERBOSITY) |
| 17 | |
| 18 | ifeq ($(VERBOSITY),default) |
| 19 | OUTPUT_FILTER = grep -v setenv |
| 20 | else |
| 21 | ifeq ($(VERBOSITY),noisy) |
| 22 | OUTPUT_FILTER = cat |
| 23 | else |
| 24 | OUTPUT_FILTER = $(SCRIPTS_PATH)/filter-build-webkit |
| 25 | endif |
| 26 | endif |
| 27 | |
ap@apple.com | 224b70f | 2014-12-24 00:13:16 +0000 | [diff] [blame] | 28 | ifeq ($(ASAN),YES) |
| 29 | ASAN_OPTION=--asan |
| 30 | else |
| 31 | ifeq ($(ASAN),NO) |
| 32 | ASAN_OPTION=--no-asan |
| 33 | endif |
| 34 | endif |
| 35 | |
dfarler@apple.com | bad8b08 | 2014-08-06 23:33:55 +0000 | [diff] [blame] | 36 | export DSYMUTIL_NUM_THREADS = $(shell sysctl -n hw.activecpu) |
dfarler@apple.com | 101233e | 2014-08-06 20:38:15 +0000 | [diff] [blame] | 37 | |
mitz@apple.com | ffd5821 | 2015-01-10 21:57:32 +0000 | [diff] [blame] | 38 | # 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>. |
| 40 | export PATH = $(shell getconf PATH) |
| 41 | |
ap@apple.com | 224b70f | 2014-12-24 00:13:16 +0000 | [diff] [blame] | 42 | all: set_asan_configuration |
mitz@apple.com | bdecfa01a | 2014-01-15 06:10:54 +0000 | [diff] [blame] | 43 | ( $(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] | 44 | |
commit-queue@webkit.org | 8da3ed1 | 2013-01-28 04:22:30 +0000 | [diff] [blame] | 45 | debug d development dev develop: force |
ap@apple.com | 224b70f | 2014-12-24 00:13:16 +0000 | [diff] [blame] | 46 | $(SCRIPTS_PATH)/set-webkit-configuration --debug $(ASAN_OPTION) |
mitz@apple.com | bdecfa01a | 2014-01-15 06:10:54 +0000 | [diff] [blame] | 47 | ( $(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] | 48 | |
commit-queue@webkit.org | 8da3ed1 | 2013-01-28 04:22:30 +0000 | [diff] [blame] | 49 | release r deployment dep deploy: force |
ap@apple.com | 224b70f | 2014-12-24 00:13:16 +0000 | [diff] [blame] | 50 | $(SCRIPTS_PATH)/set-webkit-configuration --release $(ASAN_OPTION) |
mitz@apple.com | bdecfa01a | 2014-01-15 06:10:54 +0000 | [diff] [blame] | 51 | ( $(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] | 52 | |
dburkart@apple.com | e8fc8f4 | 2014-07-18 22:39:39 +0000 | [diff] [blame] | 53 | analyze: |
ap@apple.com | 224b70f | 2014-12-24 00:13:16 +0000 | [diff] [blame] | 54 | $(SCRIPTS_PATH)/set-webkit-configuration --release $(ASAN_OPTION) |
dburkart@apple.com | e8fc8f4 | 2014-07-18 22:39:39 +0000 | [diff] [blame] | 55 | ifndef PATH_TO_SCAN_BUILD |
| 56 | ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) RUN_CLANG_STATIC_ANALYZER=YES | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} ) |
| 57 | else |
| 58 | ( $(SET_COLOR_DIAGNOSTICS_ARG); $(PATH_TO_SCAN_BUILD) xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} ) |
| 59 | endif |
| 60 | |
ap@apple.com | 224b70f | 2014-12-24 00:13:16 +0000 | [diff] [blame] | 61 | set_asan_configuration: |
| 62 | ifneq (,$(ASAN_OPTION)) |
| 63 | $(SCRIPTS_PATH)/set-webkit-configuration $(ASAN_OPTION) |
| 64 | endif |
| 65 | |
thatcher | fab2077 | 2006-01-08 04:14:06 +0000 | [diff] [blame] | 66 | clean: |
mitz@apple.com | bdecfa01a | 2014-01-15 06:10:54 +0000 | [diff] [blame] | 67 | ( $(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] | 68 | |
| 69 | force: ; |