blob: 51b0c0a9b543fbc1bee5b7b900eb9c6d65a91474 [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
38CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source/Plugins/Process/Utility
39ifeq ($(HOST_OS),Darwin)
40CPP.Flags += -F/System/Library/Frameworks -F/System/Library/PrivateFrameworks
41endif
42ifdef LLDB_VENDOR
43CPP.Flags += -DLLDB_VENDOR='"$(LLDB_VENDOR) "'
44endif
45
46# Disable -fstrict-aliasing. Darwin disables it by default (and LLVM doesn't
47# work with it enabled with GCC), Clang/llvm-gc don't support it yet, and newer
48# GCC's have false positive warnings with it on Linux (which prove a pain to
49# fix). For example:
50# http://gcc.gnu.org/PR41874
51# http://gcc.gnu.org/PR41838
52#
53# We can revisit this when LLVM/Clang support it.
54CXX.Flags += -fno-strict-aliasing
55
56###
57# LLDB Top Level specific stuff.
58
59ifeq ($(IS_TOP_LEVEL),1)
60
61ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
62$(RecursiveTargets)::
63 $(Verb) if [ ! -f test/Makefile ]; then \
64 $(MKDIR) test; \
65 $(CP) $(PROJ_SRC_DIR)/test/Makefile test/Makefile; \
66 fi
67endif
68
69test::
70 @ $(MAKE) -C test
71
72report::
73 @ $(MAKE) -C test report
74
75clean::
76 @ $(MAKE) -C test clean
77
78tags::
79 $(Verb) etags `find . -type f -name '*.h' -or -name '*.cpp' | \
80 grep -v /lib/Headers | grep -v /test/`
81
82cscope.files:
83 find tools lib include -name '*.cpp' \
84 -or -name '*.def' \
85 -or -name '*.td' \
86 -or -name '*.h' > cscope.files
87
88.PHONY: test report clean cscope.files
89
90endif