blob: a1bbb086947e72e4ceb9b00699446d24f5e19979 [file] [log] [blame]
Greg Clayton54e7afa2010-07-09 20:39:50 +00001##===- Makefile --------------------------------------------*- Makefile -*-===##
2#
3# The LLVM Compiler Infrastructure
4#
5# This file is distributed under the University of Illinois Open Source
6# License. See LICENSE.TXT for details.
7#
8##===----------------------------------------------------------------------===##
9
10# If LLDB_LEVEL is not set, then we are the top-level Makefile. Otherwise, we
11# are being included from a subdirectory makefile.
12
13ifndef LLDB_LEVEL
14
15IS_TOP_LEVEL := 1
16LLDB_LEVEL := .
17DIRS := include source lib tools
18
19PARALLEL_DIRS :=
20endif
21
22###
23# Common Makefile code, shared by all LLDB Makefiles.
24
25# Set LLVM source root level.
26LEVEL := $(LLDB_LEVEL)/../..
27
Benjamin Kramerddbc8e82012-02-22 19:19:01 +000028# shared_ptr from libstdc++ requires RTTI.
29REQUIRES_RTTI := 1
30
Greg Clayton54e7afa2010-07-09 20:39:50 +000031# Include LLVM common makefile.
32include $(LEVEL)/Makefile.common
33
Greg Clayton1a2f3112011-02-05 02:32:19 +000034# Set Python include directory
Johnny Chen00876122011-05-19 23:09:48 +000035PYTHON_INC_DIR = $(shell python-config --includes)
Greg Clayton54e7afa2010-07-09 20:39:50 +000036# Set common LLDB build flags.
37CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/include
38CPP.Flags += -I$(PROJ_OBJ_DIR)/$(LLDB_LEVEL)/include
Daniel Dunbard882da22011-11-11 23:36:19 +000039CPP.Flags += -I$(LLVM_SRC_ROOT)/tools/clang/include
40CPP.Flags += -I$(LLVM_OBJ_ROOT)/tools/clang/include
Johnny Chen00876122011-05-19 23:09:48 +000041CPP.Flags += $(PYTHON_INC_DIR)
Greg Clayton54e7afa2010-07-09 20:39:50 +000042CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source
Stephen Wilsonb6b6fae2011-01-25 23:03:42 +000043CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source/Utility
Greg Clayton54e7afa2010-07-09 20:39:50 +000044CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source/Plugins/Process/Utility
Johnny Chen7e996472012-01-05 19:17:38 +000045CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source/Plugins/Process/POSIX
Greg Clayton54e7afa2010-07-09 20:39:50 +000046ifeq ($(HOST_OS),Darwin)
47CPP.Flags += -F/System/Library/Frameworks -F/System/Library/PrivateFrameworks
48endif
49ifdef LLDB_VENDOR
50CPP.Flags += -DLLDB_VENDOR='"$(LLDB_VENDOR) "'
51endif
52
53# Disable -fstrict-aliasing. Darwin disables it by default (and LLVM doesn't
54# work with it enabled with GCC), Clang/llvm-gc don't support it yet, and newer
55# GCC's have false positive warnings with it on Linux (which prove a pain to
56# fix). For example:
57# http://gcc.gnu.org/PR41874
58# http://gcc.gnu.org/PR41838
59#
60# We can revisit this when LLVM/Clang support it.
61CXX.Flags += -fno-strict-aliasing
62
Stephen Wilson1bc21a82011-01-06 22:10:24 +000063# Do not warn about pragmas. In particular, we are looking to ignore the
64# "#pragma mark" construct which GCC warns about on platforms other than Darwin.
65EXTRA_OPTIONS += -Wno-unknown-pragmas
66
Daniel Dunbarf727cbf2011-10-31 22:50:55 +000067# Drop -Wsign-compare, which we are not currently clean with.
68EXTRA_OPTIONS += -Wno-sign-compare
69
70# Drop -Wunused-function and -Wunneeded-internal-declaration, which we are not
71# currently clean with.
Benjamin Kramer068d25b2012-02-22 20:10:46 +000072EXTRA_OPTIONS += -Wno-sign-compare -Wno-unused-function
Daniel Dunbarf727cbf2011-10-31 22:50:55 +000073
Greg Clayton54e7afa2010-07-09 20:39:50 +000074###
75# LLDB Top Level specific stuff.
76
77ifeq ($(IS_TOP_LEVEL),1)
78
79ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
80$(RecursiveTargets)::
81 $(Verb) if [ ! -f test/Makefile ]; then \
82 $(MKDIR) test; \
83 $(CP) $(PROJ_SRC_DIR)/test/Makefile test/Makefile; \
84 fi
85endif
86
Peter Collingbourne1561bc42011-06-20 19:06:57 +000087test::
88 @ $(MAKE) -C test
Greg Clayton54e7afa2010-07-09 20:39:50 +000089
Eli Friedman1c628cf2010-07-09 22:36:15 +000090#report::
91# @ $(MAKE) -C test report
Greg Clayton54e7afa2010-07-09 20:39:50 +000092
Eli Friedman1c628cf2010-07-09 22:36:15 +000093#clean::
94# @ $(MAKE) -C test clean
Greg Clayton54e7afa2010-07-09 20:39:50 +000095
96tags::
97 $(Verb) etags `find . -type f -name '*.h' -or -name '*.cpp' | \
98 grep -v /lib/Headers | grep -v /test/`
99
100cscope.files:
101 find tools lib include -name '*.cpp' \
102 -or -name '*.def' \
103 -or -name '*.td' \
104 -or -name '*.h' > cscope.files
105
106.PHONY: test report clean cscope.files
107
108endif