blob: 890a7a9a2cd09d0a5f6e6c84042e293b9322c3c4 [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
28# Include LLVM common makefile.
29include $(LEVEL)/Makefile.common
30
Greg Clayton1a2f3112011-02-05 02:32:19 +000031# Set Python include directory
Johnny Chen00876122011-05-19 23:09:48 +000032PYTHON_INC_DIR = $(shell python-config --includes)
Greg Clayton54e7afa2010-07-09 20:39:50 +000033# Set common LLDB build flags.
34CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/include
35CPP.Flags += -I$(PROJ_OBJ_DIR)/$(LLDB_LEVEL)/include
Daniel Dunbard882da22011-11-11 23:36:19 +000036CPP.Flags += -I$(LLVM_SRC_ROOT)/tools/clang/include
37CPP.Flags += -I$(LLVM_OBJ_ROOT)/tools/clang/include
Johnny Chen00876122011-05-19 23:09:48 +000038CPP.Flags += $(PYTHON_INC_DIR)
Greg Clayton54e7afa2010-07-09 20:39:50 +000039CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source
Stephen Wilsonb6b6fae2011-01-25 23:03:42 +000040CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source/Utility
Greg Clayton54e7afa2010-07-09 20:39:50 +000041CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source/Plugins/Process/Utility
Johnny Chen7e996472012-01-05 19:17:38 +000042CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source/Plugins/Process/POSIX
Greg Clayton54e7afa2010-07-09 20:39:50 +000043ifeq ($(HOST_OS),Darwin)
44CPP.Flags += -F/System/Library/Frameworks -F/System/Library/PrivateFrameworks
Filipe Cabecinhasb9f6fd82012-10-31 23:02:00 +000045CPP.Flags += -I/usr/include/libxml2
Greg Clayton54e7afa2010-07-09 20:39:50 +000046endif
47ifdef LLDB_VENDOR
48CPP.Flags += -DLLDB_VENDOR='"$(LLDB_VENDOR) "'
49endif
50
51# Disable -fstrict-aliasing. Darwin disables it by default (and LLVM doesn't
52# work with it enabled with GCC), Clang/llvm-gc don't support it yet, and newer
53# GCC's have false positive warnings with it on Linux (which prove a pain to
54# fix). For example:
55# http://gcc.gnu.org/PR41874
56# http://gcc.gnu.org/PR41838
57#
58# We can revisit this when LLVM/Clang support it.
59CXX.Flags += -fno-strict-aliasing
60
Stephen Wilson1bc21a82011-01-06 22:10:24 +000061# Do not warn about pragmas. In particular, we are looking to ignore the
62# "#pragma mark" construct which GCC warns about on platforms other than Darwin.
63EXTRA_OPTIONS += -Wno-unknown-pragmas
64
Daniel Dunbarf727cbf2011-10-31 22:50:55 +000065# Drop -Wsign-compare, which we are not currently clean with.
66EXTRA_OPTIONS += -Wno-sign-compare
67
68# Drop -Wunused-function and -Wunneeded-internal-declaration, which we are not
69# currently clean with.
Benjamin Kramer068d25b2012-02-22 20:10:46 +000070EXTRA_OPTIONS += -Wno-sign-compare -Wno-unused-function
Daniel Dunbarf727cbf2011-10-31 22:50:55 +000071
Greg Clayton54e7afa2010-07-09 20:39:50 +000072###
73# LLDB Top Level specific stuff.
74
75ifeq ($(IS_TOP_LEVEL),1)
76
77ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
78$(RecursiveTargets)::
79 $(Verb) if [ ! -f test/Makefile ]; then \
80 $(MKDIR) test; \
81 $(CP) $(PROJ_SRC_DIR)/test/Makefile test/Makefile; \
82 fi
83endif
84
Peter Collingbourne1561bc42011-06-20 19:06:57 +000085test::
86 @ $(MAKE) -C test
Greg Clayton54e7afa2010-07-09 20:39:50 +000087
Eli Friedman1c628cf2010-07-09 22:36:15 +000088#report::
89# @ $(MAKE) -C test report
Greg Clayton54e7afa2010-07-09 20:39:50 +000090
Eli Friedman1c628cf2010-07-09 22:36:15 +000091#clean::
92# @ $(MAKE) -C test clean
Greg Clayton54e7afa2010-07-09 20:39:50 +000093
94tags::
95 $(Verb) etags `find . -type f -name '*.h' -or -name '*.cpp' | \
96 grep -v /lib/Headers | grep -v /test/`
97
98cscope.files:
99 find tools lib include -name '*.cpp' \
100 -or -name '*.def' \
101 -or -name '*.td' \
102 -or -name '*.h' > cscope.files
103
104.PHONY: test report clean cscope.files
105
106endif