| OLD | NEW |
| 1 # The following variables will likely need to be modified, depending on where | 1 # The following variables will likely need to be modified, depending on where |
| 2 # and how you built LLVM & Clang. They can be overridden in a command-line | 2 # and how you built LLVM & Clang. They can be overridden in a command-line |
| 3 # invocation of make, like: | 3 # invocation of make, like: |
| 4 # | 4 # |
| 5 # make LLVM_SRC_PATH=<path> LLVM_BIN_PATH=<path> \ | 5 # make LLVM_SRC_PATH=<path> LLVM_BIN_PATH=<path> \ |
| 6 # LIBCXX_INSTALL_PATH=<path> CLANG_PATH=<path> ... | 6 # LIBCXX_INSTALL_PATH=<path> CLANG_PATH=<path> ... |
| 7 # | 7 # |
| 8 | 8 |
| 9 # LLVM_SRC_PATH is the path to the root of the checked out source code. This | 9 # LLVM_SRC_PATH is the path to the root of the checked out source code. This |
| 10 # directory should contain the configure script, the include/ and lib/ | 10 # directory should contain the configure script, the include/ and lib/ |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 ifdef DEBUG | 40 ifdef DEBUG |
| 41 OBJDIR = build/Debug | 41 OBJDIR = build/Debug |
| 42 OPTLEVEL = -O0 | 42 OPTLEVEL = -O0 |
| 43 else | 43 else |
| 44 OBJDIR = build/Release | 44 OBJDIR = build/Release |
| 45 OPTLEVEL = -O2 -ffunction-sections -fdata-sections | 45 OPTLEVEL = -O2 -ffunction-sections -fdata-sections |
| 46 endif | 46 endif |
| 47 | 47 |
| 48 # The list of CXX defines that are dependent on build parameters. | 48 # The list of CXX defines that are dependent on build parameters. |
| 49 CXX_DEFINES = | 49 CXX_DEFINES = |
| 50 CXX_EXTRA = |
| 51 LD_EXTRA = |
| 50 | 52 |
| 51 ifdef MINIMAL | 53 ifdef MINIMAL |
| 52 NOASSERT = 1 | 54 NOASSERT = 1 |
| 53 OBJDIR := $(OBJDIR)+Min | 55 OBJDIR := $(OBJDIR)+Min |
| 54 CXX_DEFINES += -DALLOW_DUMP=0 -DALLOW_LLVM_CL=0 -DALLOW_LLVM_IR=0 \ | 56 CXX_DEFINES += -DALLOW_DUMP=0 -DALLOW_LLVM_CL=0 -DALLOW_LLVM_IR=0 \ |
| 55 -DALLOW_LLVM_IR_AS_INPUT=0 -DALLOW_DISABLE_IR_GEN=0 | 57 -DALLOW_LLVM_IR_AS_INPUT=0 -DALLOW_DISABLE_IR_GEN=0 |
| 56 else | 58 else |
| 57 CXX_DEFINES += -DALLOW_DUMP=1 -DALLOW_LLVM_CL=1 -DALLOW_LLVM_IR=1 \ | 59 CXX_DEFINES += -DALLOW_DUMP=1 -DALLOW_LLVM_CL=1 -DALLOW_LLVM_IR=1 \ |
| 58 -DALLOW_LLVM_IR_AS_INPUT=1 -DALLOW_DISABLE_IR_GEN=1 | 60 -DALLOW_LLVM_IR_AS_INPUT=1 -DALLOW_DISABLE_IR_GEN=1 |
| 59 endif | 61 endif |
| 60 | 62 |
| 61 ifdef NOASSERT | 63 ifdef NOASSERT |
| 62 ASSERTIONS = -DNDEBUG | 64 ASSERTIONS = -DNDEBUG |
| 63 else | 65 else |
| 64 ASSERTIONS = | 66 ASSERTIONS = |
| 65 OBJDIR := $(OBJDIR)+Asserts | 67 OBJDIR := $(OBJDIR)+Asserts |
| 66 endif | 68 endif |
| 67 | 69 |
| 70 ifdef TSAN |
| 71 OBJDIR := $(OBJDIR)+TSan |
| 72 CXX_EXTRA += -fsanitize=thread |
| 73 LD_EXTRA += -fsanitize=thread |
| 74 endif |
| 75 |
| 68 $(info -----------------------------------------------) | 76 $(info -----------------------------------------------) |
| 69 $(info Using LLVM_SRC_PATH = $(LLVM_SRC_PATH)) | 77 $(info Using LLVM_SRC_PATH = $(LLVM_SRC_PATH)) |
| 70 $(info Using LLVM_BIN_PATH = $(LLVM_BIN_PATH)) | 78 $(info Using LLVM_BIN_PATH = $(LLVM_BIN_PATH)) |
| 71 $(info Using LIBCXX_INSTALL_PATH = $(LIBCXX_INSTALL_PATH)) | 79 $(info Using LIBCXX_INSTALL_PATH = $(LIBCXX_INSTALL_PATH)) |
| 72 $(info Using CLANG_PATH = $(CLANG_PATH)) | 80 $(info Using CLANG_PATH = $(CLANG_PATH)) |
| 73 $(info Using HOST_ARCH = $(HOST_ARCH)) | 81 $(info Using HOST_ARCH = $(HOST_ARCH)) |
| 74 $(info -----------------------------------------------) | 82 $(info -----------------------------------------------) |
| 75 | 83 |
| 76 LLVM_CXXFLAGS := `$(LLVM_BIN_PATH)/llvm-config --cxxflags` | 84 LLVM_CXXFLAGS := `$(LLVM_BIN_PATH)/llvm-config --cxxflags` |
| 77 LLVM_LDFLAGS := `$(LLVM_BIN_PATH)/llvm-config --libs` \ | 85 LLVM_LDFLAGS := `$(LLVM_BIN_PATH)/llvm-config --libs` \ |
| 78 `$(LLVM_BIN_PATH)/llvm-config --ldflags` \ | 86 `$(LLVM_BIN_PATH)/llvm-config --ldflags` \ |
| 79 `$(LLVM_BIN_PATH)/llvm-config --system-libs` | 87 `$(LLVM_BIN_PATH)/llvm-config --system-libs` |
| 80 | 88 |
| 81 # It's recommended that CXX matches the compiler you used to build LLVM itself. | 89 # It's recommended that CXX matches the compiler you used to build LLVM itself. |
| 82 CCACHE := `command -v ccache` | 90 CCACHE := `command -v ccache` |
| 83 CXX := CCACHE_CPP2=yes $(CCACHE) $(CLANG_PATH)/clang++ | 91 CXX := CCACHE_CPP2=yes $(CCACHE) $(CLANG_PATH)/clang++ |
| 84 | 92 |
| 85 CXXFLAGS := $(LLVM_CXXFLAGS) -std=c++11 -Wall -Wextra -Werror -fno-rtti \ | 93 CXXFLAGS := $(LLVM_CXXFLAGS) -std=c++11 -Wall -Wextra -Werror -fno-rtti \ |
| 86 -fno-exceptions $(OPTLEVEL) $(ASSERTIONS) $(CXX_DEFINES) -g \ | 94 -fno-exceptions $(OPTLEVEL) $(ASSERTIONS) $(CXX_DEFINES) -g \ |
| 87 $(HOST_FLAGS) -Wno-error=unused-parameter \ | 95 $(HOST_FLAGS) -Wno-error=unused-parameter \ |
| 88 » -I$(LIBCXX_INSTALL_PATH)/include/c++/v1 | 96 » -I$(LIBCXX_INSTALL_PATH)/include/c++/v1 $(CXX_EXTRA) |
| 89 LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib -Wl,--gc-sections | 97 LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib -Wl,--gc-sections \ |
| 98 » $(LD_EXTRA) |
| 90 | 99 |
| 91 SRCS = \ | 100 SRCS = \ |
| 92 assembler.cpp \ | 101 assembler.cpp \ |
| 93 assembler_ia32.cpp \ | 102 assembler_ia32.cpp \ |
| 94 IceCfg.cpp \ | 103 IceCfg.cpp \ |
| 95 IceCfgNode.cpp \ | 104 IceCfgNode.cpp \ |
| 96 IceELFObjectWriter.cpp \ | 105 IceELFObjectWriter.cpp \ |
| 97 IceELFSection.cpp \ | 106 IceELFSection.cpp \ |
| 98 IceFixups.cpp \ | 107 IceFixups.cpp \ |
| 99 IceGlobalContext.cpp \ | 108 IceGlobalContext.cpp \ |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 endif | 214 endif |
| 206 format-diff: | 215 format-diff: |
| 207 git diff -U0 `git merge-base HEAD master` | \ | 216 git diff -U0 `git merge-base HEAD master` | \ |
| 208 $(CLANG_FORMAT_DIFF) -p1 -style=LLVM -i | 217 $(CLANG_FORMAT_DIFF) -p1 -style=LLVM -i |
| 209 | 218 |
| 210 clean: | 219 clean: |
| 211 rm -rf llvm2ice *.o $(OBJDIR) | 220 rm -rf llvm2ice *.o $(OBJDIR) |
| 212 | 221 |
| 213 clean-all: clean | 222 clean-all: clean |
| 214 rm -rf build/ | 223 rm -rf build/ |
| OLD | NEW |