Rename test LayoutTests/fast/events/drag-link.html to drag-and-drop-link-into-focused...
[WebKit-https.git] / Makefile.shared
index 096d32e..61c066d 100644 (file)
@@ -1,27 +1,69 @@
-SCRIPTS_PATH ?= ../WebKitTools/Scripts
-XCODE_OPTIONS = `perl -I$(SCRIPTS_PATH) -Mwebkitdirs -e 'print XcodeOptionString()'` $(ARGS)
+SCRIPTS_PATH ?= ../Tools/Scripts
 
 
-all:
-       ( xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | grep -v setenv && exit $${PIPESTATUS[0]} )
+SET_COLOR_DIAGNOSTICS_ARG = if [[ -t 1 ]]; then COLOR_DIAGNOSTICS_ARG="COLOR_DIAGNOSTICS=YES"; fi
+XCODE_OPTIONS = `perl -I$(SCRIPTS_PATH) -Mwebkitdirs -e 'print XcodeOptionString()' -- $(BUILD_WEBKIT_OPTIONS)` $${COLOR_DIAGNOSTICS_ARG} $(ARGS)
+
+ifneq (,$(SDKROOT))
+       XCODE_OPTIONS += SDKROOT=$(SDKROOT)
+endif
+
+ifneq (,$(ARCHS))
+       XCODE_OPTIONS += ARCHS="$(ARCHS)"
+       XCODE_OPTIONS += ONLY_ACTIVE_ARCH=NO
+endif
+
+DEFAULT_VERBOSITY := $(shell defaults read org.webkit.BuildConfiguration BuildTranscriptVerbosity 2>/dev/null || echo "default")
+VERBOSITY ?= $(DEFAULT_VERBOSITY)
+
+ifeq ($(VERBOSITY),default)
+OUTPUT_FILTER = grep -v setenv
+else
+ifeq ($(VERBOSITY),noisy)
+OUTPUT_FILTER = cat
+else
+OUTPUT_FILTER = $(SCRIPTS_PATH)/filter-build-webkit
+endif
+endif
+
+ifeq ($(ASAN),YES)
+ASAN_OPTION=--asan
+else
+ifeq ($(ASAN),NO)
+ASAN_OPTION=--no-asan
+endif
+endif
+
+export DSYMUTIL_NUM_THREADS = $(shell sysctl -n hw.activecpu)
+
+# Run xcodebuild with the same PATH with which the Xcode IDE runs, to mitigate unnecessary rebuilds due to PATH differences.
+# See <rdar://problem/16466196>.
+export PATH = $(shell getconf PATH)
+
+all: set_asan_configuration
+       ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
 
 debug d development dev develop: force
 
 debug d development dev develop: force
-       $(SCRIPTS_PATH)/set-webkit-configuration --debug
-       ( xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | grep -v setenv && exit $${PIPESTATUS[0]} )
+       $(SCRIPTS_PATH)/set-webkit-configuration --debug $(ASAN_OPTION)
+       ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
 
 release r deployment dep deploy: force
 
 release r deployment dep deploy: force
-       $(SCRIPTS_PATH)/set-webkit-configuration --release
-       ( xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | grep -v setenv && exit $${PIPESTATUS[0]} )
-
-universal u: force
-       ( xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) 'ARCHS=ppc i386' | grep -v setenv && exit $${PIPESTATUS[0]} )
+       $(SCRIPTS_PATH)/set-webkit-configuration --release $(ASAN_OPTION)
+       ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
 
 
-64: force
-       ( xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) 'ARCHS=i386 x86_64' | grep -v setenv && exit $${PIPESTATUS[0]} )
+analyze:
+       $(SCRIPTS_PATH)/set-webkit-configuration --release $(ASAN_OPTION)
+ifndef PATH_TO_SCAN_BUILD
+       ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) RUN_CLANG_STATIC_ANALYZER=YES | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
+else
+       ( $(SET_COLOR_DIAGNOSTICS_ARG); $(PATH_TO_SCAN_BUILD) xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
+endif
 
 
-64u: force
-       ( xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) 'ARCHS=ppc ppc64 i386 x86_64' | grep -v setenv && exit $${PIPESTATUS[0]} )
+set_asan_configuration:
+ifneq (,$(ASAN_OPTION))
+       $(SCRIPTS_PATH)/set-webkit-configuration $(ASAN_OPTION)
+endif
 
 clean:
 
 clean:
-       ( xcodebuild $(OTHER_OPTIONS) -alltargets clean $(XCODE_OPTIONS) | grep -v setenv && exit $${PIPESTATUS[0]} )
+       ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) -alltargets clean $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
 
 force: ;
 
 force: ;