Game Development Reference
In-Depth Information
# Compiler and loader
CC = agcc
LD = ald
# Flags
CFLAGS = -Werror
MACROS =
INCLUDES =
# Static objects
OBJ = main.o
# Shared library ob
LIBOBJ = lib.o
# Test shared lib
TESTLIBOBJ = testlib.o
# Default make target
all: testlib $(OBJ)
@echo
@echo "Linking..."
$(LD) -static -o a.out $(OBJ)
# Build lib
lib: $(LIBOBJ)
@echo
@echo "Linking Shared library..."
$(LD) -shared -o libch02.so $(LIBOBJ)
@echo
@echo "Copying Shared library to assets folder"
cp libch02.so ../assets
# Build test program for lib
testlib: lib $(TESTLIBOBJ)
@echo
@echo "Linking Test for Shared library"
$(LD) -o testlib $(TESTLIBOBJ) -L. -lch02
# Build JNI Headers (for lib)
jni:
@echo "Creating JNI C headers..."
javah -jni -classpath ../bin -d include jni.Natives
# Compile
.c.o:
@echo
@echo "Compiling $<..."
$(CC) -c $(FLAGS) $(MACROS) $(INCLUDES) $<