2010-07-10 04:39:50 +08:00
|
|
|
##===- Makefile --------------------------------------------*- Makefile -*-===##
|
|
|
|
#
|
|
|
|
# The LLVM Compiler Infrastructure
|
|
|
|
#
|
|
|
|
# This file is distributed under the University of Illinois Open Source
|
|
|
|
# License. See LICENSE.TXT for details.
|
|
|
|
#
|
|
|
|
##===----------------------------------------------------------------------===##
|
|
|
|
|
|
|
|
# If LLDB_LEVEL is not set, then we are the top-level Makefile. Otherwise, we
|
|
|
|
# are being included from a subdirectory makefile.
|
|
|
|
|
|
|
|
ifndef LLDB_LEVEL
|
|
|
|
|
|
|
|
IS_TOP_LEVEL := 1
|
|
|
|
LLDB_LEVEL := .
|
2014-02-26 15:39:20 +08:00
|
|
|
DIRS := include scripts source lib tools
|
2010-07-10 04:39:50 +08:00
|
|
|
|
|
|
|
PARALLEL_DIRS :=
|
|
|
|
endif
|
|
|
|
|
|
|
|
###
|
|
|
|
# Common Makefile code, shared by all LLDB Makefiles.
|
|
|
|
|
|
|
|
# Set LLVM source root level.
|
|
|
|
LEVEL := $(LLDB_LEVEL)/../..
|
|
|
|
|
|
|
|
# Include LLVM common makefile.
|
|
|
|
include $(LEVEL)/Makefile.common
|
|
|
|
|
|
|
|
# Set common LLDB build flags.
|
2014-03-05 17:40:33 +08:00
|
|
|
CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/include
|
2010-07-10 04:39:50 +08:00
|
|
|
CPP.Flags += -I$(PROJ_OBJ_DIR)/$(LLDB_LEVEL)/include
|
2011-11-12 07:36:19 +08:00
|
|
|
CPP.Flags += -I$(LLVM_SRC_ROOT)/tools/clang/include
|
|
|
|
CPP.Flags += -I$(LLVM_OBJ_ROOT)/tools/clang/include
|
2010-07-10 04:39:50 +08:00
|
|
|
CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source
|
2011-01-26 07:03:42 +08:00
|
|
|
CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source/Utility
|
2010-07-10 04:39:50 +08:00
|
|
|
CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source/Plugins/Process/Utility
|
2012-01-06 03:17:38 +08:00
|
|
|
CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source/Plugins/Process/POSIX
|
2013-08-23 20:44:05 +08:00
|
|
|
|
|
|
|
ifeq (,$(findstring -DLLDB_DISABLE_PYTHON,$(CXXFLAGS)))
|
|
|
|
# Set Python include directory
|
|
|
|
PYTHON_INC_DIR = $(shell python-config --includes)
|
|
|
|
CPP.Flags += $(PYTHON_INC_DIR)
|
|
|
|
endif
|
|
|
|
|
2010-07-10 04:39:50 +08:00
|
|
|
ifeq ($(HOST_OS),Darwin)
|
2013-09-19 00:32:28 +08:00
|
|
|
CPP.Flags += $(subst -I,-I$(SDKROOT),$(PYTHON_INC_DIR))
|
|
|
|
CPP.Flags += -F$(SDKROOT)/System/Library/Frameworks
|
|
|
|
CPP.Flags += -F$(SDKROOT)/System/Library/PrivateFrameworks
|
|
|
|
CPP.Flags += -I$(SDKROOT)/usr/include/libxml2
|
2010-07-10 04:39:50 +08:00
|
|
|
endif
|
|
|
|
ifdef LLDB_VENDOR
|
|
|
|
CPP.Flags += -DLLDB_VENDOR='"$(LLDB_VENDOR) "'
|
|
|
|
endif
|
|
|
|
|
2013-03-07 08:48:53 +08:00
|
|
|
# If building on a 32-bit system, make sure off_t can store offsets > 2GB
|
|
|
|
ifneq "$(HOST_ARCH)" "x86_64"
|
|
|
|
CPP.Flags += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
|
|
|
|
endif
|
|
|
|
|
2010-07-10 04:39:50 +08:00
|
|
|
# Disable -fstrict-aliasing. Darwin disables it by default (and LLVM doesn't
|
|
|
|
# work with it enabled with GCC), Clang/llvm-gc don't support it yet, and newer
|
|
|
|
# GCC's have false positive warnings with it on Linux (which prove a pain to
|
|
|
|
# fix). For example:
|
|
|
|
# http://gcc.gnu.org/PR41874
|
|
|
|
# http://gcc.gnu.org/PR41838
|
|
|
|
#
|
|
|
|
# We can revisit this when LLVM/Clang support it.
|
|
|
|
CXX.Flags += -fno-strict-aliasing
|
|
|
|
|
2011-01-07 06:10:24 +08:00
|
|
|
# Do not warn about pragmas. In particular, we are looking to ignore the
|
|
|
|
# "#pragma mark" construct which GCC warns about on platforms other than Darwin.
|
|
|
|
EXTRA_OPTIONS += -Wno-unknown-pragmas
|
|
|
|
|
2011-11-01 06:50:55 +08:00
|
|
|
# Drop -Wsign-compare, which we are not currently clean with.
|
|
|
|
EXTRA_OPTIONS += -Wno-sign-compare
|
|
|
|
|
|
|
|
# Drop -Wunused-function and -Wunneeded-internal-declaration, which we are not
|
|
|
|
# currently clean with.
|
2012-02-23 04:10:46 +08:00
|
|
|
EXTRA_OPTIONS += -Wno-sign-compare -Wno-unused-function
|
2011-11-01 06:50:55 +08:00
|
|
|
|
2010-07-10 04:39:50 +08:00
|
|
|
###
|
|
|
|
# LLDB Top Level specific stuff.
|
|
|
|
|
|
|
|
ifeq ($(IS_TOP_LEVEL),1)
|
|
|
|
|
|
|
|
ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
|
|
|
|
$(RecursiveTargets)::
|
|
|
|
$(Verb) if [ ! -f test/Makefile ]; then \
|
|
|
|
$(MKDIR) test; \
|
|
|
|
$(CP) $(PROJ_SRC_DIR)/test/Makefile test/Makefile; \
|
|
|
|
fi
|
|
|
|
endif
|
|
|
|
|
2011-06-21 03:06:57 +08:00
|
|
|
test::
|
|
|
|
@ $(MAKE) -C test
|
2010-07-10 04:39:50 +08:00
|
|
|
|
2010-07-10 06:36:15 +08:00
|
|
|
#report::
|
|
|
|
# @ $(MAKE) -C test report
|
2010-07-10 04:39:50 +08:00
|
|
|
|
2010-07-10 06:36:15 +08:00
|
|
|
#clean::
|
|
|
|
# @ $(MAKE) -C test clean
|
2010-07-10 04:39:50 +08:00
|
|
|
|
|
|
|
tags::
|
|
|
|
$(Verb) etags `find . -type f -name '*.h' -or -name '*.cpp' | \
|
|
|
|
grep -v /lib/Headers | grep -v /test/`
|
|
|
|
|
|
|
|
cscope.files:
|
|
|
|
find tools lib include -name '*.cpp' \
|
|
|
|
-or -name '*.def' \
|
|
|
|
-or -name '*.td' \
|
|
|
|
-or -name '*.h' > cscope.files
|
|
|
|
|
|
|
|
.PHONY: test report clean cscope.files
|
|
|
|
|
|
|
|
endif
|