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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 $(info -----------------------------------------------) | 67 $(info -----------------------------------------------) |
68 $(info Using LLVM_SRC_PATH = $(LLVM_SRC_PATH)) | 68 $(info Using LLVM_SRC_PATH = $(LLVM_SRC_PATH)) |
69 $(info Using LLVM_BIN_PATH = $(LLVM_BIN_PATH)) | 69 $(info Using LLVM_BIN_PATH = $(LLVM_BIN_PATH)) |
70 $(info Using LIBCXX_INSTALL_PATH = $(LIBCXX_INSTALL_PATH)) | 70 $(info Using LIBCXX_INSTALL_PATH = $(LIBCXX_INSTALL_PATH)) |
71 $(info Using CLANG_PATH = $(CLANG_PATH)) | 71 $(info Using CLANG_PATH = $(CLANG_PATH)) |
72 $(info Using HOST_ARCH = $(HOST_ARCH)) | 72 $(info Using HOST_ARCH = $(HOST_ARCH)) |
73 $(info -----------------------------------------------) | 73 $(info -----------------------------------------------) |
74 | 74 |
75 LLVM_CXXFLAGS := `$(LLVM_BIN_PATH)/llvm-config --cxxflags` | 75 LLVM_CXXFLAGS := `$(LLVM_BIN_PATH)/llvm-config --cxxflags` |
76 LLVM_LDFLAGS := `$(LLVM_BIN_PATH)/llvm-config --libs` \ | 76 LLVM_LDFLAGS := `$(LLVM_BIN_PATH)/llvm-config --libs` \ |
77 `$(LLVM_BIN_PATH)/llvm-config --ldflags` | 77 `$(LLVM_BIN_PATH)/llvm-config --ldflags` \ |
| 78 `$(LLVM_BIN_PATH)/llvm-config --system-libs` |
78 | 79 |
79 # It's recommended that CXX matches the compiler you used to build LLVM itself. | 80 # It's recommended that CXX matches the compiler you used to build LLVM itself. |
80 CCACHE := `command -v ccache` | 81 CCACHE := `command -v ccache` |
81 CXX := CCACHE_CPP2=yes $(CCACHE) $(CLANG_PATH)/clang++ | 82 CXX := CCACHE_CPP2=yes $(CCACHE) $(CLANG_PATH)/clang++ |
82 | 83 |
83 CXXFLAGS := $(LLVM_CXXFLAGS) -std=c++11 -Wall -Wextra -Werror -fno-rtti \ | 84 CXXFLAGS := $(LLVM_CXXFLAGS) -std=c++11 -Wall -Wextra -Werror -fno-rtti \ |
84 -fno-exceptions $(OPTLEVEL) $(ASSERTIONS) $(CXX_DEFINES) -g \ | 85 -fno-exceptions $(OPTLEVEL) $(ASSERTIONS) $(CXX_DEFINES) -g \ |
85 $(HOST_FLAGS) -Wno-error=unused-parameter \ | 86 $(HOST_FLAGS) -Wno-error=unused-parameter \ |
86 -I$(LIBCXX_INSTALL_PATH)/include/c++/v1 | 87 -I$(LIBCXX_INSTALL_PATH)/include/c++/v1 |
87 LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib | 88 LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 rm -rf llvm2ice | 127 rm -rf llvm2ice |
127 ln -s $(OBJDIR)/llvm2ice | 128 ln -s $(OBJDIR)/llvm2ice |
128 @echo "Build Attributes:" | 129 @echo "Build Attributes:" |
129 @$(OBJDIR)/llvm2ice --build-atts | 130 @$(OBJDIR)/llvm2ice --build-atts |
130 | 131 |
131 .PHONY: all make_symlink | 132 .PHONY: all make_symlink |
132 | 133 |
133 # TODO(kschimpf): Fix python scripts to directly get build attributes | 134 # TODO(kschimpf): Fix python scripts to directly get build attributes |
134 # rather than generating $(OBJDIR)/llvm2ice.build_atts. | 135 # rather than generating $(OBJDIR)/llvm2ice.build_atts. |
135 $(OBJDIR)/llvm2ice: $(OBJS) | 136 $(OBJDIR)/llvm2ice: $(OBJS) |
136 » $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) -ldl \ | 137 » $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) \ |
137 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) | 138 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) |
138 | 139 |
139 # TODO: Be more precise than "*.h" here and elsewhere. | 140 # TODO: Be more precise than "*.h" here and elsewhere. |
140 $(OBJS): $(OBJDIR)/%.o: src/%.cpp src/*.h src/*.def | 141 $(OBJS): $(OBJDIR)/%.o: src/%.cpp src/*.h src/*.def |
141 $(CXX) -c $(CXXFLAGS) $< -o $@ | 142 $(CXX) -c $(CXXFLAGS) $< -o $@ |
142 | 143 |
143 $(OBJS): | $(OBJDIR) | 144 $(OBJS): | $(OBJDIR) |
144 | 145 |
145 $(OBJDIR): | 146 $(OBJDIR): |
146 @mkdir -p $@ | 147 @mkdir -p $@ |
(...skipping 27 matching lines...) Expand all Loading... |
174 endif | 175 endif |
175 format-diff: | 176 format-diff: |
176 git diff -U0 `git merge-base HEAD master` | \ | 177 git diff -U0 `git merge-base HEAD master` | \ |
177 $(CLANG_FORMAT_DIFF) -p1 -style=LLVM -i | 178 $(CLANG_FORMAT_DIFF) -p1 -style=LLVM -i |
178 | 179 |
179 clean: | 180 clean: |
180 rm -rf llvm2ice *.o $(OBJDIR) | 181 rm -rf llvm2ice *.o $(OBJDIR) |
181 | 182 |
182 clean-all: clean | 183 clean-all: clean |
183 rm -rf build/ | 184 rm -rf build/ |
OLD | NEW |