aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStella Stamenova <stilis@microsoft.com>2018-11-19 10:59:29 -0800
committerandroid-build-merger <android-build-merger@google.com>2018-11-19 10:59:29 -0800
commitd5dec1d027e1ca5654e2d922cd8c567cb521bc5a (patch)
treedc8bb27a62929ce7a52d62a271f7947c0d830b0d
parentb0f9267cc0baa0532494641354edecf6642ab547 (diff)
parent94ceb3a7ecbba2fb1abc85a8219276557d6daaa0 (diff)
downloadlldb-d5dec1d027e1ca5654e2d922cd8c567cb521bc5a.tar.gz
[lldbsuite] Invoke sed on Windows to determine the cache dir for clang
am: 94ceb3a7ec Change-Id: I703f5338e19178c2724b2c9534478aa263d6c4bb
-rw-r--r--packages/Python/lldbsuite/test/make/Makefile.rules61
1 files changed, 31 insertions, 30 deletions
diff --git a/packages/Python/lldbsuite/test/make/Makefile.rules b/packages/Python/lldbsuite/test/make/Makefile.rules
index f38ee5b1e..3710acc30 100644
--- a/packages/Python/lldbsuite/test/make/Makefile.rules
+++ b/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -61,6 +61,22 @@ ifeq "$(OS)" "Windows_NT"
endif
#----------------------------------------------------------------------
+# If the OS is Windows use double-quotes in commands
+#
+# For other operating systems, single-quotes work fine, but on Windows
+# we strictly required double-quotes
+#----------------------------------------------------------------------
+ifeq "$(HOST_OS)" "Windows_NT"
+ JOIN_CMD = &
+ QUOTE = "
+ FIXUP_SYNTAX_HIGHLIGHTING_IN_MY_EDITOR = "
+else
+ JOIN_CMD = ;
+ QUOTE = '
+ FIXUP_SYNTAX_HIGHLIGHTING_IN_MY_EDITOR = '
+endif
+
+#----------------------------------------------------------------------
# If TRIPLE is not defined try to set the ARCH, CC, CFLAGS, and more
# from the triple alone
#----------------------------------------------------------------------
@@ -74,8 +90,8 @@ ifneq "$(TRIPLE)" ""
TRIPLE_VERSION =$(word 2, $(triple_os_and_version))
ifeq "$(TRIPLE_VENDOR)" "apple"
ifeq "$(TRIPLE_OS)" "ios"
- CODESIGN := codesign
- ifeq "$(SDKROOT)" ""
+ CODESIGN := codesign
+ ifeq "$(SDKROOT)" ""
# Set SDKROOT if it wasn't set
ifneq (,$(findstring arm,$(ARCH)))
SDKROOT = $(shell xcrun --sdk iphoneos --show-sdk-path)
@@ -253,12 +269,7 @@ ifeq "$(MAKE_DWO)" "YES"
endif
# Use a shared module cache when building in the default test build directory.
-ifeq "$(OS)" "Windows_NT"
-CLANG_MODULE_CACHE_DIR := $(BUILDDIR)/module-cache
-else
-# FIXME: Get sed to work on Windows here.
-CLANG_MODULE_CACHE_DIR := $(shell echo "$(BUILDDIR)" | sed 's/lldb-test-build.noindex.*/lldb-test-build.noindex\/module-cache-clang/')
-endif
+CLANG_MODULE_CACHE_DIR := $(shell echo "$(BUILDDIR)" | sed $(QUOTE)s/lldb-test-build.noindex.*/lldb-test-build.noindex\/module-cache-clang/$(QUOTE))
ifeq "$(findstring lldb-test-build.noindex, $(BUILDDIR))" ""
CLANG_MODULE_CACHE_DIR := $(BUILDDIR)/module-cache
@@ -343,7 +354,7 @@ ifneq "$(OS)" "Darwin"
endif
ifdef PIE
- LDFLAGS += -pie
+ LDFLAGS += -pie
endif
#----------------------------------------------------------------------
@@ -408,17 +419,17 @@ ifneq "$(strip $(DYLIB_OBJC_SOURCES))" ""
endif
ifneq "$(strip $(DYLIB_CXX_SOURCES))" ""
- DYLIB_OBJECTS +=$(strip $(DYLIB_CXX_SOURCES:.cpp=.o))
- CXX = $(call cxx_compiler,$(CC))
- LD = $(call cxx_linker,$(CC))
+ DYLIB_OBJECTS +=$(strip $(DYLIB_CXX_SOURCES:.cpp=.o))
+ CXX = $(call cxx_compiler,$(CC))
+ LD = $(call cxx_linker,$(CC))
endif
#----------------------------------------------------------------------
# Check if we have a precompiled header
#----------------------------------------------------------------------
ifneq "$(strip $(PCH_CXX_SOURCE))" ""
- PCH_OUTPUT = $(PCH_CXX_SOURCE:.h=.h.pch)
- PCHFLAGS = -include $(PCH_CXX_SOURCE)
+ PCH_OUTPUT = $(PCH_CXX_SOURCE:.h=.h.pch)
+ PCHFLAGS = -include $(PCH_CXX_SOURCE)
endif
#----------------------------------------------------------------------
@@ -500,21 +511,21 @@ ifneq "$(strip $(CXX_SOURCES) $(OBJCXX_SOURCES))" ""
ifneq "$(filter g++,$(CXX))" ""
CXXVERSION = $(shell $(CXX) -dumpversion | cut -b 1-3)
ifeq "$(CXXVERSION)" "4.6"
- # GCC 4.6 cannot handle -std=c++11, so replace it with -std=c++0x
- # instead. FIXME: remove once GCC version is upgraded.
+ # GCC 4.6 cannot handle -std=c++11, so replace it with -std=c++0x
+ # instead. FIXME: remove once GCC version is upgraded.
override CXXFLAGS := $(subst -std=c++11,-std=c++0x,$(CXXFLAGS))
endif
endif
endif
ifeq ($(findstring clang, $(CXX)), clang)
- CXXFLAGS += --driver-mode=g++
+ CXXFLAGS += --driver-mode=g++
endif
ifneq "$(CXX)" ""
- ifeq ($(findstring clang, $(LD)), clang)
- LDFLAGS += --driver-mode=g++
- endif
+ ifeq ($(findstring clang, $(LD)), clang)
+ LDFLAGS += --driver-mode=g++
+ endif
endif
#----------------------------------------------------------------------
@@ -628,16 +639,6 @@ endif
# the compiler -MM option. The -M option will list all system headers,
# and the -MM option will list all non-system dependencies.
#----------------------------------------------------------------------
-ifeq "$(HOST_OS)" "Windows_NT"
- JOIN_CMD = &
- QUOTE = "
- FIXUP_SYNTAX_HIGHLIGHTING_IN_MY_EDITOR = "
-else
- JOIN_CMD = ;
- QUOTE = '
- FIXUP_SYNTAX_HIGHLIGHTING_IN_MY_EDITOR = '
-endif
-
%.d: %.c
@rm -f $@ $(JOIN_CMD) \
$(CC) -M $(CFLAGS) $< > $@.tmp && \