Chromium Code Reviews| 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> LIBCXX_INSTALL_PATH=<path> CLANG_PATH=<path> \ | 5 # make LLVM_SRC_PATH=<path> LIBCXX_INSTALL_PATH=<path> CLANG_PATH=<path> \ |
| 6 # PNACL_BIN_PATH=<path> ... | 6 # PNACL_BIN_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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 172 | 172 |
| 173 ifdef LINUX_MALLOC_PROFILE | 173 ifdef LINUX_MALLOC_PROFILE |
| 174 OBJDIR := $(OBJDIR)+MalProf | 174 OBJDIR := $(OBJDIR)+MalProf |
| 175 CXX_EXTRA += -DALLOW_LINUX_MALLOC_PROFILE=1 | 175 CXX_EXTRA += -DALLOW_LINUX_MALLOC_PROFILE=1 |
| 176 LD_EXTRA += -Wl,--export-dynamic | 176 LD_EXTRA += -Wl,--export-dynamic |
| 177 endif | 177 endif |
| 178 | 178 |
| 179 SB_OBJDIR := $(OBJDIR)+Sandboxed | 179 SB_OBJDIR := $(OBJDIR)+Sandboxed |
| 180 SBB_OBJDIR := $(OBJDIR)+SandboxedBrowser | 180 SBB_OBJDIR := $(OBJDIR)+SandboxedBrowser |
| 181 | 181 |
| 182 V8_DIR = $(NACL_ROOT)/../v8 | |
| 183 V8_CXXFLAGS := -I$(V8_DIR) | |
| 184 | |
| 182 $(info -----------------------------------------------) | 185 $(info -----------------------------------------------) |
| 183 $(info Using LLVM_SRC_PATH = $(LLVM_SRC_PATH)) | 186 $(info Using LLVM_SRC_PATH = $(LLVM_SRC_PATH)) |
| 184 $(info Using SB_LLVM_PATH = $(SB_LLVM_PATH)) | 187 $(info Using SB_LLVM_PATH = $(SB_LLVM_PATH)) |
| 185 $(info Using NACL_ROOT = $(NACL_ROOT)) | 188 $(info Using NACL_ROOT = $(NACL_ROOT)) |
| 186 $(info Using TOOLCHAIN_ROOT = $(TOOLCHAIN_ROOT)) | 189 $(info Using TOOLCHAIN_ROOT = $(TOOLCHAIN_ROOT)) |
| 187 $(info Using PNACL_TOOLCHAIN_ROOT = $(PNACL_TOOLCHAIN_ROOT)) | 190 $(info Using PNACL_TOOLCHAIN_ROOT = $(PNACL_TOOLCHAIN_ROOT)) |
| 188 $(info Using PNACL_BIN_PATH = $(PNACL_BIN_PATH)) | 191 $(info Using PNACL_BIN_PATH = $(PNACL_BIN_PATH)) |
| 189 $(info Using CLANG_PATH = $(CLANG_PATH)) | 192 $(info Using CLANG_PATH = $(CLANG_PATH)) |
| 190 $(info Using LIBCXX_INSTALL_PATH = $(LIBCXX_INSTALL_PATH)) | 193 $(info Using LIBCXX_INSTALL_PATH = $(LIBCXX_INSTALL_PATH)) |
| 191 $(info Using HOST_ARCH = $(HOST_ARCH)) | 194 $(info Using HOST_ARCH = $(HOST_ARCH)) |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 244 -Wcast-qual \ | 247 -Wcast-qual \ |
| 245 -Wno-comment \ | 248 -Wno-comment \ |
| 246 -Wno-long-long \ | 249 -Wno-long-long \ |
| 247 -Wno-maybe-uninitialized \ | 250 -Wno-maybe-uninitialized \ |
| 248 -Wno-missing-field-initializers \ | 251 -Wno-missing-field-initializers \ |
| 249 -Wno-unused-parameter \ | 252 -Wno-unused-parameter \ |
| 250 -Wwrite-strings | 253 -Wwrite-strings |
| 251 OBJDIR := $(OBJDIR)+Gplusplus | 254 OBJDIR := $(OBJDIR)+Gplusplus |
| 252 endif | 255 endif |
| 253 | 256 |
| 254 BASE_CXXFLAGS := -std=gnu++11 -Wall -Wextra -Werror -fno-rtti \ | 257 BASE_CXXFLAGS := -std=gnu++11 -Wall -Wextra -fno-rtti \ |
| 255 -fno-exceptions $(OPTLEVEL) $(ASSERTIONS) -g -pedantic \ | 258 -fno-exceptions $(OPTLEVEL) $(ASSERTIONS) -g -pedantic \ |
| 256 $(LLVM_EXTRA_WARNINGS) $(CXX_EXTRA) -MP -MD | 259 $(LLVM_EXTRA_WARNINGS) $(CXX_EXTRA) -MP -MD |
| 257 | 260 |
| 261 ifndef WASM | |
|
Jim Stichnoth
2016/04/04 21:26:51
Instead of
ifndef / else / endif
restructure as
Eric Holk
2016/04/04 22:23:22
Done.
| |
| 262 # The WASM code inherits a lot of V8 code, which does not compile with | |
| 263 # -Werror. | |
| 264 BASE_CXXFLAGS := $(BASE_CXXFLAGS) -Werror -DALLOW_WASM=0 | |
| 265 else | |
| 266 BASE_CXXFLAGS := $(BASE_CXXFLAGS) $(V8_CXXFLAGS) -DALLOW_WASM=1 | |
| 267 OBJDIR := $(OBJDIR)+Wasm | |
| 268 endif | |
| 269 | |
| 258 CXXFLAGS := $(LLVM_CXXFLAGS) $(BASE_CXXFLAGS) $(CXX_DEFINES) $(HOST_FLAGS) \ | 270 CXXFLAGS := $(LLVM_CXXFLAGS) $(BASE_CXXFLAGS) $(CXX_DEFINES) $(HOST_FLAGS) \ |
| 259 $(STDLIB_FLAGS) | 271 $(STDLIB_FLAGS) |
| 260 SB_CXXFLAGS := $(SB_LLVM_CXXFLAGS) $(BASE_CXXFLAGS) $(BASE_CXX_DEFINES) \ | 272 SB_CXXFLAGS := $(SB_LLVM_CXXFLAGS) $(BASE_CXXFLAGS) $(BASE_CXX_DEFINES) \ |
| 261 -Wno-unknown-pragmas -I$(NACL_ROOT) -I$(NACL_ROOT)/.. | 273 -Wno-unknown-pragmas -I$(NACL_ROOT) -I$(NACL_ROOT)/.. |
| 262 | 274 |
| 263 LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib -Wl,--gc-sections \ | 275 LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib -Wl,--gc-sections \ |
| 264 $(LD_EXTRA) $(STDLIB_FLAGS) | 276 $(LD_EXTRA) $(STDLIB_FLAGS) |
| 265 # Not specifying -Wl,--gc-sections but instead doing bitcode linking GC w/ LTO. | 277 # Not specifying -Wl,--gc-sections but instead doing bitcode linking GC w/ LTO. |
| 266 SB_LDFLAGS := $(LINKOPTLEVEL) $(LD_EXTRA) | 278 SB_LDFLAGS := $(LINKOPTLEVEL) $(LD_EXTRA) |
| 267 | 279 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 308 LinuxMallocProfiling.cpp \ | 320 LinuxMallocProfiling.cpp \ |
| 309 main.cpp \ | 321 main.cpp \ |
| 310 PNaClTranslator.cpp | 322 PNaClTranslator.cpp |
| 311 | 323 |
| 312 ifndef MINIMAL | 324 ifndef MINIMAL |
| 313 SRCS += \ | 325 SRCS += \ |
| 314 IceConverter.cpp \ | 326 IceConverter.cpp \ |
| 315 IceTypeConverter.cpp | 327 IceTypeConverter.cpp |
| 316 endif | 328 endif |
| 317 | 329 |
| 330 ifdef WASM | |
| 331 SRCS += \ | |
| 332 WasmTranslator.cpp | |
| 333 endif | |
| 334 | |
| 318 OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS)) | 335 OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS)) |
| 319 SB_OBJS=$(patsubst %.cpp, $(SB_OBJDIR)/%.o, $(SRCS)) | 336 SB_OBJS=$(patsubst %.cpp, $(SB_OBJDIR)/%.o, $(SRCS)) |
| 320 SBB_OBJS=$(patsubst %.cpp, $(SBB_OBJDIR)/%.o, $(SRCS)) | 337 SBB_OBJS=$(patsubst %.cpp, $(SBB_OBJDIR)/%.o, $(SRCS)) |
| 321 | 338 |
| 322 UNITTEST_SRCS = \ | 339 UNITTEST_SRCS = \ |
| 323 BitcodeMunge.cpp \ | 340 BitcodeMunge.cpp \ |
| 324 IceELFSectionTest.cpp \ | 341 IceELFSectionTest.cpp \ |
| 325 IceParseInstsTest.cpp | 342 IceParseInstsTest.cpp |
| 326 | 343 |
| 327 # The X86 assembler tests take too long to compile. Given how infrequently the | 344 # The X86 assembler tests take too long to compile. Given how infrequently the |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 385 | 402 |
| 386 %.pexe : %.nonfinal.pexe | 403 %.pexe : %.nonfinal.pexe |
| 387 $(SB_FINALIZE) -o $@ $< | 404 $(SB_FINALIZE) -o $@ $< |
| 388 | 405 |
| 389 .PHONY: all compile_only make_symlink runtime bloat sb docs help \ | 406 .PHONY: all compile_only make_symlink runtime bloat sb docs help \ |
| 390 help-check-lit help-check-xtest exists-nonsfi-x8632 \ | 407 help-check-lit help-check-xtest exists-nonsfi-x8632 \ |
| 391 exists-nonsfi-arm32 exists-sbtc exists-spec | 408 exists-nonsfi-arm32 exists-sbtc exists-spec |
| 392 | 409 |
| 393 compile_only: $(OBJS) | 410 compile_only: $(OBJS) |
| 394 | 411 |
| 412 V8_LIBDIR=$(V8_DIR)/out/native/lib.target | |
| 413 | |
| 414 ifdef WASM | |
| 415 V8_LIBS := \ | |
| 416 $(V8_LIBDIR)/libv8.so \ | |
| 417 $(V8_LIBDIR)/libicuuc.so \ | |
| 418 $(V8_LIBDIR)/libicui18n.so | |
| 419 endif | |
| 420 | |
| 395 $(OBJDIR)/pnacl-sz: $(OBJS) | 421 $(OBJDIR)/pnacl-sz: $(OBJS) |
| 396 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) \ | 422 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) \ |
| 397 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) | 423 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) $(V8_LIBS) |
| 398 | 424 |
| 399 $(SB_OBJDIR)/pnacl-sz.nonfinal.pexe: $(SB_OBJS) | 425 $(SB_OBJDIR)/pnacl-sz.nonfinal.pexe: $(SB_OBJS) |
| 400 $(SB_CXX) $(SB_LDFLAGS) -o $@ $^ $(SB_LLVM_LDFLAGS) | 426 $(SB_CXX) $(SB_LDFLAGS) -o $@ $^ $(SB_LLVM_LDFLAGS) |
| 401 | 427 |
| 402 $(SBB_OBJDIR)/pnacl-sz.nonfinal.pexe: $(SBB_OBJS) | 428 $(SBB_OBJDIR)/pnacl-sz.nonfinal.pexe: $(SBB_OBJS) |
| 403 $(SB_CXX) $(SB_LDFLAGS) -o $@ $^ $(SB_LLVM_LDFLAGS) \ | 429 $(SB_CXX) $(SB_LDFLAGS) -o $@ $^ $(SB_LLVM_LDFLAGS) \ |
| 404 --pnacl-disable-abi-check | 430 --pnacl-disable-abi-check |
| 405 | 431 |
| 406 $(SB_OBJDIR)/pnacl-sz.x8632.nexe: $(SB_OBJDIR)/pnacl-sz.pexe | 432 $(SB_OBJDIR)/pnacl-sz.x8632.nexe: $(SB_OBJDIR)/pnacl-sz.pexe |
| 407 $(SB_TRANSLATE) -arch x86-32 $^ -o $@ | 433 $(SB_TRANSLATE) -arch x86-32 $^ -o $@ |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 705 TARGET=arm32 ALLSPEC='254.gap 176.gcc 181.mcf' check-spec | 731 TARGET=arm32 ALLSPEC='254.gap 176.gcc 181.mcf' check-spec |
| 706 # Provide validation of user awesomeness! | 732 # Provide validation of user awesomeness! |
| 707 echo Success | 733 echo Success |
| 708 | 734 |
| 709 FORMAT_BLACKLIST = | 735 FORMAT_BLACKLIST = |
| 710 # Add one of the following lines for each source file to ignore. | 736 # Add one of the following lines for each source file to ignore. |
| 711 FORMAT_BLACKLIST += ! -name IceParseInstsTest.cpp | 737 FORMAT_BLACKLIST += ! -name IceParseInstsTest.cpp |
| 712 FORMAT_BLACKLIST += ! -name IceParseTypesTest.cpp | 738 FORMAT_BLACKLIST += ! -name IceParseTypesTest.cpp |
| 713 FORMAT_BLACKLIST += ! -name assembler_arm.h | 739 FORMAT_BLACKLIST += ! -name assembler_arm.h |
| 714 FORMAT_BLACKLIST += ! -name assembler_arm.cc | 740 FORMAT_BLACKLIST += ! -name assembler_arm.cc |
| 741 FORMAT_BLACKLIST += ! -path "./wasm-install/*" | |
|
Jim Stichnoth
2016/04/04 21:26:51
I think the "*" at the end of the pattern is redun
Eric Holk
2016/04/04 22:23:22
I tried removing the * and it still grabbed all th
Jim Stichnoth
2016/04/04 23:08:20
Yeah, sorry, I was just plain wrong about that.
| |
| 715 format: | 742 format: |
| 716 $(CLANG_FORMAT_PATH)/clang-format -style=LLVM -i \ | 743 $(CLANG_FORMAT_PATH)/clang-format -style=LLVM -i \ |
| 717 `find . -regex '.*\.\(c\|h\|cpp\)' $(FORMAT_BLACKLIST)` | 744 `find . -regex '.*\.\(c\|h\|cpp\)' $(FORMAT_BLACKLIST)` |
| 718 | 745 |
| 719 format-diff: | 746 format-diff: |
| 720 git diff -U0 `git merge-base HEAD master` | \ | 747 git diff -U0 `git merge-base HEAD master` | \ |
| 721 PATH=$(PNACL_BIN_PATH):$(PATH) \ | 748 PATH=$(PNACL_BIN_PATH):$(PATH) \ |
| 722 $(LLVM_SRC_PATH)/../clang/tools/clang-format/clang-format-diff.py \ | 749 $(LLVM_SRC_PATH)/../clang/tools/clang-format/clang-format-diff.py \ |
| 723 -p1 -style=LLVM -i | 750 -p1 -style=LLVM -i |
| 724 | 751 |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 744 | 771 |
| 745 help-check-xtest: | 772 help-check-xtest: |
| 746 @cat Makefile.standalone-help/check-xtest.txt | 773 @cat Makefile.standalone-help/check-xtest.txt |
| 747 | 774 |
| 748 clean: | 775 clean: |
| 749 rm -rf pnacl-sz *.o $(foreach nexe,$(NEXES),$(notdir $(nexe))) \ | 776 rm -rf pnacl-sz *.o $(foreach nexe,$(NEXES),$(notdir $(nexe))) \ |
| 750 $(OBJDIR) $(SB_OBJDIR) $(SBB_OBJDIR) build/*.bloat.json | 777 $(OBJDIR) $(SB_OBJDIR) $(SBB_OBJDIR) build/*.bloat.json |
| 751 | 778 |
| 752 clean-all: clean | 779 clean-all: clean |
| 753 rm -rf build/ crosstest/Output/ | 780 rm -rf build/ crosstest/Output/ |
| OLD | NEW |