OLD | NEW |
1 # | 1 # |
2 # Copyright 2013 the V8 project authors. All rights reserved. | 2 # Copyright 2013 the V8 project authors. All rights reserved. |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following | 10 # copyright notice, this list of conditions and the following |
(...skipping 18 matching lines...) Expand all Loading... |
29 # Those definitions should be consistent with the main Makefile | 29 # Those definitions should be consistent with the main Makefile |
30 NACL_ARCHES = nacl_ia32 nacl_x64 | 30 NACL_ARCHES = nacl_ia32 nacl_x64 |
31 MODES = release debug | 31 MODES = release debug |
32 | 32 |
33 # Generates all combinations of NACL ARCHES and MODES, | 33 # Generates all combinations of NACL ARCHES and MODES, |
34 # e.g. "nacl_ia32.release" or "nacl_x64.release" | 34 # e.g. "nacl_ia32.release" or "nacl_x64.release" |
35 NACL_BUILDS = $(foreach mode,$(MODES), \ | 35 NACL_BUILDS = $(foreach mode,$(MODES), \ |
36 $(addsuffix .$(mode),$(NACL_ARCHES))) | 36 $(addsuffix .$(mode),$(NACL_ARCHES))) |
37 | 37 |
38 HOST_OS = $(shell uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/') | 38 HOST_OS = $(shell uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/') |
39 ifeq ($(HOST_OS), linux) | 39 TOOLCHAIN_PATH = $(realpath ${NACL_SDK_ROOT}/toolchain) |
40 TOOLCHAIN_DIR = linux_x86_glibc | 40 NACL_TOOLCHAIN ?= ${TOOLCHAIN_PATH}/linux_pnacl |
41 else | 41 |
42 ifeq ($(HOST_OS), mac) | 42 ifeq ($(wildcard $(NACL_TOOLCHAIN)),) |
43 TOOLCHAIN_DIR = mac_x86_glibc | 43 $(error Cannot find Native Client toolchain in "${NACL_TOOLCHAIN}") |
44 else | |
45 $(error Host platform "${HOST_OS}" is not supported) | |
46 endif | |
47 endif | 44 endif |
48 | 45 |
49 TOOLCHAIN_PATH = $(realpath ${NACL_SDK_ROOT}/toolchain) | |
50 NACL_TOOLCHAIN ?= ${TOOLCHAIN_PATH}/${TOOLCHAIN_DIR} | |
51 | |
52 ifeq ($(ARCH), nacl_ia32) | 46 ifeq ($(ARCH), nacl_ia32) |
53 GYPENV = nacl_target_arch=nacl_ia32 v8_target_arch=arm v8_host_arch=ia32 | 47 GYPENV = nacl_target_arch=nacl_ia32 v8_target_arch=arm v8_host_arch=ia32 |
54 TOOLCHAIN_ARCH = x86-4.4 | 48 NACL_CC = "$(NACL_TOOLCHAIN)/bin/pnacl-clang" |
55 NACL_CC = "$(NACL_TOOLCHAIN)/bin/i686-nacl-gcc" | 49 NACL_CXX = "$(NACL_TOOLCHAIN)/bin/pnacl-clang++" |
56 NACL_CXX = "$(NACL_TOOLCHAIN)/bin/i686-nacl-g++" | 50 NACL_LINK = "$(NACL_TOOLCHAIN)/bin/pnacl-clang++ --pnacl-allow-native -arch x8
6-32" |
57 NACL_LINK = "$(NACL_TOOLCHAIN)/bin/i686-nacl-g++" | |
58 else | 51 else |
59 ifeq ($(ARCH), nacl_x64) | 52 ifeq ($(ARCH), nacl_x64) |
60 GYPENV = nacl_target_arch=nacl_x64 v8_target_arch=arm v8_host_arch=ia32 | 53 GYPENV = nacl_target_arch=nacl_x64 v8_target_arch=arm v8_host_arch=ia32 |
61 TOOLCHAIN_ARCH = x86-4.4 | 54 NACL_CC = "$(NACL_TOOLCHAIN)/bin/pnacl-clang" |
62 NACL_CC = "$(NACL_TOOLCHAIN)/bin/x86_64-nacl-gcc" | 55 NACL_CXX = "$(NACL_TOOLCHAIN)/bin/pnacl-clang++" |
63 NACL_CXX = "$(NACL_TOOLCHAIN)/bin/x86_64-nacl-g++" | 56 NACL_LINK = "$(NACL_TOOLCHAIN)/bin/pnacl-clang++ --pnacl-allow-native -arch
x86-64" |
64 NACL_LINK = "$(NACL_TOOLCHAIN)/bin/x86_64-nacl-g++" | |
65 else | 57 else |
66 $(error Target architecture "${ARCH}" is not supported) | 58 $(error Target architecture "${ARCH}" is not supported) |
67 endif | 59 endif |
68 endif | 60 endif |
69 | 61 |
70 ifeq ($(wildcard $(NACL_TOOLCHAIN)),) | |
71 $(error Cannot find Native Client toolchain in "${NACL_TOOLCHAIN}") | |
72 endif | |
73 | |
74 # For mksnapshot host generation. | 62 # For mksnapshot host generation. |
75 GYPENV += host_os=${HOST_OS} | 63 GYPENV += host_os=${HOST_OS} |
76 | 64 |
77 # ICU doesn't support NaCl. | 65 # ICU doesn't support NaCl. |
78 GYPENV += v8_enable_i18n_support=0 | 66 GYPENV += v8_enable_i18n_support=0 |
79 | 67 |
80 # Disable strict aliasing - v8 code often relies on undefined behavior of C++. | 68 # Disable strict aliasing - v8 code often relies on undefined behavior of C++. |
81 GYPENV += v8_no_strict_aliasing=1 | 69 GYPENV += v8_no_strict_aliasing=1 |
82 | 70 |
83 NACL_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(NACL_BUILDS)) | 71 NACL_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(NACL_BUILDS)) |
84 .SECONDEXPANSION: | 72 .SECONDEXPANSION: |
85 # For some reason the $$(basename $$@) expansion didn't work here... | 73 # For some reason the $$(basename $$@) expansion didn't work here... |
86 $(NACL_BUILDS): $(NACL_MAKEFILES) | 74 $(NACL_BUILDS): $(NACL_MAKEFILES) |
87 @$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \ | 75 @$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \ |
| 76 CC=${NACL_CC} \ |
88 CXX=${NACL_CXX} \ | 77 CXX=${NACL_CXX} \ |
| 78 AR="$(NACL_TOOLCHAIN)/bin/pnacl-ar" \ |
| 79 RANLIB="$(NACL_TOOLCHAIN)/bin/pnacl-ranlib" \ |
| 80 LD="$(NACL_TOOLCHAIN)/bin/pnacl-ld" \ |
89 LINK=${NACL_LINK} \ | 81 LINK=${NACL_LINK} \ |
90 BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ | 82 BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ |
91 python -c "print raw_input().capitalize()") \ | 83 python -c "print raw_input().capitalize()") \ |
92 builddir="$(shell pwd)/$(OUTDIR)/$@" | 84 builddir="$(shell pwd)/$(OUTDIR)/$@" |
93 | 85 |
94 # NACL GYP file generation targets. | 86 # NACL GYP file generation targets. |
95 $(NACL_MAKEFILES): | 87 $(NACL_MAKEFILES): |
96 GYP_GENERATORS=make \ | 88 GYP_GENERATORS=make \ |
97 GYP_DEFINES="${GYPENV}" \ | 89 GYP_DEFINES="${GYPENV}" \ |
98 CC=${NACL_CC} \ | 90 CC=${NACL_CC} \ |
99 CXX=${NACL_CXX} \ | 91 CXX=${NACL_CXX} \ |
| 92 LINK=${NACL_LINK} \ |
100 PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:
$(PYTHONPATH)" \ | 93 PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:
$(PYTHONPATH)" \ |
101 build/gyp/gyp --generator-output="${OUTDIR}" build/all.gyp \ | 94 build/gyp/gyp --generator-output="${OUTDIR}" build/all.gyp \ |
102 -Ibuild/standalone.gypi --depth=. \ | 95 -Ibuild/standalone.gypi --depth=. \ |
103 -S$(suffix $(basename $@))$(suffix $@) $(GYPFLAGS) \ | 96 -S$(suffix $(basename $@))$(suffix $@) $(GYPFLAGS) \ |
104 -Dwno_array_bounds=-Wno-array-bounds | 97 -Dwno_array_bounds=-Wno-array-bounds |
OLD | NEW |