LIB_NAME = JunGL
TARGET = lib$(LIB_NAME).jnilib

JAVAVM_HEADERS = /System/Library/Frameworks/JavaVM.framework/Headers
OPENGL_HEADERS = /System/Library/Frameworks/AGL.framework/Headers
INCS = -I$(JAVAVM_HEADERS) -I$(OPENGL_HEADERS)
LIBS = -framework JavaVM -framework OpenGL -framework Cocoa

CC = cc -Wno-pointer-sign
ARCHS = -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386
CFLAGS = $(ARCHS) -Wall -O -dynamic $(INCS) -Iinclude
LD = $(CC) $(ARCHS) -bundle
OBJS = procedures-gl.o procedures-glu.o glj-mac.o

all:	$(TARGET)

include/GL:
	rm -fr include
	mkdir include
	ln -s $(OPENGL_HEADERS) include/GL

$(TARGET):	$(OBJS)
	$(LD) -o $(TARGET) $(OBJS) $(LIBS)

clean:
	rm -f *.o *.jnilib*
	rm -fr include

procedures-gl.o:	jp_co_sra_gl4jun_GLjInterface.h include/GL
procedures-glu.o:	jp_co_sra_gl4jun_GLjInterface.h include/GL
glj-mac.o:	jp_co_sra_gl4jun_GLjInterface.h rendering_mode.h version.h
