1 2ifndef SUBZERO_LEVEL 3# Top-level, not included from a subdir 4SUBZERO_LEVEL := . 5DIRS := src 6PARALLEL_DIRS := 7endif 8 9# Set LLVM source root level. 10LEVEL := $(SUBZERO_LEVEL)/../.. 11 12# Include LLVM common makefile. 13include $(LEVEL)/Makefile.common 14 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 18CXX.Flags += -O2 19# Newlib paired with libc++ requires gnu. 20CXX.Flags += -std=gnu++11 21 22ifeq ($(PNACL_BROWSER_TRANSLATOR),1) 23 CPP.Defines += -DALLOW_DUMP=0 -DALLOW_LLVM_CL=0 -DALLOW_LLVM_IR=0 \ 24 -DALLOW_TIMERS=0 -DALLOW_LLVM_IR_AS_INPUT=0 -DALLOW_MINIMAL_BUILD=1 \ 25 -DALLOW_WASM=0 -DPNACL_BROWSER_TRANSLATOR=1 26else 27 CPP.Defines += -DALLOW_DUMP=1 -DALLOW_LLVM_CL=1 -DALLOW_LLVM_IR=1 \ 28 -DALLOW_TIMERS=1 -DALLOW_LLVM_IR_AS_INPUT=1 -DALLOW_MINIMAL_BUILD=0 \ 29 -DALLOW_WASM=0 -DPNACL_BROWSER_TRANSLATOR=0 30 CXX.Flags += -Wno-undefined-var-template 31endif 32 33CPP.Defines += -DPNACL_LLVM 34# SUBZERO_SRC_ROOT should already be set, but if not, set to cwd. 35SUBZERO_SRC_ROOT ?= . 36SZ_COMMIT_COUNT := $(shell git -C $(SUBZERO_SRC_ROOT) rev-list --count HEAD) 37SZ_GIT_HASH := $(shell git -C $(SUBZERO_SRC_ROOT) rev-parse HEAD) 38CPP.Defines += -DSUBZERO_REVISION=$(SZ_COMMIT_COUNT)_$(SZ_GIT_HASH) 39