aboutsummaryrefslogtreecommitdiff
path: root/packages/Python/lldbsuite/test/make/Makefile.rules
diff options
context:
space:
mode:
Diffstat (limited to 'packages/Python/lldbsuite/test/make/Makefile.rules')
-rw-r--r--packages/Python/lldbsuite/test/make/Makefile.rules37
1 files changed, 35 insertions, 2 deletions
diff --git a/packages/Python/lldbsuite/test/make/Makefile.rules b/packages/Python/lldbsuite/test/make/Makefile.rules
index e753317e9398..c37ef745e8b4 100644
--- a/packages/Python/lldbsuite/test/make/Makefile.rules
+++ b/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -168,6 +168,10 @@ else
override ARCH :=
override ARCHFLAG :=
endif
+ ifeq "$(ARCH)" "s390x"
+ override ARCH :=
+ override ARCHFLAG :=
+ endif
ifeq "$(findstring mips,$(ARCH))" "mips"
override ARCHFLAG := -
endif
@@ -179,9 +183,11 @@ endif
LIMIT_DEBUG_INFO_FLAGS =
NO_LIMIT_DEBUG_INFO_FLAGS =
+MODULE_DEBUG_INFO_FLAGS =
ifneq (,$(findstring clang,$(CC)))
LIMIT_DEBUG_INFO_FLAGS += -flimit-debug-info
NO_LIMIT_DEBUG_INFO_FLAGS += -fno-limit-debug-info
+ MODULE_DEBUG_INFO_FLAGS += -gmodules
endif
DEBUG_INFO_FLAG ?= -g
@@ -206,8 +212,13 @@ ifeq "$(MAKE_DWO)" "YES"
CFLAGS += -gsplit-dwarf
endif
+ifeq "$(MAKE_GMODULES)" "YES"
+ CFLAGS += -fmodules -gmodules
+endif
+
CXXFLAGS += -std=c++11
-CXXFLAGS += $(CFLAGS)
+# FIXME: C++ modules aren't supported on all platforms.
+CXXFLAGS += $(subst -fmodules,, $(CFLAGS))
LD = $(CC)
LDFLAGS ?= $(CFLAGS)
LDFLAGS += $(LD_EXTRAS)
@@ -300,7 +311,7 @@ endif
ifeq (1,$(USE_LIBSTDCPP))
# Clang requires an extra flag: -stdlib=libstdc++
ifneq (,$(findstring clang,$(CC)))
- CXXFLAGS += -stdlib=libstdc++
+ CXXFLAGS += -stdlib=libstdc++ -DLLDB_USING_LIBSTDCPP
LDFLAGS += -stdlib=libstdc++
endif
endif
@@ -340,6 +351,14 @@ ifneq "$(strip $(DYLIB_CXX_SOURCES))" ""
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)
+endif
+
+#----------------------------------------------------------------------
# Check if we have any C source files
#----------------------------------------------------------------------
ifneq "$(strip $(C_SOURCES))" ""
@@ -498,6 +517,17 @@ endif
endif
#----------------------------------------------------------------------
+# Make the precompiled header and compile C++ sources against it
+#----------------------------------------------------------------------
+
+#ifneq "$(PCH_OUTPUT)" ""
+$(PCH_OUTPUT) : $(PCH_CXX_SOURCE)
+ $(CXX) $(CXXFLAGS) -x c++-header -o $(PCH_OUTPUT) $(PCH_CXX_SOURCE)
+%.o : %.cpp $(PCH_OUTPUT)
+ $(CXX) $(PCHFLAGS) $(CXXFLAGS) -c -o $@ $<
+#endif
+
+#----------------------------------------------------------------------
# Automatic variables based on items already entered. Below we create
# an object's lists from the list of sources by replacing all entries
# that end with .c with .o, and we also create a list of prerequisite
@@ -570,6 +600,9 @@ ifneq "$(DYLIB_NAME)" ""
$(RM) -r $(DYLIB_FILENAME).dSYM
$(RM) $(DYLIB_OBJECTS) $(DYLIB_PREREQS) $(DYLIB_PREREQS:.d=.d.tmp) $(DYLIB_DWOS) $(DYLIB_FILENAME) $(DYLIB_FILENAME).debug
endif
+ifneq "$(PCH_OUTPUT)" ""
+ $(RM) $(PCH_OUTPUT)
+endif
ifneq "$(DSYM)" ""
$(RM) -r "$(DSYM)"
endif