blob: 528c36c9739683cd9db0136b2fbfc86c609223a0 [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
31# Set common LLDB build flags.
32CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/include
33CPP.Flags += -I$(PROJ_OBJ_DIR)/$(LLDB_LEVEL)/include
34CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/../clang/include
35CPP.Flags += -I$(PROJ_OBJ_DIR)/$(LLDB_LEVEL)/../clang/include
36CPP.Flags += -I/usr/include/python2.6
37CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source
Stephen Wilsonb6b6fae2011-01-25 23:03:42 +000038CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source/Utility
Greg Clayton54e7afa2010-07-09 20:39:50 +000039CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source/Plugins/Process/Utility
40ifeq ($(HOST_OS),Darwin)
41CPP.Flags += -F/System/Library/Frameworks -F/System/Library/PrivateFrameworks
42endif
43ifdef LLDB_VENDOR
44CPP.Flags += -DLLDB_VENDOR='"$(LLDB_VENDOR) "'
45endif
46
47# Disable -fstrict-aliasing. Darwin disables it by default (and LLVM doesn't
48# work with it enabled with GCC), Clang/llvm-gc don't support it yet, and newer
49# GCC's have false positive warnings with it on Linux (which prove a pain to
50# fix). For example:
51# http://gcc.gnu.org/PR41874
52# http://gcc.gnu.org/PR41838
53#
54# We can revisit this when LLVM/Clang support it.
55CXX.Flags += -fno-strict-aliasing
56
Stephen Wilson1bc21a82011-01-06 22:10:24 +000057# Do not warn about pragmas. In particular, we are looking to ignore the
58# "#pragma mark" construct which GCC warns about on platforms other than Darwin.
59EXTRA_OPTIONS += -Wno-unknown-pragmas
60
Greg Clayton54e7afa2010-07-09 20:39:50 +000061###
62# LLDB Top Level specific stuff.
63
64ifeq ($(IS_TOP_LEVEL),1)
65
66ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
67$(RecursiveTargets)::
68 $(Verb) if [ ! -f test/Makefile ]; then \
69 $(MKDIR) test; \
70 $(CP) $(PROJ_SRC_DIR)/test/Makefile test/Makefile; \
71 fi
72endif
73
Eli Friedman1c628cf2010-07-09 22:36:15 +000074#test::
75# @ $(MAKE) -C test
Greg Clayton54e7afa2010-07-09 20:39:50 +000076
Eli Friedman1c628cf2010-07-09 22:36:15 +000077#report::
78# @ $(MAKE) -C test report
Greg Clayton54e7afa2010-07-09 20:39:50 +000079
Eli Friedman1c628cf2010-07-09 22:36:15 +000080#clean::
81# @ $(MAKE) -C test clean
Greg Clayton54e7afa2010-07-09 20:39:50 +000082
83tags::
84 $(Verb) etags `find . -type f -name '*.h' -or -name '*.cpp' | \
85 grep -v /lib/Headers | grep -v /test/`
86
87cscope.files:
88 find tools lib include -name '*.cpp' \
89 -or -name '*.def' \
90 -or -name '*.td' \
91 -or -name '*.h' > cscope.files
92
93.PHONY: test report clean cscope.files
94
95endif