Game Development Reference
In-Depth Information
APP_PROJECT_PATH := $(call my-dir)/project
APP_MODULES := wolf3d
In the preceding snippet, APP_MODULES is critical. It defines the name of the module and must match
the application folder ( Wolf3D ). At the end of the process, the output library name will be named
libwolf3d.so .
The next folder we need is an application source folder:
Create NDK_HOME\sources\Wolf3D . This folder will contain the native code.
1.
Copy the contents from ch06.Wolf3D.SW/native/gp2xwolf3d into the Wolf3D
folder created in step 1.
2.
Create NDK_HOME\sources\Wolf3D\Android.mk . This is the Makefile used for
compilation (see Listing A-2).
3.
Listing A-2. NDK Makefile for Wolf3D
# Copyright (C) 2009 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# See the License for the specific language governing permissions and
# limitations under the License.
#
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libwolf3d
LP := $(LOCAL_PATH)
INC := -Isources/Wolf3D/include
# optimization
OPTS := -O6 -ffast-math -fexpensive-optimizations -funroll-loops -fomit-frame-pointer
# compilation flags
LOCAL_CFLAGS := -DANDROID $(OPTS) $(INC)
LOCAL_LDLIBS :=
LOCAL_SHARED_LIBRARIES :=
Search WWH ::




Custom Search