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 Python include directory 32 PYTHON_INC_DIR = $(shell python-config --includes) 33 # Set common LLDB build flags. 34 CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/include 35 CPP.Flags += -I$(PROJ_OBJ_DIR)/$(LLDB_LEVEL)/include 36 CPP.Flags += -I$(LLVM_SRC_ROOT)/tools/clang/include 37 CPP.Flags += -I$(LLVM_OBJ_ROOT)/tools/clang/include 38 CPP.Flags += $(PYTHON_INC_DIR) 39 CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source 40 CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source/Utility 41 CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source/Plugins/Process/Utility 42 CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source/Plugins/Process/POSIX 43 ifeq ($(HOST_OS),Darwin) 44 CPP.Flags += -F/System/Library/Frameworks -F/System/Library/PrivateFrameworks 45 CPP.Flags += -I/usr/include/libxml2 46 endif 47 ifdef LLDB_VENDOR 48 CPP.Flags += -DLLDB_VENDOR='"$(LLDB_VENDOR) "' 49 endif 50 51 # If building on a 32-bit system, make sure off_t can store offsets > 2GB 52 ifneq "$(HOST_ARCH)" "x86_64" 53 CPP.Flags += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 54 endif 55 56 # Disable -fstrict-aliasing. Darwin disables it by default (and LLVM doesn't 57 # work with it enabled with GCC), Clang/llvm-gc don't support it yet, and newer 58 # GCC's have false positive warnings with it on Linux (which prove a pain to 59 # fix). For example: 60 # http://gcc.gnu.org/PR41874 61 # http://gcc.gnu.org/PR41838 62 # 63 # We can revisit this when LLVM/Clang support it. 64 CXX.Flags += -fno-strict-aliasing 65 66 # Do not warn about pragmas. In particular, we are looking to ignore the 67 # "#pragma mark" construct which GCC warns about on platforms other than Darwin. 68 EXTRA_OPTIONS += -Wno-unknown-pragmas 69 70 # Drop -Wsign-compare, which we are not currently clean with. 71 EXTRA_OPTIONS += -Wno-sign-compare 72 73 # Drop -Wunused-function and -Wunneeded-internal-declaration, which we are not 74 # currently clean with. 75 EXTRA_OPTIONS += -Wno-sign-compare -Wno-unused-function 76 77 ### 78 # LLDB Top Level specific stuff. 79 80 ifeq ($(IS_TOP_LEVEL),1) 81 82 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT)) 83 $(RecursiveTargets):: 84 $(Verb) if [ ! -f test/Makefile ]; then \ 85 $(MKDIR) test; \ 86 $(CP) $(PROJ_SRC_DIR)/test/Makefile test/Makefile; \ 87 fi 88 endif 89 90 test:: 91 @ $(MAKE) -C test 92 93 #report:: 94 # @ $(MAKE) -C test report 95 96 #clean:: 97 # @ $(MAKE) -C test clean 98 99 tags:: 100 $(Verb) etags `find . -type f -name '*.h' -or -name '*.cpp' | \ 101 grep -v /lib/Headers | grep -v /test/` 102 103 cscope.files: 104 find tools lib include -name '*.cpp' \ 105 -or -name '*.def' \ 106 -or -name '*.td' \ 107 -or -name '*.h' > cscope.files 108 109 .PHONY: test report clean cscope.files 110 111 endif 112