| 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 to be overridden, e.g.: |
| 37 # make -f Makefile.standalone check-lit \ |
| 38 # CHECK_LIT_TESTS="tests_lit/llvm2ice_tests/{alloc,arith}.ll" |
| 39 # make -f Makefile.standalone check-xtest \ |
| 40 # CHECK_XTEST_TESTS=crosstest/Output/simple_loop_x8632_native_O2_sse2.xtest |
| 41 CHECK_LIT_TESTS ?= tests_lit |
| 42 CHECK_XTEST_TESTS ?= crosstest/Output |
| 43 |
| 36 # Hack to auto-detect autoconf versus cmake build of LLVM. If the LLVM tools | 44 # 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 | 45 # 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 | 46 # autoconf build, otherwise it is a cmake build. AUTOCONF is set to 0 for |
| 39 # cmake, nonzero for autoconf. | 47 # cmake, nonzero for autoconf. |
| 40 AUTOCONF ?= $(shell ldd $(PNACL_BIN_PATH)/opt | grep -c libLLVM-) | 48 AUTOCONF ?= $(shell ldd $(PNACL_BIN_PATH)/opt | grep -c libLLVM-) |
| 41 | 49 |
| 42 # CLANG_PATH is the location of the clang compiler to use for building | 50 # CLANG_PATH is the location of the clang compiler to use for building |
| 43 # the host binaries. | 51 # the host binaries. |
| 44 CLANG_PATH ?= $(shell readlink -e \ | 52 CLANG_PATH ?= $(shell readlink -e \ |
| 45 $(NACL_ROOT)/../third_party/llvm-build/Release+Asserts/bin) | 53 $(NACL_ROOT)/../third_party/llvm-build/Release+Asserts/bin) |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 | 335 |
| 328 # Creates symbolic link so that testing is easier. Also runs | 336 # Creates symbolic link so that testing is easier. Also runs |
| 329 # pnacl-sz to verify that the defines flags have valid values, | 337 # pnacl-sz to verify that the defines flags have valid values, |
| 330 # as well as describe the corresponding build attributes. | 338 # as well as describe the corresponding build attributes. |
| 331 make_symlink: $(OBJDIR)/pnacl-sz | 339 make_symlink: $(OBJDIR)/pnacl-sz |
| 332 rm -rf pnacl-sz | 340 rm -rf pnacl-sz |
| 333 ln -s $(OBJDIR)/pnacl-sz | 341 ln -s $(OBJDIR)/pnacl-sz |
| 334 @echo "Build Attributes:" | 342 @echo "Build Attributes:" |
| 335 @$(SHOW_BUILD_ATTS) | 343 @$(SHOW_BUILD_ATTS) |
| 336 | 344 |
| 337 .PHONY: all compile_only make_symlink runtime bloat sb docs | 345 .PHONY: all compile_only make_symlink runtime bloat sb docs help \ |
| 346 help-check-lit help-check-xtest |
| 338 | 347 |
| 339 compile_only: $(OBJS) | 348 compile_only: $(OBJS) |
| 340 | 349 |
| 341 $(OBJDIR)/pnacl-sz: $(OBJS) | 350 $(OBJDIR)/pnacl-sz: $(OBJS) |
| 342 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) \ | 351 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) \ |
| 343 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) | 352 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) |
| 344 | 353 |
| 345 $(SB_OBJDIR)/pnacl-sz.x86-32.nexe: $(SB_OBJS) | 354 $(SB_OBJDIR)/pnacl-sz.x86-32.nexe: $(SB_OBJS) |
| 346 $(eval PNACL_SZ_BASE := $(patsubst %.nexe, %, $@)) | 355 $(eval PNACL_SZ_BASE := $(patsubst %.nexe, %, $@)) |
| 347 $(SB_CXX) $(SB_LDFLAGS) -o $(PNACL_SZ_BASE).nonfinal.pexe $^ \ | 356 $(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 | 417 # Use runtime.is.built so that build-runtime.py is invoked only once |
| 409 # even in a parallel build. | 418 # even in a parallel build. |
| 410 .INTERMEDIATE: runtime.is.built | 419 .INTERMEDIATE: runtime.is.built |
| 411 $(RT_OBJ): runtime.is.built | 420 $(RT_OBJ): runtime.is.built |
| 412 runtime.is.built: $(RT_SRC) pydir/build-runtime.py | 421 runtime.is.built: $(RT_SRC) pydir/build-runtime.py |
| 413 @echo ================ Building Subzero runtime ================ | 422 @echo ================ Building Subzero runtime ================ |
| 414 ./pydir/build-runtime.py -v --pnacl-root $(PNACL_TOOLCHAIN_ROOT) | 423 ./pydir/build-runtime.py -v --pnacl-root $(PNACL_TOOLCHAIN_ROOT) |
| 415 | 424 |
| 416 check-lit: $(OBJDIR)/pnacl-sz make_symlink | 425 check-lit: $(OBJDIR)/pnacl-sz make_symlink |
| 417 PNACL_BIN_PATH=$(PNACL_BIN_PATH) \ | 426 PNACL_BIN_PATH=$(PNACL_BIN_PATH) \ |
| 418 » $(LLVM_SRC_PATH)/utils/lit/lit.py -sv tests_lit \ | 427 » $(LLVM_SRC_PATH)/utils/lit/lit.py -sv $(CHECK_LIT_TESTS) \ |
| 419 $(FORCEASM_LIT_TEST_EXCLUDES) $(FORCEASM_LIT_PARAM) | 428 $(FORCEASM_LIT_TEST_EXCLUDES) $(FORCEASM_LIT_PARAM) |
| 420 | 429 |
| 421 ifdef MINIMAL | 430 ifdef MINIMAL |
| 422 check-xtest: $(OBJDIR)/pnacl-sz make_symlink runtime | 431 check-xtest: $(OBJDIR)/pnacl-sz make_symlink runtime |
| 423 @echo "Crosstests disabled, minimal build" | 432 @echo "Crosstests disabled, minimal build" |
| 424 else | 433 else |
| 425 check-xtest: $(OBJDIR)/pnacl-sz make_symlink runtime | 434 check-xtest: $(OBJDIR)/pnacl-sz make_symlink runtime |
| 426 # Do all native/sse2 tests, but only test_vector_ops for native/sse4.1. | 435 # Do all native/sse2 tests, but only test_vector_ops for native/sse4.1. |
| 427 # For (slow) sandboxed tests, limit to Om1/sse4.1. | 436 # For (slow) sandboxed tests, limit to Om1/sse4.1. |
| 428 ./pydir/crosstest_generator.py -v --lit \ | 437 ./pydir/crosstest_generator.py -v --lit \ |
| 429 --toolchain-root $(TOOLCHAIN_ROOT) \ | 438 --toolchain-root $(TOOLCHAIN_ROOT) \ |
| 430 $(FORCEASM_FLAG) \ | 439 $(FORCEASM_FLAG) \ |
| 431 $(FORCEASM_XTEST_EXCLUDES) \ | 440 $(FORCEASM_XTEST_EXCLUDES) \ |
| 432 -i x8632,native,sse2 \ | 441 -i x8632,native,sse2 \ |
| 433 -i x8632,native,sse4.1,test_vector_ops \ | 442 -i x8632,native,sse4.1,test_vector_ops \ |
| 434 -i x8632,sandbox,sse4.1,Om1 \ | 443 -i x8632,sandbox,sse4.1,Om1 \ |
| 435 -i x8632,nonsfi,sse2,O2 \ | 444 -i x8632,nonsfi,sse2,O2 \ |
| 436 -i x8664,native,sse2 \ | 445 -i x8664,native,sse2 \ |
| 437 -i x8664,native,sse4.1,test_vector_ops \ | 446 -i x8664,native,sse4.1,test_vector_ops \ |
| 438 -i x8664,sandbox,sse4.1,Om1 \ | 447 -i x8664,sandbox,sse4.1,Om1 \ |
| 439 -i arm32,neon \ | 448 -i arm32,neon \ |
| 440 -e arm32,nonsfi \ | 449 -e arm32,nonsfi \ |
| 441 -e arm32,neon,test_vector_ops \ | 450 -e arm32,neon,test_vector_ops \ |
| 442 -e arm32,neon,test_select | 451 -e arm32,neon,test_select |
| 443 PNACL_BIN_PATH=$(PNACL_BIN_PATH) \ | 452 PNACL_BIN_PATH=$(PNACL_BIN_PATH) \ |
| 444 » $(LLVM_SRC_PATH)/utils/lit/lit.py -sv crosstest/Output | 453 » $(LLVM_SRC_PATH)/utils/lit/lit.py -sv $(CHECK_XTEST_TESTS) |
| 445 endif | 454 endif |
| 446 | 455 |
| 447 check-unit: $(OBJDIR)/run_unittests | 456 check-unit: $(OBJDIR)/run_unittests |
| 448 $(OBJDIR)/run_unittests | 457 $(OBJDIR)/run_unittests |
| 449 | 458 |
| 450 # List the spec2k components in roughly reverse order of runtime, to help with | 459 # List the spec2k components in roughly reverse order of runtime, to help with |
| 451 # parallel execution speed. | 460 # parallel execution speed. |
| 452 ALLSPEC := 253.perlbmk 177.mesa 188.ammp 256.bzip2 164.gzip 179.art 183.equake \ | 461 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 \ | 462 175.vpr 176.gcc 181.mcf 186.crafty 197.parser 254.gap 255.vortex \ |
| 454 300.twolf 252.eon | 463 300.twolf 252.eon |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 -p1 -style=LLVM -i | 554 -p1 -style=LLVM -i |
| 546 | 555 |
| 547 bloat: make_symlink | 556 bloat: make_symlink |
| 548 nm -C -S -l pnacl-sz | \ | 557 nm -C -S -l pnacl-sz | \ |
| 549 bloat/bloat.py --nm-output=/dev/stdin syms > build/pnacl-sz.bloat.json | 558 bloat/bloat.py --nm-output=/dev/stdin syms > build/pnacl-sz.bloat.json |
| 550 @echo See Subzero size breakdown in bloat/pnacl-sz.bloat.html | 559 @echo See Subzero size breakdown in bloat/pnacl-sz.bloat.html |
| 551 | 560 |
| 552 docs: | 561 docs: |
| 553 make -C docs -f Makefile.standalone | 562 make -C docs -f Makefile.standalone |
| 554 | 563 |
| 564 help: |
| 565 @cat Makefile.standalone-help/help.txt |
| 566 |
| 567 help-check-lit: |
| 568 @cat Makefile.standalone-help/check-lit.txt |
| 569 |
| 570 help-check-xtest: |
| 571 @cat Makefile.standalone-help/check-xtest.txt |
| 572 |
| 555 clean: | 573 clean: |
| 556 rm -rf pnacl-sz *.o $(OBJDIR) $(SB_OBJDIR) build/pnacl-sz.bloat.json | 574 rm -rf pnacl-sz *.o $(OBJDIR) $(SB_OBJDIR) build/pnacl-sz.bloat.json |
| 557 | 575 |
| 558 clean-all: clean | 576 clean-all: clean |
| 559 rm -rf build/ crosstest/Output/ | 577 rm -rf build/ crosstest/Output/ |
| OLD | NEW |