Makefile.am 2.08 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
#######################################################################
# VLC Java Bindings
#######################################################################

if BUILD_JAVA

OBJECTS = org/videolan/jvlc/JVLCNoSuchVariableNameException.class org/videolan/jvlc/JVLCBoolVariable.class org/videolan/jvlc/JVLCIntVariable.class org/videolan/jvlc/JVLCTimeVariable.class org/videolan/jvlc/JVLCVarValue.class org/videolan/jvlc/JVLCVariable.class org/videolan/jvlc/JVLCFloatVariable.class org/videolan/jvlc/JVLCStringVariable.class org/videolan/jvlc/JVLCVarVariable.class org/videolan/jvlc/JVLC.class org/videolan/jvlc/JVLCCanvas.class

JNIHEADERS = org/videolan/jvlc/JVLCNoSuchVariableNameException.h org_videolan_jvlc_JVLCBoolVariable.h org_videolan_jvlc_JVLCFloatVariable.h org_videolan_jvlc_JVLC.h org_videolan_jvlc_JVLCIntVariable.h org_videolan_jvlc_JVLCStringVariable.h org_videolan_jvlc_JVLCTimeVariable.h org_videolan_jvlc_JVLCVariable.h org_videolan_jvlc_JVLCVarValue.h org_videolan_jvlc_JVLCVarVariable.h org_videolan_jvlc_JVLCCanvas.h

# Include some JAVA stuff
JINCLUDES = -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux
LIBJINCLUDES = -L${JAVA_HOME}/jre/lib/i386 -ljawt

# Binaries
JCC = gcj -g
JCH = gcjh -jni

# Compile flags
CXXFLAGS += `top_builddir=../.. ../../vlc-config --cflags` -I../../ -I ../../include ${JINCLUDES}
LDFLAGS += -L../../lib -lvlc_pic -fPIC  `top_builddir=../.. ../../vlc-config --libs builtin pic`

# Build targets
all: libjvlc.so VlcClient

# FIXME: -ldbus-1 and -lhal are UGLY
# Problem is vlc-config --libs builtin does not output what is needed to build
# vlc. We need to clean up vlc-config first
libjvlc.so: vlc-glue-jni.o vlc-graphics-jni.o
	$(CXX) -ldbus-1 -lhal -shared vlc-glue-jni.o vlc-graphics-jni.o $(LIBJINCLUDES) ${LDFLAGS} -o libjvlc.so

vlc-graphics-jni.o: VlcClient
	$(CXX) -c vlc-graphics-jni.cc $(CXXFLAGS)

vlc-glue-jni.o: VlcClient
	$(CXX) -c vlc-glue-jni.cc $(CXXFLAGS)

VlcClient: $(OBJECTS)
	$(JCC) -C VlcClient.java

%.class: %.java
	$(JCC) -C $?
	$(JCH) org/videolan/jvlc/$(*F)

clean:
	rm -f *.class *~ org/videolan/jvlc/*.class org_videolan*.h *.so *.o

endif