Doom Library DSO Compilation

Listing 7-25 shows the Makefile for the DSO. It uses the compiler and linker helper scripts agcc and ald, created in Chapter 1. The default optimization level is set to 2. Other compilation flags include the following:

• -nostdinc: Do not include standard header files.

Download at WoweBook.com

The build targets are as follows:

• lib builds the DSO libdoom_jni.so.

• jni creates the JNI headers for doom.jni.Natives.java and places them in the include folder.

• deploy-lib deploys the DSO to the device using the SDK adb tool.

• clean cleans up the object files.

Listing 7-25. Makefile for the Doom Engine DSO #############################################

# Android Makefile for Doom #############################################

MACROS = -DNORMALUNIX -DLINUX -DHAVE_NET -DUSE_SDL_NET -DHAVE_CONFIG_H FLAGS = -O2 -ffast-math -Wall -nostdinc

MAIN_OBJS

= \

am map.o

m cheat.o

p lights.o

p_user.o

sounds.o \

hu lib.o

md5.o

p map.o

r bsp.o

s sound.o \

d deh.o

hu_stuff.o

m menu.o

p maputl,

.o r data.o

st lib.o \

d items.o

i main.o

m misc.o

p mobj.o

r demo.o

st_stuff.o \

d main.o

info.o

p plats.o

r draw.o

tables.o \

doomdef.o

i sound.o

m random.o

p pspr.o

r filter.

o version.o \

doomstat.o

i system.o

p ceilng.o

p saveg.o r fps.o

v video.o \

p checksum.o p setup.o

r main.o

wi stuff.o

\

dstrings.o

p doors.o

p sight.o

r patch.o

w memcache.

o \

f finale.o

jni doom.o

p enemy.o

p spec.o

r plane.o

w mmap.o \

f wipe.o

lprintf.o

p floor.o

p switch,

.o r segs.o

w wad.o \

g game.o

m argv.o

p genlin.o

p_telept

.o r sky.o

z bmalloc.o \

m bbox.o

p_inter.o

p tick.o

r things.o

z zone.o \

d client.o

i video.o i

network.o d server.o

LIB = ../bin/libdoom_jni.so DYN = ../bin/doom-cli all: lib jni:

@echo "Creating JNI C headers..."

javah -jni -classpath ../../bin -d include doom.jni.Natives

$(LINKER) -shared $(LFLAGS) $(LIB_PATHS) $(LIBS) -o $(LIB) \

$(CC) -fpic -c $(FLAGS) $(MACROS) $(INCLUDES) $<

# Deploy lib deploy-lib: lib adb push $(LIB) /data/data/org.doom/files clean:

0 0

Post a comment

  • Receive news updates via email from this site