1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
6 # GNU Make based build file. For details on GNU Make see:
7 # http://www.gnu.org/software/make/manual/make.html
11 # Get pepper directory for toolchain and includes.
13 # If NACL_SDK_ROOT is not set, then assume it can be found a two directories up,
14 # from the default example directory location.
16 THIS_MAKEFILE
:=$(abspath
$(lastword
$(MAKEFILE_LIST
)))
17 NACL_SDK_ROOT?
=$(abspath
$(dir $(THIS_MAKEFILE
))..
/..
)
18 CHROME_PATH?
=Undefined
23 NACL_WARNINGS
:=-Wno-long-long
27 # Compute path to requested NaCl Toolchain
29 OSNAME
:=$(shell python
$(NACL_SDK_ROOT
)/tools
/getos.py
)
30 TC_PATH
:=$(abspath
$(NACL_SDK_ROOT
)/toolchain
)
45 # Alias for standard commands
47 CP
:=python
$(NACL_SDK_ROOT
)/tools
/oshelpers.py cp
48 MKDIR
:=python
$(NACL_SDK_ROOT
)/tools
/oshelpers.py mkdir
49 MV
:=python
$(NACL_SDK_ROOT
)/tools
/oshelpers.py mv
50 RM
:=python
$(NACL_SDK_ROOT
)/tools
/oshelpers.py
rm
54 # Verify we selected a valid toolchain for this example
56 ifeq (,$(findstring $(TOOLCHAIN
),$(VALID_TOOLCHAINS
)))
57 $(warning Availbile choices are
: $(VALID_TOOLCHAINS
))
58 $(error Can not use TOOLCHAIN
=$(TOOLCHAIN
) on this library.
)
63 # Verify we have a valid NACL_SDK_ROOT by looking for the toolchain directory
65 ifeq (,$(wildcard $(TC_PATH
)))
66 $(warning No valid NACL_SDK_ROOT at
$(NACL_SDK_ROOT
))
67 ifeq ($(origin NACL_SDK_ROOT
), 'file')
68 $(error Override the default value via enviornment variable
, or command-line.
)
70 $(error Fix the NACL_SDK_ROOT specified in the environment or command-line.
)
76 # Disable DOS PATH warning when using Cygwin based NaCl tools on Windows
78 CYGWIN ?
= nodosfilewarning