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

if BUILD_JAVA

7
OBJECTS = org/videolan/jvlc/VLCException.class 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
if HAVE_WIN32
JINCLUDES = -I${JAVA_HOME}/include -I${JAVA_HOME}/include/win32
LIBJINCLUDES = -L${JAVA_HOME}/lib -ljawt
14
#JAVAC = javac
15
JCH = javah
16 17
#CXX = g++ -Wall -mno-cygwin -g
#LDFLAGS = -mno-cygwin `vlc-config --libs external pic` -Wl,--kill-at
18
JAVACXXFLAGS = `top_builddir=../.. ../../vlc-config --cflags pic` -I../../ -I ../../include $(JINCLUDES)
19 20
JAVALDFLAGS = -mno-cygwin -L../../src -lvlc `top_builddir=../.. ../../vlc-config --libs builtin vlc pic` -Wl,--kill-at
else
21 22
JINCLUDES = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
LIBJINCLUDES = -L$(JAVA_HOME)/jre/lib/$(PROCESSOR_FAMILY) -ljawt
23
#JAVAC = gcj -Wall -g -C 
24
JCH = gcjh -jni
25
SWT_PATH = /usr/share/java
26
# Compile flags
27
JAVACXXFLAGS = `top_builddir=../.. ../../vlc-config --cflags pic` -I../../ -I ../../include $(JINCLUDES)
Filippo Carone's avatar
Filippo Carone committed
28
JAVALDFLAGS = -L../../src -lvlc `top_builddir=../.. ../../vlc-config --libs builtin vlc pic`
29
endif
30 31

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

34 35
if HAVE_WIN32
libjvlc.so: vlc-libvlc-jni.o vlc-graphics-jni.o
36
	$(CXX) -shared vlc-libvlc-jni.o vlc-graphics-jni.o $(LIBJINCLUDES) $(LDFLAGS) $(JAVALDFLAGS) -o jvlc.dll
37
else
38 39
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
40
endif
41 42

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

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

VlcClient: $(OBJECTS)
49
	$(JAVAC) VlcClient.java
50

Filippo Carone's avatar
Filippo Carone committed
51
VLCExample: $(OBJECTS)
52
	$(JAVAC) VLCExample.java
Filippo Carone's avatar
Filippo Carone committed
53

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

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

67
endif