OLD | NEW |
1 # This makefile is included by each of the cocos2d-x libraries and examples | 1 # This makefile is included by each of the cocos2d-x libraries and examples |
2 # when building for Native Client. It defines a set of variables that all | 2 # when building for Native Client. It defines a set of variables that all |
3 # cocos2dx projects have in common. | 3 # cocos2dx projects have in common. |
4 | 4 |
5 ifeq ($(NACL_SDK_ROOT),) | 5 ifeq ($(NACL_SDK_ROOT),) |
6 $(error $$NACL_SDK_ROOT not set) | 6 $(error $$NACL_SDK_ROOT not set) |
7 endif | 7 endif |
8 | 8 |
9 NACL_SDK_VERSION_MIN=27.186236 | 9 NACL_SDK_VERSION_MIN=27.186236 |
10 VERSION_CHECK:=$(shell $(NACL_SDK_ROOT)/tools/getos.py --check-version=$(NACL_SD
K_VERSION_MIN) 2>&1) | 10 VERSION_CHECK:=$(shell $(NACL_SDK_ROOT)/tools/getos.py --check-version=$(NACL_SD
K_VERSION_MIN) 2>&1) |
11 ifneq ($(VERSION_CHECK),) | 11 ifneq ($(VERSION_CHECK),) |
12 $(error $(VERSION_CHECK)) | 12 $(error $(VERSION_CHECK)) |
13 endif | 13 endif |
14 | 14 |
15 all: | 15 all: |
16 | 16 |
| 17 ifeq ($(NACL_GLIBC),1) |
| 18 NACL_LIBC = glibc |
| 19 else |
17 NACL_LIBC = newlib | 20 NACL_LIBC = newlib |
| 21 endif |
| 22 |
18 NACL_ARCH ?= x86_64 | 23 NACL_ARCH ?= x86_64 |
19 NACL_AR ?= $(NACL_ARCH)-nacl-ar | 24 NACL_AR ?= $(NACL_ARCH)-nacl-ar |
20 NACL_CC ?= $(NACL_ARCH)-nacl-gcc | 25 NACL_CC ?= $(NACL_ARCH)-nacl-gcc |
21 NACL_CXX ?= $(NACL_ARCH)-nacl-g++ | 26 NACL_CXX ?= $(NACL_ARCH)-nacl-g++ |
22 CCFLAGS += -Wall -Werror | 27 CCFLAGS += -Wall -Werror |
23 CXXFLAGS += -Wall -Werror | 28 CXXFLAGS += -Wall -Werror |
24 ARFLAGS = cr | 29 ARFLAGS = cr |
25 | 30 |
26 THIS_MAKEFILE := $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) | 31 THIS_MAKEFILE := $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) |
27 | 32 |
(...skipping 10 matching lines...) Expand all Loading... |
38 else | 43 else |
39 ARCH_DIR := $(NACL_LIBC)_$(NACL_ARCH) | 44 ARCH_DIR := $(NACL_LIBC)_$(NACL_ARCH) |
40 endif | 45 endif |
41 | 46 |
42 NACLPORTS_ROOT ?= $(NACL_SDK_ROOT)/ports | 47 NACLPORTS_ROOT ?= $(NACL_SDK_ROOT)/ports |
43 NACLPORTS_INCLUDE ?= $(NACLPORTS_ROOT)/include | 48 NACLPORTS_INCLUDE ?= $(NACLPORTS_ROOT)/include |
44 OUT_DIR ?= obj | 49 OUT_DIR ?= obj |
45 OBJ_DIR ?= $(OUT_DIR)/$(NACL_ARCH) | 50 OBJ_DIR ?= $(OUT_DIR)/$(NACL_ARCH) |
46 LIB_DIR ?= $(COCOS_ROOT)/lib/nacl/$(ARCH_DIR) | 51 LIB_DIR ?= $(COCOS_ROOT)/lib/nacl/$(ARCH_DIR) |
47 | 52 |
| 53 NMF_FLAGS = --objdump=i686-nacl-objdump |
| 54 NMF_FLAGS += -L$(NACL_SDK_ROOT)/toolchain/linux_x86_$(NACL_LIBC)/x86_64-nacl/lib
32/ |
| 55 NMF_FLAGS += -L$(NACL_SDK_ROOT)/toolchain/linux_x86_$(NACL_LIBC)/x86_64-nacl/lib
64/ |
| 56 NMF_FLAGS += -L$(NACL_SDK_ROOT)/lib/$(NACL_LIBC)_x86_32/Release |
| 57 NMF_FLAGS += -L$(NACL_SDK_ROOT)/lib/$(NACL_LIBC)_x86_64/Release |
| 58 NMF_FLAGS += -L$(NACLPORTS_ROOT)/lib/$(NACL_LIBC)_x86_32/Release |
| 59 NMF_FLAGS += -L$(NACLPORTS_ROOT)/lib/$(NACL_LIBC)_x86_64/Release |
| 60 |
48 ifdef USE_BOX2D | 61 ifdef USE_BOX2D |
49 DEFINES += -DCC_ENABLE_BOX2D_INTEGRATION=1 | 62 DEFINES += -DCC_ENABLE_BOX2D_INTEGRATION=1 |
50 else | 63 else |
51 DEFINES += -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 | 64 DEFINES += -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 |
52 endif | 65 endif |
53 | 66 |
54 INCLUDES += -I$(COCOS_SRC) \ | 67 INCLUDES += -I$(COCOS_SRC) \ |
55 -I$(COCOS_SRC)/cocoa \ | 68 -I$(COCOS_SRC)/cocoa \ |
56 -I$(COCOS_SRC)/include \ | 69 -I$(COCOS_SRC)/include \ |
57 -I$(COCOS_SRC)/kazmath/include \ | 70 -I$(COCOS_SRC)/kazmath/include \ |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 OBJECTS := $(addprefix $(OBJ_DIR)/, $(OBJECTS)) | 127 OBJECTS := $(addprefix $(OBJ_DIR)/, $(OBJECTS)) |
115 DEPS = $(OBJECTS:.o=.d) | 128 DEPS = $(OBJECTS:.o=.d) |
116 CORE_MAKEFILE_LIST := $(MAKEFILE_LIST) | 129 CORE_MAKEFILE_LIST := $(MAKEFILE_LIST) |
117 -include $(DEPS) | 130 -include $(DEPS) |
118 | 131 |
119 clean: | 132 clean: |
120 rm -rf $(OBJ_DIR) | 133 rm -rf $(OBJ_DIR) |
121 rm -f $(TARGET) core | 134 rm -f $(TARGET) core |
122 | 135 |
123 .PHONY: all clean | 136 .PHONY: all clean |
OLD | NEW |