Makefile.am 4.48 KB
Newer Older
1 2 3 4
#######################################################################
# VLC Java Bindings
#######################################################################

5
#SUBDIRS= src
6

7
DIST_SUBDIRS = src
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

EXTRA_DIST= \
	    FAQ \
	    TODO \
	    README \
	    THANKS \
	    javadoc.xml \
	    VlcClient.java \
	    VLCExample.java


EXTRA_DIST+= \
	org/videolan/jvlc/AudioIntf.java \
	org/videolan/jvlc/Audio.java \
	org/videolan/jvlc/GenericVideoWidget.java \
	org/videolan/jvlc/InputIntf.java \
	org/videolan/jvlc/Input.java \
	org/videolan/jvlc/JLibVLC.java \
	org/videolan/jvlc/JVLCCanvas.java \
	org/videolan/jvlc/JVLC.java \
	org/videolan/jvlc/JVLCPanel.java \
	org/videolan/jvlc/PlaylistIntf.java \
	org/videolan/jvlc/Playlist.java \
	org/videolan/jvlc/VideoIntf.java \
	org/videolan/jvlc/Video.java \
	org/videolan/jvlc/VLCException.java \
	org/videolan/jvlc/VLMIntf.java \
	org/videolan/jvlc/VLM.java 
36

37 38
if BUILD_JAVA

39 40
OBJECTS = org/videolan/jvlc/VLCException.class org/videolan/jvlc/Playlist.class org/videolan/jvlc/AudioIntf.class org/videolan/jvlc/Audio.class org/videolan/jvlc/InputIntf.class org/videolan/jvlc/Input.class org/videolan/jvlc/PlaylistIntf.class org/videolan/jvlc/VideoIntf.class org/videolan/jvlc/Video.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/VLM.class  org/videolan/jvlc/GenericVideoWidget.class

41
OBJECTS_HEADER = src/../includes/VLCException.h src/../includes/Playlist.h src/../includes/AudioIntf.h src/../includes/Audio.h src/../includes/InputIntf.h src/../includes/Input.h src/../includes/PlaylistIntf.h src/../includes/VideoIntf.h src/../includes/Video.h src/../includes/JLibVLC.h src/../includes/JVLC.h src/../includes/JVLCCanvas.h src/../includes/JVLCPanel.h src/../includes/VLMIntf.h src/../includes/VLM.h  src/../includes/GenericVideoWidget.h
42

43
COBJECTS = src/utils.o src/video-jni.o src/audio-jni.o src/input-jni.o src/playlist-jni.o src/vlm-jni.o src/core-jni.o src/graphics-jni.o
44

45
PROCESSOR_FAMILY = `uname -m | sed -e 's/^i.86/i386/' | sed -e 's/^x86_64/amd64/'`
46

47 48 49 50 51
if HAVE_WIN32
JINCLUDES = -I${JAVA_HOME}/include -I${JAVA_HOME}/include/win32
LIBJINCLUDES = -L${JAVA_HOME}/lib -ljawt
JCH = javah
else
52 53
JINCLUDES = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
LIBJINCLUDES = -L$(JAVA_HOME)/jre/lib/$(PROCESSOR_FAMILY) -ljawt
54
JCH = gcjh -jni
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
endif


if USE_LIBTOOL
jvlcdir = $(libdir)
jvlc_LTLIBRARIES = libjvlc.la
libjvlc_la_SOURCES = \
	src/audio-jni.cc \
	src/core-jni.cc \
	src/graphics-jni.cc \
	src/input-jni.cc \
	src/playlist-jni.cc \
	src/utils.cc \
	src/utils.h \
	src/video-jni.cc \
	src/vlm-jni.cc

libjvlc_la_LIBADD = ../../src/libvlc-control.la $(LIBJINCLUDES)

if HAVE_WIN32
libjvlc_la_JAVACXXFLAGS = `top_builddir=../.. ../../vlc-config --cflags pic` -I../../ -I ../../include $(JINCLUDES)
libjvlc_la_JAVALDFLAGS = -mno-cygwin -L../../src -L../../src/.libs -lvlc-control `top_builddir=../.. ../../vlc-config --libs builtin vlc pic external` -Wl,--kill-at
else
libjvlc_la_JAVACXXFLAGS = `top_builddir=../.. ../../vlc-config --cflags pic` -I../../ -I ../../include $(JINCLUDES)
libjvlc_la_JAVALDFLAGS = -L../../src -L../../src/.libs  -lvlc-control `top_builddir=../.. ../../vlc-config --libs builtin vlc pic external`
endif

else

if HAVE_WIN32
JAVACXXFLAGS = `top_builddir=../.. ../../vlc-config --cflags pic` -I../../ -I ../../include $(JINCLUDES)
JAVALDFLAGS = -mno-cygwin -L../../src -L../../src/.libs -lvlc-control `top_builddir=../.. ../../vlc-config --libs builtin vlc pic external` -Wl,--kill-at
else
88
JAVACXXFLAGS = `top_builddir=../.. ../../vlc-config --cflags pic` -I../../ -I ../../include $(JINCLUDES)
89
JAVALDFLAGS = -L../../src -L../../src/.libs  -lvlc-control `top_builddir=../.. ../../vlc-config --libs builtin vlc pic external`
90
endif
91

92 93
endif

94 95
export JINCLUDES

96
# Build targets
97
all: VlcClient VLCExample
98

99
if HAVE_WIN32
100 101 102
libjvlc.so: $(OBJECTS)
	$(MAKE) -C src
	$(CXX) -shared $(COBJECTS) $(LIBJINCLUDES) $(LDFLAGS) $(JAVALDFLAGS) -o jvlc.dll
103
else
104 105 106
libjvlc.so: $(OBJECTS) 	
	$(MAKE) -C src
	$(CXX) -shared $(COBJECTS) $(LIBJINCLUDES) $(LDFLAGS) $(JAVALDFLAGS) -o libjvlc.so
107
endif
108 109

VlcClient: $(OBJECTS)
110
	$(JAVAC) VlcClient.java
111

Filippo Carone's avatar
Filippo Carone committed
112
VLCExample: $(OBJECTS)
113
	$(JAVAC) VLCExample.java
Filippo Carone's avatar
Filippo Carone committed
114

115 116 117 118 119 120
if HAVE_WIN32
%.class: %.java 
	$(JAVAC) $? 
	$(JCH) org.videolan.jvlc.$(*F)
else
%.class: %.java
121
	$(JAVAC) $?
122
	$(JCH) $(@D)/$(*F) -o includes/$(*F).h
123
endif
124

125 126
$(OBJECTS_HEADER): $(OBJECTS)

127
clean-local:
128
	rm -f *.class *~ org/videolan/jvlc/*.class org_videolan*.h includes/*.h src/*.o *.so *.o *.dll
129

130
endif