Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: nacltoons/proj.nacl/Makefile

Issue 14851014: [nacltoons] Move nacl-specific build to proj.nacl (Closed) Base URL: https://nativeclient-sdk.googlecode.com/svn/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « nacltoons/game.mk ('k') | nacltoons/proj.nacl/main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # 5 #
6 # GNU Make based build file. For details on GNU Make see: 6 # GNU Make based build file. For details on GNU Make see:
7 # http://www.gnu.org/software/make/manual/make.html 7 # http://www.gnu.org/software/make/manual/make.html
8 # 8 #
9 # 9 #
10 10
11 # 11 #
12 # Default configuration 12 # Default configuration
13 # 13 #
14 # By default we will build a Debug configuration using the GCC newlib toolcahin 14 # By default we will build a Debug configuration using the GCC newlib toolcahin
15 # to override this, specify TOOLCHAIN=newlib|glibc or CONFIG=Debug|Release on 15 # to override this, specify TOOLCHAIN=newlib|glibc or CONFIG=Debug|Release on
16 # the make command-line or in this file prior to including common.mk. The 16 # the make command-line or in this file prior to including common.mk. The
17 # toolchain we use by default will be the first valid one listed 17 # toolchain we use by default will be the first valid one listed
18 VALID_TOOLCHAINS:="newlib glibc" 18 VALID_TOOLCHAINS := "newlib glibc"
19 TOOLCHAIN?=newlib 19 TOOLCHAIN ?= newlib
20 20
21 OUTBASE:=out 21 OUTBASE := ../out
22 22
23 # 23 #
24 # Target Name 24 # Target Name
25 # 25 #
26 # The base name of the final NEXE, also the name of the NMF file containing 26 # The base name of the final NEXE, also the name of the NMF file containing
27 # the mapping between architecture and actual NEXE. 27 # the mapping between architecture and actual NEXE.
28 # 28 #
29 TARGET:=nacltoons 29 TARGET := nacltoons
30 30
31 COCOS_ROOT = ../third_party/cocos2d-x 31 COCOS_ROOT = ../../third_party/cocos2d-x
32 32
33 # 33 #
34 # List of sources to compile 34 # List of sources to compile
35 # 35 #
36 SOURCES := src/main.cc \ 36 SOURCES := main.cc \
37 » src/app_delegate.cc \ 37 » ../src/app_delegate.cc \
38 » src/game_manager.cc \ 38 » ../src/game_manager.cc \
39 » src/level_layer.cc \ 39 » ../src/level_layer.cc \
40 » bindings/LuaBox2D.cpp \ 40 » ../bindings/LuaBox2D.cpp \
41 » bindings/lua_level_layer.cpp \ 41 » ../bindings/lua_level_layer.cpp \
42 » bindings/LuaCocos2dExtensions.cpp \ 42 » ../bindings/LuaCocos2dExtensions.cpp \
43 $(COCOS_ROOT)/samples/Cpp/TestCpp/Classes/Box2DTestBed/GLES-Render.cp p \ 43 $(COCOS_ROOT)/samples/Cpp/TestCpp/Classes/Box2DTestBed/GLES-Render.cp p \
44 $(COCOS_ROOT)/extensions/physics_nodes/CCPhysicsDebugNode.cpp \ 44 $(COCOS_ROOT)/extensions/physics_nodes/CCPhysicsDebugNode.cpp \
45 $(COCOS_ROOT)/extensions/physics_nodes/CCPhysicsSprite.cpp \ 45 $(COCOS_ROOT)/extensions/physics_nodes/CCPhysicsSprite.cpp \
46 $(COCOS_ROOT)/scripting/lua/cocos2dx_support/CCLuaEngine.cpp \ 46 $(COCOS_ROOT)/scripting/lua/cocos2dx_support/CCLuaEngine.cpp \
47 $(COCOS_ROOT)/scripting/lua/cocos2dx_support/CCLuaStack.cpp \ 47 $(COCOS_ROOT)/scripting/lua/cocos2dx_support/CCLuaStack.cpp \
48 $(COCOS_ROOT)/scripting/lua/cocos2dx_support/Cocos2dxLuaLoader.cpp \ 48 $(COCOS_ROOT)/scripting/lua/cocos2dx_support/Cocos2dxLuaLoader.cpp \
49 $(COCOS_ROOT)/scripting/lua/cocos2dx_support/LuaCocos2d.cpp \ 49 $(COCOS_ROOT)/scripting/lua/cocos2dx_support/LuaCocos2d.cpp \
50 $(COCOS_ROOT)/scripting/lua/cocos2dx_support/tolua_fix.c 50 $(COCOS_ROOT)/scripting/lua/cocos2dx_support/tolua_fix.c
51 51
52 52
53 PAGE:=$(OUTBASE)/publish/index.html 53 PAGE := index.html
54 54
55 # 55 #
56 # Get pepper directory for toolchain and includes. 56 # Get pepper directory for toolchain and includes.
57 # 57 #
58 # If NACL_SDK_ROOT is not set, then assume it can be found relative to 58 # If NACL_SDK_ROOT is not set, then assume it can be found relative to
59 # to this Makefile. 59 # to this Makefile.
60 # 60 #
61 ifndef NACL_SDK_ROOT 61 ifndef NACL_SDK_ROOT
62 $(error NACL_SDK_ROOT not set) 62 $(error NACL_SDK_ROOT not set)
63 endif 63 endif
64 64
65 NACL_SDK_VERSION_MIN := 27.186236 65 NACL_SDK_VERSION_MIN := 27.186236
66 include $(NACL_SDK_ROOT)/tools/common.mk 66 include $(NACL_SDK_ROOT)/tools/common.mk
67 67
68 # TODO(noelallen) override to remove incognito until Chrome fix 68 # TODO(noelallen) override to remove incognito until Chrome fix
69 CHROME_ARGS:=--enable-nacl --ppapi-out-of-process --no-first-run --user-data-dir =$(OUTBASE)/user-data-dir 69 CHROME_ARGS := --enable-nacl --ppapi-out-of-process --no-first-run --user-data-d ir=$(OUTBASE)/user-data-dir
70 70
71 # In recent SDK versions defining NACL_SDK_VERSION_MIN is enough to trigger and error 71 # In recent SDK versions defining NACL_SDK_VERSION_MIN is enough to trigger and error
72 # but older SDKs didn't know about this so we check for older versions that don' t 72 # but older SDKs didn't know about this so we check for older versions that don' t
73 # support --sdk-version 73 # support --sdk-version
74 SDK_VERSION := $(shell $(GETOS) --sdk-version) 74 SDK_VERSION := $(shell $(GETOS) --sdk-version)
75 ifndef SDK_VERSION 75 ifndef SDK_VERSION
76 $(error You need a more recent version of the NaCl SDK (>= $(NACL_SDK_VERSION_ MIN))) 76 $(error You need a more recent version of the NaCl SDK (>= $(NACL_SDK_VERSION_ MIN)))
77 endif 77 endif
78 78
79 CFLAGS += -DCOCOS2D_DEBUG -DCC_ENABLE_BOX2D_INTEGRATION 79 CFLAGS += -DCOCOS2D_DEBUG -DCC_ENABLE_BOX2D_INTEGRATION
80 CFLAGS += -Wall -Wno-unknown-pragmas 80 CFLAGS += -Wall -Wno-unknown-pragmas
81 81
82 COCOS2DX_PATH = $(OUTBASE)/cocos2dx 82 COCOS2DX_PATH = $(OUTBASE)/cocos2dx
83 83
84 # By default we pull naclports from the installed SDK, but we can 84 # By default we pull naclports from the installed SDK, but we can
85 # build and use them locally by defining LOCAL_PORTS 85 # build and use them locally by defining LOCAL_PORTS
86 ifdef LOCAL_PORTS 86 ifdef LOCAL_PORTS
87 NACLPORTS_ROOT = $(OUTBASE)/naclports 87 NACLPORTS_ROOT = $(OUTBASE)/naclports
88 else 88 else
89 NACLPORTS_ROOT = $(NACL_SDK_ROOT)/ports 89 NACLPORTS_ROOT = $(NACL_SDK_ROOT)/ports
90 endif 90 endif
91 91
92 CINCLUDE= \ 92 CINCLUDE= \
93 -Isrc \ 93 -I../src \
94 -Ibindings \ 94 -I../bindings \
95 -I$(COCOS2DX_PATH) \ 95 -I$(COCOS2DX_PATH) \
96 -I$(COCOS2DX_PATH)/cocoa \ 96 -I$(COCOS2DX_PATH)/cocoa \
97 -I$(COCOS2DX_PATH)/external \ 97 -I$(COCOS2DX_PATH)/external \
98 -I$(COCOS2DX_PATH)/include \ 98 -I$(COCOS2DX_PATH)/include \
99 -I$(COCOS2DX_PATH)/platform/nacl \ 99 -I$(COCOS2DX_PATH)/platform/nacl \
100 -I$(COCOS2DX_PATH)/kazmath/include \ 100 -I$(COCOS2DX_PATH)/kazmath/include \
101 -I$(NACL_SDK_ROOT)/include \ 101 -I$(NACL_SDK_ROOT)/include \
102 -I$(NACLPORTS_ROOT)/include \ 102 -I$(NACLPORTS_ROOT)/include \
103 -I../third_party/cocos2d-x/external \ 103 -I$(COCOS_ROOT)/external \
104 -I../third_party/cocos2d-x/extensions \ 104 -I$(COCOS_ROOT)/extensions \
105 -I../third_party/cocos2d-x/samples/Cpp/TestCpp/Classes/Box2DTestBed 105 -I$(COCOS_ROOT)/samples/Cpp/TestCpp/Classes/Box2DTestBed
106 106
107 LIB_PATHS += $(COCOS2DX_PATH)/lib 107 LIB_PATHS += $(COCOS2DX_PATH)/lib
108 LIB_PATHS += $(NACLPORTS_ROOT)/lib 108 LIB_PATHS += $(NACLPORTS_ROOT)/lib
109 109
110 # 110 #
111 # List of libraries to link against. Unlike some tools, the GCC and LLVM 111 # List of libraries to link against. Unlike some tools, the GCC and LLVM
112 # based tools require libraries to be specified in the correct order. The 112 # based tools require libraries to be specified in the correct order. The
113 # order should be symbol reference followed by symbol definition, with direct 113 # order should be symbol reference followed by symbol definition, with direct
114 # sources to the link (object files) are left most. In this case: 114 # sources to the link (object files) are left most. In this case:
115 # hello_world -> ppapi_main -> ppapi_cpp -> ppapi -> pthread -> libc 115 # hello_world -> ppapi_main -> ppapi_cpp -> ppapi -> pthread -> libc
116 # Notice that libc is implied and come last through standard compiler/link 116 # Notice that libc is implied and come last through standard compiler/link
117 # switches. 117 # switches.
118 # 118 #
119 # We break this list down into two parts, the set we need to rebuild (DEPS) 119 # We break this list down into two parts, the set we need to rebuild (DEPS)
120 # and the set we do not. This example does not havea any additional library 120 # and the set we do not. This example does not havea any additional library
121 # dependencies. 121 # dependencies.
122 # 122 #
123 DEPS= 123 DEPS =
124 SOUNDLIBS=cocosdenshion alut openal vorbisfile vorbis ogg 124 SOUNDLIBS = cocosdenshion alut openal vorbisfile vorbis ogg
125 LIBS=$(DEPS) lua cocos2d $(SOUNDLIBS) freetype box2d xml2 png12 jpeg tiff webp 125 LIBS = $(DEPS) lua cocos2d $(SOUNDLIBS) freetype box2d xml2 png12 jpeg tiff webp
126 LIBS+=nacl_io ppapi_gles2 ppapi ppapi_cpp z 126 LIBS += nacl_io ppapi_gles2 ppapi ppapi_cpp z
127 127
128 GLIBC_PATHS+=-L$(TC_PATH)/$(OSNAME)_x86_glibc/i686-nacl/usr/lib 128 GLIBC_PATHS += -L$(TC_PATH)/$(OSNAME)_x86_glibc/i686-nacl/usr/lib
129 GLIBC_PATHS+=-L$(TC_PATH)/$(OSNAME)_x86_glibc/x86_64-nacl/usr/lib 129 GLIBC_PATHS += -L$(TC_PATH)/$(OSNAME)_x86_glibc/x86_64-nacl/usr/lib
130
131 LAUNCH: CHECK_FOR_CHROME all
132 » $(RUN_PY) -C $(abspath $(OUTBASE)/publish) -P $(PAGE_TC_CONFIG) \
133 » $(addprefix -E ,$(CHROME_ENV)) -- $(CHROME_PATH) $(CHROME_ARGS) \
134 » --register-pepper-plugins="$(PPAPI_DEBUG),$(PPAPI_RELEASE)"
130 135
131 # 136 #
132 # Use the library dependency macro for each dependency 137 # Use the library dependency macro for each dependency
133 # 138 #
134 $(foreach dep,$(DEPS),$(eval $(call DEPEND_RULE,$(dep)))) 139 $(foreach dep,$(DEPS),$(eval $(call DEPEND_RULE,$(dep))))
135 140
136 # 141 #
137 # Use the compile macro for each source. 142 # Use the compile macro for each source.
138 # 143 #
139 $(foreach src,$(SOURCES),$(eval $(call COMPILE_RULE,$(src),$(CFLAGS),$(CINCLUDE) ))) 144 $(foreach src,$(SOURCES),$(eval $(call COMPILE_RULE,$(src),$(CFLAGS),$(CINCLUDE) )))
(...skipping 19 matching lines...) Expand all
159 164
160 $(OUTDIR)/$(TARGET)_arm.nexe: \ 165 $(OUTDIR)/$(TARGET)_arm.nexe: \
161 $(COCOS2DX_PATH)/lib/$(TOOLCHAIN)_arm/$(CONFIG)/libcocos2d.a \ 166 $(COCOS2DX_PATH)/lib/$(TOOLCHAIN)_arm/$(CONFIG)/libcocos2d.a \
162 $(COCOS2DX_PATH)/lib/$(TOOLCHAIN)_arm/$(CONFIG)/liblua.a \ 167 $(COCOS2DX_PATH)/lib/$(TOOLCHAIN)_arm/$(CONFIG)/liblua.a \
163 $(COCOS2DX_PATH)/lib/$(TOOLCHAIN)_arm/$(CONFIG)/libbox2d.a 168 $(COCOS2DX_PATH)/lib/$(TOOLCHAIN)_arm/$(CONFIG)/libbox2d.a
164 169
165 $(OUTDIR)/$(TARGET)_x86_32.nexe: \ 170 $(OUTDIR)/$(TARGET)_x86_32.nexe: \
166 $(COCOS2DX_PATH)/lib/$(TOOLCHAIN)_x86_32/$(CONFIG)/libcocos2d.a \ 171 $(COCOS2DX_PATH)/lib/$(TOOLCHAIN)_x86_32/$(CONFIG)/libcocos2d.a \
167 $(COCOS2DX_PATH)/lib/$(TOOLCHAIN)_x86_32/$(CONFIG)/liblua.a \ 172 $(COCOS2DX_PATH)/lib/$(TOOLCHAIN)_x86_32/$(CONFIG)/liblua.a \
168 $(COCOS2DX_PATH)/lib/$(TOOLCHAIN)_x86_32/$(CONFIG)/libbox2d.a 173 $(COCOS2DX_PATH)/lib/$(TOOLCHAIN)_x86_32/$(CONFIG)/libbox2d.a
OLDNEW
« no previous file with comments | « nacltoons/game.mk ('k') | nacltoons/proj.nacl/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698