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 15 matching lines...) Expand all Loading... | |
| 26 # tools like qemu. | 26 # tools like qemu. |
| 27 TOOLCHAIN_ROOT ?= $(shell readlink -e $(NACL_ROOT)/toolchain/linux_x86) | 27 TOOLCHAIN_ROOT ?= $(shell readlink -e $(NACL_ROOT)/toolchain/linux_x86) |
| 28 | 28 |
| 29 # PNACL_TOOLCHAIN_ROOT is the location of the PNaCl toolchain. | 29 # PNACL_TOOLCHAIN_ROOT is the location of the PNaCl toolchain. |
| 30 # This is used as the default root for finding binutils, libcxx, etc. | 30 # This is used as the default root for finding binutils, libcxx, etc. |
| 31 PNACL_TOOLCHAIN_ROOT ?= $(shell readlink -e $(TOOLCHAIN_ROOT)/pnacl_newlib_raw) | 31 PNACL_TOOLCHAIN_ROOT ?= $(shell readlink -e $(TOOLCHAIN_ROOT)/pnacl_newlib_raw) |
| 32 | 32 |
| 33 # The location of PNaCl tools (e.g., binutils objdump, pnacl-clang++, etc.). | 33 # The location of PNaCl tools (e.g., binutils objdump, pnacl-clang++, etc.). |
| 34 PNACL_BIN_PATH ?= $(shell readlink -e $(PNACL_TOOLCHAIN_ROOT)/bin) | 34 PNACL_BIN_PATH ?= $(shell readlink -e $(PNACL_TOOLCHAIN_ROOT)/bin) |
| 35 | 35 |
| 36 # Allow tests_lit to be overidden | |
|
Jim Stichnoth
2016/01/20 17:35:52
I would make the comment a bit more verbose/helpfu
rkotlerimgtec
2016/01/21 01:48:55
These are already covered in the help for the make
Jim Stichnoth
2016/01/22 03:05:21
OK - but can address the first part of my comment?
rkotlerimgtec
2016/01/22 03:48:30
Done.
| |
| 37 CHECK_LIT_TESTS ?= tests_lit | |
| 38 CHECK_XTEST_TESTS ?= crosstest/Output | |
| 39 | |
| 36 # Hack to auto-detect autoconf versus cmake build of LLVM. If the LLVM tools | 40 # Hack to auto-detect autoconf versus cmake build of LLVM. If the LLVM tools |
| 37 # were dynamically linked with something like libLLVM-3.7svn.so, it is an | 41 # were dynamically linked with something like libLLVM-3.7svn.so, it is an |
| 38 # autoconf build, otherwise it is a cmake build. AUTOCONF is set to 0 for | 42 # autoconf build, otherwise it is a cmake build. AUTOCONF is set to 0 for |
| 39 # cmake, nonzero for autoconf. | 43 # cmake, nonzero for autoconf. |
| 40 AUTOCONF ?= $(shell ldd $(PNACL_BIN_PATH)/opt | grep -c libLLVM-) | 44 AUTOCONF ?= $(shell ldd $(PNACL_BIN_PATH)/opt | grep -c libLLVM-) |
| 41 | 45 |
| 42 # CLANG_PATH is the location of the clang compiler to use for building | 46 # CLANG_PATH is the location of the clang compiler to use for building |
| 43 # the host binaries. | 47 # the host binaries. |
| 44 CLANG_PATH ?= $(shell readlink -e \ | 48 CLANG_PATH ?= $(shell readlink -e \ |
| 45 $(NACL_ROOT)/../third_party/llvm-build/Release+Asserts/bin) | 49 $(NACL_ROOT)/../third_party/llvm-build/Release+Asserts/bin) |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 327 | 331 |
| 328 # Creates symbolic link so that testing is easier. Also runs | 332 # Creates symbolic link so that testing is easier. Also runs |
| 329 # pnacl-sz to verify that the defines flags have valid values, | 333 # pnacl-sz to verify that the defines flags have valid values, |
| 330 # as well as describe the corresponding build attributes. | 334 # as well as describe the corresponding build attributes. |
| 331 make_symlink: $(OBJDIR)/pnacl-sz | 335 make_symlink: $(OBJDIR)/pnacl-sz |
| 332 rm -rf pnacl-sz | 336 rm -rf pnacl-sz |
| 333 ln -s $(OBJDIR)/pnacl-sz | 337 ln -s $(OBJDIR)/pnacl-sz |
| 334 @echo "Build Attributes:" | 338 @echo "Build Attributes:" |
| 335 @$(SHOW_BUILD_ATTS) | 339 @$(SHOW_BUILD_ATTS) |
| 336 | 340 |
| 337 .PHONY: all compile_only make_symlink runtime bloat sb docs | 341 .PHONY: all compile_only make_symlink runtime bloat sb docs help \ |
| 342 » help-check-lit help-check-xtest | |
|
Jim Stichnoth
2016/01/20 17:35:52
This continuation line doesn't need a tab characte
rkotlerimgtec
2016/01/21 01:48:55
Done.
| |
| 338 | 343 |
| 339 compile_only: $(OBJS) | 344 compile_only: $(OBJS) |
| 340 | 345 |
| 341 $(OBJDIR)/pnacl-sz: $(OBJS) | 346 $(OBJDIR)/pnacl-sz: $(OBJS) |
| 342 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) \ | 347 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) \ |
| 343 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) | 348 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) |
| 344 | 349 |
| 345 $(SB_OBJDIR)/pnacl-sz.x86-32.nexe: $(SB_OBJS) | 350 $(SB_OBJDIR)/pnacl-sz.x86-32.nexe: $(SB_OBJS) |
| 346 $(eval PNACL_SZ_BASE := $(patsubst %.nexe, %, $@)) | 351 $(eval PNACL_SZ_BASE := $(patsubst %.nexe, %, $@)) |
| 347 $(SB_CXX) $(SB_LDFLAGS) -o $(PNACL_SZ_BASE).nonfinal.pexe $^ \ | 352 $(SB_CXX) $(SB_LDFLAGS) -o $(PNACL_SZ_BASE).nonfinal.pexe $^ \ |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 408 # Use runtime.is.built so that build-runtime.py is invoked only once | 413 # Use runtime.is.built so that build-runtime.py is invoked only once |
| 409 # even in a parallel build. | 414 # even in a parallel build. |
| 410 .INTERMEDIATE: runtime.is.built | 415 .INTERMEDIATE: runtime.is.built |
| 411 $(RT_OBJ): runtime.is.built | 416 $(RT_OBJ): runtime.is.built |
| 412 runtime.is.built: $(RT_SRC) pydir/build-runtime.py | 417 runtime.is.built: $(RT_SRC) pydir/build-runtime.py |
| 413 @echo ================ Building Subzero runtime ================ | 418 @echo ================ Building Subzero runtime ================ |
| 414 ./pydir/build-runtime.py -v --pnacl-root $(PNACL_TOOLCHAIN_ROOT) | 419 ./pydir/build-runtime.py -v --pnacl-root $(PNACL_TOOLCHAIN_ROOT) |
| 415 | 420 |
| 416 check-lit: $(OBJDIR)/pnacl-sz make_symlink | 421 check-lit: $(OBJDIR)/pnacl-sz make_symlink |
| 417 PNACL_BIN_PATH=$(PNACL_BIN_PATH) \ | 422 PNACL_BIN_PATH=$(PNACL_BIN_PATH) \ |
| 418 » $(LLVM_SRC_PATH)/utils/lit/lit.py -sv tests_lit \ | 423 » $(LLVM_SRC_PATH)/utils/lit/lit.py -sv $(CHECK_LIT_TESTS) \ |
| 419 $(FORCEASM_LIT_TEST_EXCLUDES) $(FORCEASM_LIT_PARAM) | 424 $(FORCEASM_LIT_TEST_EXCLUDES) $(FORCEASM_LIT_PARAM) |
| 420 | 425 |
| 421 ifdef MINIMAL | 426 ifdef MINIMAL |
| 422 check-xtest: $(OBJDIR)/pnacl-sz make_symlink runtime | 427 check-xtest: $(OBJDIR)/pnacl-sz make_symlink runtime |
| 423 @echo "Crosstests disabled, minimal build" | 428 @echo "Crosstests disabled, minimal build" |
| 424 else | 429 else |
| 425 check-xtest: $(OBJDIR)/pnacl-sz make_symlink runtime | 430 check-xtest: $(OBJDIR)/pnacl-sz make_symlink runtime |
| 426 # Do all native/sse2 tests, but only test_vector_ops for native/sse4.1. | 431 # Do all native/sse2 tests, but only test_vector_ops for native/sse4.1. |
| 427 # For (slow) sandboxed tests, limit to Om1/sse4.1. | 432 # For (slow) sandboxed tests, limit to Om1/sse4.1. |
| 428 ./pydir/crosstest_generator.py -v --lit \ | 433 ./pydir/crosstest_generator.py -v --lit \ |
| 429 --toolchain-root $(TOOLCHAIN_ROOT) \ | 434 --toolchain-root $(TOOLCHAIN_ROOT) \ |
| 430 $(FORCEASM_FLAG) \ | 435 $(FORCEASM_FLAG) \ |
| 431 $(FORCEASM_XTEST_EXCLUDES) \ | 436 $(FORCEASM_XTEST_EXCLUDES) \ |
| 432 -i x8632,native,sse2 \ | 437 -i x8632,native,sse2 \ |
| 433 -i x8632,native,sse4.1,test_vector_ops \ | 438 -i x8632,native,sse4.1,test_vector_ops \ |
| 434 -i x8632,sandbox,sse4.1,Om1 \ | 439 -i x8632,sandbox,sse4.1,Om1 \ |
| 435 -i x8632,nonsfi,sse2,O2 \ | 440 -i x8632,nonsfi,sse2,O2 \ |
| 436 -i x8664,native,sse2 \ | 441 -i x8664,native,sse2 \ |
| 437 -i x8664,native,sse4.1,test_vector_ops \ | 442 -i x8664,native,sse4.1,test_vector_ops \ |
| 438 -i x8664,sandbox,sse4.1,Om1 \ | 443 -i x8664,sandbox,sse4.1,Om1 \ |
| 439 -i arm32,neon \ | 444 -i arm32,neon \ |
| 440 -e arm32,nonsfi \ | 445 -e arm32,nonsfi \ |
| 441 -e arm32,neon,test_vector_ops \ | 446 -e arm32,neon,test_vector_ops \ |
| 442 -e arm32,neon,test_select | 447 -e arm32,neon,test_select |
| 443 PNACL_BIN_PATH=$(PNACL_BIN_PATH) \ | 448 PNACL_BIN_PATH=$(PNACL_BIN_PATH) \ |
| 444 » $(LLVM_SRC_PATH)/utils/lit/lit.py -sv crosstest/Output | 449 » $(LLVM_SRC_PATH)/utils/lit/lit.py -sv $(CHECK_XTEST_TESTS) |
| 445 endif | 450 endif |
| 446 | 451 |
| 447 check-unit: $(OBJDIR)/run_unittests | 452 check-unit: $(OBJDIR)/run_unittests |
| 448 $(OBJDIR)/run_unittests | 453 $(OBJDIR)/run_unittests |
| 449 | 454 |
| 450 # List the spec2k components in roughly reverse order of runtime, to help with | 455 # List the spec2k components in roughly reverse order of runtime, to help with |
| 451 # parallel execution speed. | 456 # parallel execution speed. |
| 452 ALLSPEC := 253.perlbmk 177.mesa 188.ammp 256.bzip2 164.gzip 179.art 183.equake \ | 457 ALLSPEC := 253.perlbmk 177.mesa 188.ammp 256.bzip2 164.gzip 179.art 183.equake \ |
| 453 175.vpr 176.gcc 181.mcf 186.crafty 197.parser 254.gap 255.vortex \ | 458 175.vpr 176.gcc 181.mcf 186.crafty 197.parser 254.gap 255.vortex \ |
| 454 300.twolf 252.eon | 459 300.twolf 252.eon |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 535 -p1 -style=LLVM -i | 540 -p1 -style=LLVM -i |
| 536 | 541 |
| 537 bloat: make_symlink | 542 bloat: make_symlink |
| 538 nm -C -S -l pnacl-sz | \ | 543 nm -C -S -l pnacl-sz | \ |
| 539 bloat/bloat.py --nm-output=/dev/stdin syms > build/pnacl-sz.bloat.json | 544 bloat/bloat.py --nm-output=/dev/stdin syms > build/pnacl-sz.bloat.json |
| 540 @echo See Subzero size breakdown in bloat/pnacl-sz.bloat.html | 545 @echo See Subzero size breakdown in bloat/pnacl-sz.bloat.html |
| 541 | 546 |
| 542 docs: | 547 docs: |
| 543 make -C docs -f Makefile.standalone | 548 make -C docs -f Makefile.standalone |
| 544 | 549 |
| 550 help: | |
| 551 @echo | |
|
Jim Stichnoth
2016/01/20 17:35:52
I think this might be better accomplished by just
rkotlerimgtec
2016/01/21 01:48:55
Done.
| |
| 552 @echo | |
| 553 @echo Targets: | |
| 554 @echo | |
| 555 @echo check-lit - run the lit tests | |
| 556 @echo check-xtest - run the cross tests | |
| 557 @echo | |
| 558 @echo For more detailed help: | |
| 559 @echo | |
| 560 @echo makefile -f Makefile.standalone help-target . so for example: | |
| 561 @echo makefile -f Makefile.standalone help-check-lit | |
| 562 @echo | |
| 563 @echo | |
| 564 | |
| 565 help-check-lit: | |
| 566 @echo | |
| 567 @echo check-lit - run the lit tests | |
| 568 @echo | |
| 569 @echo to check a specific test, override CHECK_LIT_TESTS | |
| 570 @echo i.e. make -f Makefile.standalone check-lit CHECK_LIT_TESTS=tests_l it/llvm2ice_tests/arith.ll | |
| 571 @echo | |
| 572 @echo | |
| 573 | |
| 574 help-check-xtest: | |
| 575 @echo | |
| 576 @echo check-xtest - run the cross tests | |
| 577 @echo | |
| 578 @echo to check a specific test, override CHECK_XTEST_TESTS | |
| 579 @echo i.e. make -f Makefile.standalone check-xtest CHECK_XTEST_TESTS=cro sstest/Output/mem_intrin_x8632_nonsfi_O2_sse2.xtest | |
| 580 @echo | |
| 581 @echo | |
| 582 | |
| 545 clean: | 583 clean: |
| 546 rm -rf pnacl-sz *.o $(OBJDIR) $(SB_OBJDIR) build/pnacl-sz.bloat.json | 584 rm -rf pnacl-sz *.o $(OBJDIR) $(SB_OBJDIR) build/pnacl-sz.bloat.json |
| 547 | 585 |
| 548 clean-all: clean | 586 clean-all: clean |
| 549 rm -rf build/ crosstest/Output/ | 587 rm -rf build/ crosstest/Output/ |
| OLD | NEW |