Greg Clayton | c982c76 | 2010-07-09 20:39:50 | [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 | |
| 31 | # Set common LLDB build flags. |
| 32 | CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/include |
| 33 | CPP.Flags += -I$(PROJ_OBJ_DIR)/$(LLDB_LEVEL)/include |
| 34 | CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/../clang/include |
| 35 | CPP.Flags += -I$(PROJ_OBJ_DIR)/$(LLDB_LEVEL)/../clang/include |
| 36 | CPP.Flags += -I/usr/include/python2.6 |
| 37 | CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source |
| 38 | CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source/Plugins/Process/Utility |
| 39 | ifeq ($(HOST_OS),Darwin) |
| 40 | CPP.Flags += -F/System/Library/Frameworks -F/System/Library/PrivateFrameworks |
| 41 | endif |
| 42 | ifdef LLDB_VENDOR |
| 43 | CPP.Flags += -DLLDB_VENDOR='"$(LLDB_VENDOR) "' |
| 44 | endif |
| 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. |
| 54 | CXX.Flags += -fno-strict-aliasing |
| 55 | |
| 56 | ### |
| 57 | # LLDB Top Level specific stuff. |
| 58 | |
| 59 | ifeq ($(IS_TOP_LEVEL),1) |
| 60 | |
| 61 | ifneq ($(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 |
| 67 | endif |
| 68 | |
Eli Friedman | 2066e3e | 2010-07-09 22:36:15 | [diff] [blame] | 69 | #test:: |
| 70 | # @ $(MAKE) -C test |
Greg Clayton | c982c76 | 2010-07-09 20:39:50 | [diff] [blame] | 71 | |
Eli Friedman | 2066e3e | 2010-07-09 22:36:15 | [diff] [blame] | 72 | #report:: |
| 73 | # @ $(MAKE) -C test report |
Greg Clayton | c982c76 | 2010-07-09 20:39:50 | [diff] [blame] | 74 | |
Eli Friedman | 2066e3e | 2010-07-09 22:36:15 | [diff] [blame] | 75 | #clean:: |
| 76 | # @ $(MAKE) -C test clean |
Greg Clayton | c982c76 | 2010-07-09 20:39:50 | [diff] [blame] | 77 | |
| 78 | tags:: |
| 79 | $(Verb) etags `find . -type f -name '*.h' -or -name '*.cpp' | \ |
| 80 | grep -v /lib/Headers | grep -v /test/` |
| 81 | |
| 82 | cscope.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 | |
| 90 | endif |