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 | |
Benjamin Kramer | ddbc8e8 | 2012-02-22 19:19:01 +0000 | [diff] [blame] | 28 | # shared_ptr from libstdc++ requires RTTI. |
| 29 | REQUIRES_RTTI := 1 |
| 30 | |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 31 | # Include LLVM common makefile. |
| 32 | include $(LEVEL)/Makefile.common |
| 33 | |
Greg Clayton | 1a2f311 | 2011-02-05 02:32:19 +0000 | [diff] [blame] | 34 | # Set Python include directory |
Johnny Chen | 0087612 | 2011-05-19 23:09:48 +0000 | [diff] [blame] | 35 | PYTHON_INC_DIR = $(shell python-config --includes) |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 36 | # Set common LLDB build flags. |
| 37 | CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/include |
| 38 | CPP.Flags += -I$(PROJ_OBJ_DIR)/$(LLDB_LEVEL)/include |
Daniel Dunbar | d882da2 | 2011-11-11 23:36:19 +0000 | [diff] [blame] | 39 | CPP.Flags += -I$(LLVM_SRC_ROOT)/tools/clang/include |
| 40 | CPP.Flags += -I$(LLVM_OBJ_ROOT)/tools/clang/include |
Johnny Chen | 0087612 | 2011-05-19 23:09:48 +0000 | [diff] [blame] | 41 | CPP.Flags += $(PYTHON_INC_DIR) |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 42 | CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source |
Stephen Wilson | b6b6fae | 2011-01-25 23:03:42 +0000 | [diff] [blame] | 43 | CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source/Utility |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 44 | CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source/Plugins/Process/Utility |
Johnny Chen | 7e99647 | 2012-01-05 19:17:38 +0000 | [diff] [blame] | 45 | CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source/Plugins/Process/POSIX |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 46 | ifeq ($(HOST_OS),Darwin) |
| 47 | CPP.Flags += -F/System/Library/Frameworks -F/System/Library/PrivateFrameworks |
| 48 | endif |
| 49 | ifdef LLDB_VENDOR |
| 50 | CPP.Flags += -DLLDB_VENDOR='"$(LLDB_VENDOR) "' |
| 51 | endif |
| 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. |
| 61 | CXX.Flags += -fno-strict-aliasing |
| 62 | |
Stephen Wilson | 1bc21a8 | 2011-01-06 22:10:24 +0000 | [diff] [blame] | 63 | # 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. |
| 65 | EXTRA_OPTIONS += -Wno-unknown-pragmas |
| 66 | |
Daniel Dunbar | f727cbf | 2011-10-31 22:50:55 +0000 | [diff] [blame] | 67 | # Drop -Wsign-compare, which we are not currently clean with. |
| 68 | EXTRA_OPTIONS += -Wno-sign-compare |
| 69 | |
| 70 | # Drop -Wunused-function and -Wunneeded-internal-declaration, which we are not |
| 71 | # currently clean with. |
Benjamin Kramer | 068d25b | 2012-02-22 20:10:46 +0000 | [diff] [blame^] | 72 | EXTRA_OPTIONS += -Wno-sign-compare -Wno-unused-function |
Daniel Dunbar | f727cbf | 2011-10-31 22:50:55 +0000 | [diff] [blame] | 73 | |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 74 | ### |
| 75 | # LLDB Top Level specific stuff. |
| 76 | |
| 77 | ifeq ($(IS_TOP_LEVEL),1) |
| 78 | |
| 79 | ifneq ($(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 |
| 85 | endif |
| 86 | |
Peter Collingbourne | 1561bc4 | 2011-06-20 19:06:57 +0000 | [diff] [blame] | 87 | test:: |
| 88 | @ $(MAKE) -C test |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 89 | |
Eli Friedman | 1c628cf | 2010-07-09 22:36:15 +0000 | [diff] [blame] | 90 | #report:: |
| 91 | # @ $(MAKE) -C test report |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 92 | |
Eli Friedman | 1c628cf | 2010-07-09 22:36:15 +0000 | [diff] [blame] | 93 | #clean:: |
| 94 | # @ $(MAKE) -C test clean |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 95 | |
| 96 | tags:: |
| 97 | $(Verb) etags `find . -type f -name '*.h' -or -name '*.cpp' | \ |
| 98 | grep -v /lib/Headers | grep -v /test/` |
| 99 | |
| 100 | cscope.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 | |
| 108 | endif |