Jim Stichnoth | f7c9a14 | 2014-04-29 10:52:43 -0700 | [diff] [blame] | 1 | |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 2 | ifndef SUBZERO_LEVEL |
| 3 | # Top-level, not included from a subdir |
| 4 | SUBZERO_LEVEL := . |
| 5 | DIRS := src |
| 6 | PARALLEL_DIRS := |
| 7 | endif |
Jim Stichnoth | f7c9a14 | 2014-04-29 10:52:43 -0700 | [diff] [blame] | 8 | |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 9 | # Set LLVM source root level. |
| 10 | LEVEL := $(SUBZERO_LEVEL)/../.. |
Jim Stichnoth | f7c9a14 | 2014-04-29 10:52:43 -0700 | [diff] [blame] | 11 | |
Derek Schuff | bc64313 | 2014-05-22 16:39:25 -0700 | [diff] [blame] | 12 | # Include LLVM common makefile. |
| 13 | include $(LEVEL)/Makefile.common |
Karl Schimpf | b262c5e | 2014-10-27 14:41:57 -0700 | [diff] [blame] | 14 | |
Jan Voung | e837e1a | 2015-03-02 14:21:54 -0800 | [diff] [blame] | 15 | # -O3 seems to trigger the following PNaCl ABI transform bug |
| 16 | # on method pointers, so override that with -O2: |
| 17 | # https://code.google.com/p/nativeclient/issues/detail?id=3857 |
| 18 | CXX.Flags += -O2 |
| 19 | # Newlib paired with libc++ requires gnu. |
| 20 | CXX.Flags += -std=gnu++11 |
Karl Schimpf | b262c5e | 2014-10-27 14:41:57 -0700 | [diff] [blame] | 21 | |
Jan Voung | e837e1a | 2015-03-02 14:21:54 -0800 | [diff] [blame] | 22 | ifeq ($(PNACL_BROWSER_TRANSLATOR),1) |
| 23 | CPP.Defines += -DALLOW_DUMP=0 -DALLOW_LLVM_CL=0 -DALLOW_LLVM_IR=0 \ |
Jim Stichnoth | 1670ece | 2016-03-12 10:04:08 -0800 | [diff] [blame] | 24 | -DALLOW_TIMERS=0 -DALLOW_LLVM_IR_AS_INPUT=0 -DALLOW_MINIMAL_BUILD=1 \ |
John Porto | 681f90f | 2016-04-05 06:20:50 -0700 | [diff] [blame] | 25 | -DALLOW_WASM=0 -DPNACL_BROWSER_TRANSLATOR=1 |
Jan Voung | e837e1a | 2015-03-02 14:21:54 -0800 | [diff] [blame] | 26 | else |
| 27 | CPP.Defines += -DALLOW_DUMP=1 -DALLOW_LLVM_CL=1 -DALLOW_LLVM_IR=1 \ |
Jim Stichnoth | 1670ece | 2016-03-12 10:04:08 -0800 | [diff] [blame] | 28 | -DALLOW_TIMERS=1 -DALLOW_LLVM_IR_AS_INPUT=1 -DALLOW_MINIMAL_BUILD=0 \ |
John Porto | 681f90f | 2016-04-05 06:20:50 -0700 | [diff] [blame] | 29 | -DALLOW_WASM=0 -DPNACL_BROWSER_TRANSLATOR=0 |
Jim Stichnoth | 7146e99 | 2016-05-02 12:06:22 -0700 | [diff] [blame] | 30 | CXX.Flags += -Wno-undefined-var-template |
Jan Voung | e837e1a | 2015-03-02 14:21:54 -0800 | [diff] [blame] | 31 | endif |
Jim Stichnoth | f5fdd23 | 2016-05-09 12:24:36 -0700 | [diff] [blame] | 32 | |
| 33 | CPP.Defines += -DPNACL_LLVM |
Jim Stichnoth | ca7a367 | 2016-09-14 11:07:30 -0700 | [diff] [blame] | 34 | # SUBZERO_SRC_ROOT should already be set, but if not, set to cwd. |
| 35 | SUBZERO_SRC_ROOT ?= . |
| 36 | SZ_COMMIT_COUNT := $(shell git -C $(SUBZERO_SRC_ROOT) rev-list --count HEAD) |
| 37 | SZ_GIT_HASH := $(shell git -C $(SUBZERO_SRC_ROOT) rev-parse HEAD) |
Jim Stichnoth | 6b0ee2a | 2016-08-17 16:20:21 -0700 | [diff] [blame] | 38 | CPP.Defines += -DSUBZERO_REVISION=$(SZ_COMMIT_COUNT)_$(SZ_GIT_HASH) |