Makefile.am 2.47 KB
Newer Older
1 2 3 4 5 6
#######################################################################
# VLC Java Bindings
#######################################################################

if BUILD_JAVA

7
OBJECTS = org/videolan/jvlc/Playlist.class org/videolan/jvlc/AudioIntf.class org/videolan/jvlc/InputIntf.class org/videolan/jvlc/PlaylistIntf.class org/videolan/jvlc/VideoIntf.class org/videolan/jvlc/JLibVLC.class org/videolan/jvlc/JVLC.class org/videolan/jvlc/JVLCCanvas.class org/videolan/jvlc/JVLCPanel.class org/videolan/jvlc/VLMIntf.class org/videolan/jvlc/GenericVideoWidget.class
8 9

# Include some JAVA stuff
10
PROCESSOR_FAMILY = `uname -m | sed -e 's/^i.86/i386/' | sed -e 's/^x86_64/amd64/'`
11 12 13 14 15
if HAVE_WIN32
JINCLUDES = -I${JAVA_HOME}/include -I${JAVA_HOME}/include/win32
LIBJINCLUDES = -L${JAVA_HOME}/lib -ljawt
JCC = javac
JCH = javah
16
JCC_FLAGS = 
17 18
#CXX = g++ -Wall -mno-cygwin -g
#LDFLAGS = -mno-cygwin `vlc-config --libs external pic` -Wl,--kill-at
19
JAVACXXFLAGS = `top_builddir=../.. ../../vlc-config --cflags pic` -I../../ -I ../../include $(JINCLUDES)
20 21
JAVALDFLAGS = -mno-cygwin -L../../src -lvlc `top_builddir=../.. ../../vlc-config --libs builtin vlc pic` -Wl,--kill-at
else
22 23
JINCLUDES = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
LIBJINCLUDES = -L$(JAVA_HOME)/jre/lib/$(PROCESSOR_FAMILY) -ljawt
24
JCC = gcj -g
25
JCH = gcjh -jni
26
SWT_PATH = /usr/share/java
27
# Compile flags
28
JCC_FLAGS = -C
29
JAVACXXFLAGS = `top_builddir=../.. ../../vlc-config --cflags pic` -I../../ -I ../../include $(JINCLUDES)
Filippo Carone's avatar
Filippo Carone committed
30
JAVALDFLAGS = -L../../src -lvlc `top_builddir=../.. ../../vlc-config --libs builtin vlc pic`
31
endif
32 33

# Build targets
Filippo Carone's avatar
Filippo Carone committed
34
all: libjvlc.so VlcClient VLCExample
35

36 37
if HAVE_WIN32
libjvlc.so: vlc-libvlc-jni.o vlc-graphics-jni.o
38
	$(CXX) -shared vlc-libvlc-jni.o vlc-graphics-jni.o $(LIBJINCLUDES) $(LDFLAGS) $(JAVALDFLAGS) -o jvlc.dll
39
else
40 41
libjvlc.so: vlc-libvlc-jni.o vlc-graphics-jni.o
	$(CXX) -shared vlc-libvlc-jni.o vlc-graphics-jni.o $(LIBJINCLUDES) $(LDFLAGS) $(JAVALDFLAGS) -o libjvlc.so
42
endif
43 44

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

47 48
vlc-libvlc-jni.o: VlcClient
	$(CXX) -c vlc-libvlc-jni.cc $(CXXFLAGS) $(JAVACXXFLAGS)
49 50

VlcClient: $(OBJECTS)
51
	$(JCC) $(JCC_FLAGS) VlcClient.java
52

Filippo Carone's avatar
Filippo Carone committed
53
VLCExample: $(OBJECTS)
54
	$(JCC) $(JCC_FLAGS) VLCExample.java
Filippo Carone's avatar
Filippo Carone committed
55

56 57 58 59 60
if HAVE_WIN32
%.class: %.java
	$(JCC) $(JCC_FLAGS) $?
	$(JCH) org.videolan.jvlc.$(*F)
else
61
%.class: %.java
62
	$(JCC) $(JCC_FLAGS) $?
63
	$(JCH) org/videolan/jvlc/$(*F)
64
endif
65 66

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

69
endif