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 109 matching lines...) Loading... | |
120 IceLiveness.cpp \ | 120 IceLiveness.cpp \ |
121 IceOperand.cpp \ | 121 IceOperand.cpp \ |
122 IceRegAlloc.cpp \ | 122 IceRegAlloc.cpp \ |
123 IceRNG.cpp \ | 123 IceRNG.cpp \ |
124 IceTargetLowering.cpp \ | 124 IceTargetLowering.cpp \ |
125 IceTargetLoweringX8632.cpp \ | 125 IceTargetLoweringX8632.cpp \ |
126 IceThreading.cpp \ | 126 IceThreading.cpp \ |
127 IceTimerTree.cpp \ | 127 IceTimerTree.cpp \ |
128 IceTranslator.cpp \ | 128 IceTranslator.cpp \ |
129 IceTypes.cpp \ | 129 IceTypes.cpp \ |
130 » llvm2ice.cpp \ | 130 » main.cpp \ |
Karl
2015/02/26 17:03:34
Should the tab be removed here?
Jim Stichnoth
2015/02/26 17:11:33
Tabs are required in makefiles. The other files a
Jim Stichnoth
2015/02/26 17:13:43
Sorry, to clarify, I mean the other .cpp files in
Karl
2015/02/26 17:18:28
Not for line 130! Like the previous 22 lines that
Jim Stichnoth
2015/02/26 17:31:15
Please check your local copy of Makefile.standalon
| |
131 PNaClTranslator.cpp | 131 PNaClTranslator.cpp |
132 | 132 |
133 ifndef MINIMAL | 133 ifndef MINIMAL |
134 SRCS += IceConverter.cpp \ | 134 SRCS += IceConverter.cpp \ |
135 IceTypeConverter.cpp | 135 IceTypeConverter.cpp |
136 endif | 136 endif |
137 | 137 |
138 OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS)) | 138 OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS)) |
139 | 139 |
140 UNITTEST_SRCS = \ | 140 UNITTEST_SRCS = \ |
141 BitcodeMunge.cpp \ | 141 BitcodeMunge.cpp \ |
142 IceELFSectionTest.cpp \ | 142 IceELFSectionTest.cpp \ |
143 IceParseInstsTest.cpp | 143 IceParseInstsTest.cpp |
144 | 144 |
145 UNITTEST_OBJS = $(patsubst %.cpp, $(OBJDIR)/unittest/%.o, $(UNITTEST_SRCS)) | 145 UNITTEST_OBJS = $(patsubst %.cpp, $(OBJDIR)/unittest/%.o, $(UNITTEST_SRCS)) |
146 UNITTEST_LIB_OBJS = $(filter-out $(OBJDIR)/llvm2ice.o,$(OBJS)) | 146 UNITTEST_LIB_OBJS = $(filter-out $(OBJDIR)/main.o,$(OBJS)) |
147 | 147 |
148 # Keep all the first target so it's the default. | 148 # Keep all the first target so it's the default. |
149 all: $(OBJDIR)/llvm2ice make_symlink runtime | 149 all: $(OBJDIR)/pnacl-sz make_symlink runtime |
150 | 150 |
151 # Creates symbolic link so that testing is easier. Also runs | 151 # Creates symbolic link so that testing is easier. Also runs |
152 # llvm2ice to verify that the defines flags have valid values, | 152 # pnacl-sz to verify that the defines flags have valid values, |
153 # as well as describe the corresponding build attributes. | 153 # as well as describe the corresponding build attributes. |
154 make_symlink: $(OBJDIR)/llvm2ice | 154 make_symlink: $(OBJDIR)/pnacl-sz |
155 » rm -rf llvm2ice | 155 » rm -rf pnacl-sz |
156 » ln -s $(OBJDIR)/llvm2ice | 156 » ln -s $(OBJDIR)/pnacl-sz |
157 @echo "Build Attributes:" | 157 @echo "Build Attributes:" |
158 » @$(OBJDIR)/llvm2ice --build-atts | 158 » @$(OBJDIR)/pnacl-sz --build-atts |
159 | 159 |
160 .PHONY: all make_symlink runtime bloat | 160 .PHONY: all make_symlink runtime bloat |
161 | 161 |
162 $(OBJDIR)/llvm2ice: $(OBJS) | 162 $(OBJDIR)/pnacl-sz: $(OBJS) |
163 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) \ | 163 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) \ |
164 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) | 164 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) |
165 | 165 |
166 # TODO(stichnot): Be more precise than "*.h" here and elsewhere. | 166 # TODO(stichnot): Be more precise than "*.h" here and elsewhere. |
167 $(OBJS): $(OBJDIR)/%.o: src/%.cpp src/*.h src/*.def | 167 $(OBJS): $(OBJDIR)/%.o: src/%.cpp src/*.h src/*.def |
168 $(CXX) -c $(CXXFLAGS) $< -o $@ | 168 $(CXX) -c $(CXXFLAGS) $< -o $@ |
169 | 169 |
170 $(OBJDIR)/run_unittests: $(UNITTEST_OBJS) $(UNITTEST_LIB_OBJS) | 170 $(OBJDIR)/run_unittests: $(UNITTEST_OBJS) $(UNITTEST_LIB_OBJS) |
171 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) -lgtest -lgtest_main -ldl \ | 171 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) -lgtest -lgtest_main -ldl \ |
172 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) | 172 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) |
(...skipping 22 matching lines...) Loading... | |
195 runtime: $(RT_OBJ) | 195 runtime: $(RT_OBJ) |
196 | 196 |
197 # Use runtime.is.built so that build-runtime.py is invoked only once | 197 # Use runtime.is.built so that build-runtime.py is invoked only once |
198 # even in a parallel build. | 198 # even in a parallel build. |
199 .INTERMEDIATE: runtime.is.built | 199 .INTERMEDIATE: runtime.is.built |
200 $(RT_OBJ): runtime.is.built | 200 $(RT_OBJ): runtime.is.built |
201 runtime.is.built: $(RT_SRC) | 201 runtime.is.built: $(RT_SRC) |
202 @echo ================ Building Subzero runtime ================ | 202 @echo ================ Building Subzero runtime ================ |
203 ./pydir/build-runtime.py -v | 203 ./pydir/build-runtime.py -v |
204 | 204 |
205 check-lit: $(OBJDIR)/llvm2ice make_symlink | 205 check-lit: $(OBJDIR)/pnacl-sz make_symlink |
206 LLVM_BIN_PATH=$(LLVM_BIN_PATH) \ | 206 LLVM_BIN_PATH=$(LLVM_BIN_PATH) \ |
207 BINUTILS_BIN_PATH=$(BINUTILS_BIN_PATH) \ | 207 BINUTILS_BIN_PATH=$(BINUTILS_BIN_PATH) \ |
208 $(LLVM_SRC_PATH)/utils/lit/lit.py -sv tests_lit | 208 $(LLVM_SRC_PATH)/utils/lit/lit.py -sv tests_lit |
209 | 209 |
210 check-unit: $(OBJDIR)/run_unittests | 210 check-unit: $(OBJDIR)/run_unittests |
211 $(OBJDIR)/run_unittests | 211 $(OBJDIR)/run_unittests |
212 | 212 |
213 ifdef MINIMAL | 213 ifdef MINIMAL |
214 check: check-lit check-unit runtime | 214 check: check-lit check-unit runtime |
215 @echo "Crosstests ignored, minimal build" | 215 @echo "Crosstests ignored, minimal build" |
216 else | 216 else |
217 check: check-lit check-unit runtime | 217 check: check-lit check-unit runtime |
218 (cd crosstest; ./runtests.sh) | 218 (cd crosstest; ./runtests.sh) |
219 endif | 219 endif |
220 | 220 |
221 FORMAT_BLACKLIST = | 221 FORMAT_BLACKLIST = |
222 # Add one of the following lines for each source file to ignore. | 222 # Add one of the following lines for each source file to ignore. |
223 FORMAT_BLACKLIST += ! -name IceParseInstsTest.cpp | 223 FORMAT_BLACKLIST += ! -name IceParseInstsTest.cpp |
224 format: | 224 format: |
225 $(LLVM_BIN_PATH)/clang-format -style=LLVM -i \ | 225 $(LLVM_BIN_PATH)/clang-format -style=LLVM -i \ |
226 `find . -regex '.*\.\(c\|h\|cpp\)' $(FORMAT_BLACKLIST)` | 226 `find . -regex '.*\.\(c\|h\|cpp\)' $(FORMAT_BLACKLIST)` |
227 | 227 |
228 format-diff: | 228 format-diff: |
229 git diff -U0 `git merge-base HEAD master` | \ | 229 git diff -U0 `git merge-base HEAD master` | \ |
230 PATH=$(LLVM_BIN_PATH):$(PATH) \ | 230 PATH=$(LLVM_BIN_PATH):$(PATH) \ |
231 $(LLVM_SRC_PATH)/../clang/tools/clang-format/clang-format-diff.py \ | 231 $(LLVM_SRC_PATH)/../clang/tools/clang-format/clang-format-diff.py \ |
232 -p1 -style=LLVM -i | 232 -p1 -style=LLVM -i |
233 | 233 |
234 bloat: make_symlink | 234 bloat: make_symlink |
235 » nm -C -S -l llvm2ice | \ | 235 » nm -C -S -l pnacl-sz | \ |
236 » bloat/bloat.py --nm-output=/dev/stdin syms > build/llvm2ice.bloat.json | 236 » bloat/bloat.py --nm-output=/dev/stdin syms > build/pnacl-sz.bloat.json |
237 » @echo See Subzero size breakdown in bloat/llvm2ice.bloat.html | 237 » @echo See Subzero size breakdown in bloat/pnacl-sz.bloat.html |
238 | 238 |
239 clean: | 239 clean: |
240 » rm -rf llvm2ice *.o $(OBJDIR) build/llvm2ice.bloat.json | 240 » rm -rf pnacl-sz *.o $(OBJDIR) build/pnacl-sz.bloat.json |
241 | 241 |
242 clean-all: clean | 242 clean-all: clean |
243 rm -rf build/ | 243 rm -rf build/ |
OLD | NEW |