Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 1 | ##===- 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 | |
| 13 | ifndef LLDB_LEVEL |
| 14 | |
| 15 | IS_TOP_LEVEL := 1 |
| 16 | LLDB_LEVEL := . |
| 17 | DIRS := include source lib tools |
| 18 | |
| 19 | PARALLEL_DIRS := |
| 20 | endif |
| 21 | |
| 22 | ### |
| 23 | # Common Makefile code, shared by all LLDB Makefiles. |
| 24 | |
| 25 | # Set LLVM source root level. |
| 26 | LEVEL := $(LLDB_LEVEL)/../.. |
| 27 | |
| 28 | # Include LLVM common makefile. |
| 29 | include $(LEVEL)/Makefile.common |
| 30 | |
Greg Clayton | 1a2f311 | 2011-02-05 02:32:19 +0000 | [diff] [blame] | 31 | # Set Python include directory |
| 32 | PYTHON_INC_DIR = /usr/include/python2.6 |
| 33 | |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 34 | # Set common LLDB build flags. |
| 35 | CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/include |
| 36 | CPP.Flags += -I$(PROJ_OBJ_DIR)/$(LLDB_LEVEL)/include |
| 37 | CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/../clang/include |
| 38 | CPP.Flags += -I$(PROJ_OBJ_DIR)/$(LLDB_LEVEL)/../clang/include |
Greg Clayton | 1a2f311 | 2011-02-05 02:32:19 +0000 | [diff] [blame] | 39 | CPP.Flags += -I$(PYTHON_INC_DIR) |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 40 | CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source |
Stephen Wilson | b6b6fae | 2011-01-25 23:03:42 +0000 | [diff] [blame] | 41 | CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source/Utility |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 42 | CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source/Plugins/Process/Utility |
| 43 | ifeq ($(HOST_OS),Darwin) |
| 44 | CPP.Flags += -F/System/Library/Frameworks -F/System/Library/PrivateFrameworks |
| 45 | endif |
| 46 | ifdef LLDB_VENDOR |
| 47 | CPP.Flags += -DLLDB_VENDOR='"$(LLDB_VENDOR) "' |
| 48 | endif |
| 49 | |
| 50 | # Disable -fstrict-aliasing. Darwin disables it by default (and LLVM doesn't |
| 51 | # work with it enabled with GCC), Clang/llvm-gc don't support it yet, and newer |
| 52 | # GCC's have false positive warnings with it on Linux (which prove a pain to |
| 53 | # fix). For example: |
| 54 | # http://gcc.gnu.org/PR41874 |
| 55 | # http://gcc.gnu.org/PR41838 |
| 56 | # |
| 57 | # We can revisit this when LLVM/Clang support it. |
| 58 | CXX.Flags += -fno-strict-aliasing |
| 59 | |
Stephen Wilson | 1bc21a8 | 2011-01-06 22:10:24 +0000 | [diff] [blame] | 60 | # Do not warn about pragmas. In particular, we are looking to ignore the |
| 61 | # "#pragma mark" construct which GCC warns about on platforms other than Darwin. |
| 62 | EXTRA_OPTIONS += -Wno-unknown-pragmas |
| 63 | |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 64 | ### |
| 65 | # LLDB Top Level specific stuff. |
| 66 | |
| 67 | ifeq ($(IS_TOP_LEVEL),1) |
| 68 | |
| 69 | ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT)) |
| 70 | $(RecursiveTargets):: |
| 71 | $(Verb) if [ ! -f test/Makefile ]; then \ |
| 72 | $(MKDIR) test; \ |
| 73 | $(CP) $(PROJ_SRC_DIR)/test/Makefile test/Makefile; \ |
| 74 | fi |
| 75 | endif |
| 76 | |
Eli Friedman | 1c628cf | 2010-07-09 22:36:15 +0000 | [diff] [blame] | 77 | #test:: |
| 78 | # @ $(MAKE) -C test |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 79 | |
Eli Friedman | 1c628cf | 2010-07-09 22:36:15 +0000 | [diff] [blame] | 80 | #report:: |
| 81 | # @ $(MAKE) -C test report |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 82 | |
Eli Friedman | 1c628cf | 2010-07-09 22:36:15 +0000 | [diff] [blame] | 83 | #clean:: |
| 84 | # @ $(MAKE) -C test clean |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 85 | |
| 86 | tags:: |
| 87 | $(Verb) etags `find . -type f -name '*.h' -or -name '*.cpp' | \ |
| 88 | grep -v /lib/Headers | grep -v /test/` |
| 89 | |
| 90 | cscope.files: |
| 91 | find tools lib include -name '*.cpp' \ |
| 92 | -or -name '*.def' \ |
| 93 | -or -name '*.td' \ |
| 94 | -or -name '*.h' > cscope.files |
| 95 | |
| 96 | .PHONY: test report clean cscope.files |
| 97 | |
| 98 | endif |