The data contained in this repository can be downloaded to your computer using one of several clients.
Please see the documentation of your version control software client for more information.

Please select the desired protocol below to get the URL.

This URL has Read-Only access.

Statistics
| Branch: | Revision:

main_repo / deps / v8 / Makefile.nacl @ f230a1cf

History | View | Annotate | Download (4.02 KB)

1
#
2
# Copyright 2013 the V8 project authors. All rights reserved.
3
# Redistribution and use in source and binary forms, with or without
4
# modification, are permitted provided that the following conditions are
5
# met:
6
#
7
#     * Redistributions of source code must retain the above copyright
8
#       notice, this list of conditions and the following disclaimer.
9
#     * Redistributions in binary form must reproduce the above
10
#       copyright notice, this list of conditions and the following
11
#       disclaimer in the documentation and/or other materials provided
12
#       with the distribution.
13
#     * Neither the name of Google Inc. nor the names of its
14
#       contributors may be used to endorse or promote products derived
15
#       from this software without specific prior written permission.
16
#
17
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28

    
29
# Those definitions should be consistent with the main Makefile
30
NACL_ARCHES = nacl_ia32 nacl_x64
31
MODES = release debug
32

    
33
# Generates all combinations of NACL ARCHES and MODES,
34
# e.g. "nacl_ia32.release" or "nacl_x64.release"
35
NACL_BUILDS = $(foreach mode,$(MODES), \
36
                   $(addsuffix .$(mode),$(NACL_ARCHES)))
37

    
38
HOST_OS = $(shell uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')
39
ifeq ($(HOST_OS), linux)
40
  TOOLCHAIN_DIR = linux_x86_glibc
41
else
42
  ifeq ($(HOST_OS), mac)
43
    TOOLCHAIN_DIR = mac_x86_glibc
44
  else
45
    $(error Host platform "${HOST_OS}" is not supported)
46
  endif
47
endif
48

    
49
TOOLCHAIN_PATH = $(realpath ${NACL_SDK_ROOT}/toolchain)
50
NACL_TOOLCHAIN ?= ${TOOLCHAIN_PATH}/${TOOLCHAIN_DIR}
51

    
52
ifeq ($(ARCH), nacl_ia32)
53
  GYPENV = nacl_target_arch=nacl_ia32 v8_target_arch=arm v8_host_arch=ia32
54
  TOOLCHAIN_ARCH = x86-4.4
55
  NACL_CC = "$(NACL_TOOLCHAIN)/bin/i686-nacl-gcc"
56
  NACL_CXX = "$(NACL_TOOLCHAIN)/bin/i686-nacl-g++"
57
  NACL_LINK = "$(NACL_TOOLCHAIN)/bin/i686-nacl-g++"
58
else
59
  ifeq ($(ARCH), nacl_x64)
60
    GYPENV = nacl_target_arch=nacl_x64 v8_target_arch=arm v8_host_arch=ia32
61
    TOOLCHAIN_ARCH = x86-4.4
62
    NACL_CC = "$(NACL_TOOLCHAIN)/bin/x86_64-nacl-gcc"
63
    NACL_CXX = "$(NACL_TOOLCHAIN)/bin/x86_64-nacl-g++"
64
    NACL_LINK = "$(NACL_TOOLCHAIN)/bin/x86_64-nacl-g++"
65
  else
66
    $(error Target architecture "${ARCH}" is not supported)
67
  endif
68
endif
69

    
70
ifeq ($(wildcard $(NACL_TOOLCHAIN)),)
71
  $(error Cannot find Native Client toolchain in "${NACL_TOOLCHAIN}")
72
endif
73

    
74
# For mksnapshot host generation.
75
GYPENV += host_os=${HOST_OS}
76

    
77
# ICU doesn't support NaCl.
78
GYPENV += v8_enable_i18n_support=0
79

    
80
NACL_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(NACL_ARCHES))
81
.SECONDEXPANSION:
82
# For some reason the $$(basename $$@) expansion didn't work here...
83
$(NACL_BUILDS): $(NACL_MAKEFILES)
84
	@$(MAKE) -C "$(OUTDIR)" -f Makefile.$(basename $@) \
85
	            CXX=${NACL_CXX} \
86
	            LINK=${NACL_LINK} \
87
	            BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \
88
	                        python -c "print raw_input().capitalize()") \
89
	            builddir="$(shell pwd)/$(OUTDIR)/$@"
90

    
91
# NACL GYP file generation targets.
92
$(NACL_MAKEFILES):
93
	@GYP_GENERATORS=make \
94
	GYP_DEFINES="${GYPENV}" \
95
	CC=${NACL_CC} \
96
	CXX=${NACL_CXX} \
97
	PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(PYTHONPATH)" \
98
	build/gyp/gyp --generator-output="${OUTDIR}" build/all.gyp \
99
	              -Ibuild/standalone.gypi --depth=. \
100
	              -S.$(subst .,,$(suffix $@)) $(GYPFLAGS) \
101
                      -Dwno_array_bounds=-Wno-array-bounds