1 # libguestfs Java bindings
2 # Copyright (C) 2009 Red Hat Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 # Old RHEL 5 autoconf doesn't have builddir.
19 builddir ?= $(top_builddir)/java
21 java_prefix = com/redhat/et/libguestfs
23 # Pull in automatically generated built sources
24 include $(srcdir)/Makefile.inc
27 $(java_built_sources) \
28 com/redhat/et/libguestfs/LibGuestFSException.java
32 t/GuestFS005Load.java \
33 t/GuestFS010Launch.java \
34 t/GuestFS050LVCreate.java
43 CLEANFILES = doc-stamp $(builddir)/com/redhat/et/libguestfs/*.class com_redhat_et_libguestfs_GuestFS.h *.class *.jar api/com/redhat/et/libguestfs/*.html api/*
49 libguestfs_jardir = $(JAR_INSTALL_DIR)
50 libguestfs_jar_DATA = libguestfs-${VERSION}.jar
51 libguestfs_jar_class_files = $(java_sources:.java=.class)
52 $(libguestfs_jar_class_files): %.class: %.java
53 $(JAVAC) $(JAVAC_FLAGS) -d $(builddir) -classpath @srcdir@:$(builddir) -sourcepath @srcdir@:$(builddir) $<
55 libguestfs-${VERSION}.jar: $(libguestfs_jar_class_files)
60 lib_LTLIBRARIES = libguestfs_jni.la
61 libguestfs_jni_la_SOURCES = \
62 com_redhat_et_libguestfs_GuestFS.h \
63 com_redhat_et_libguestfs_GuestFS.c
65 libguestfs_jni_la_LIBADD = $(top_builddir)/src/libguestfs.la
66 libguestfs_jni_la_LDFLAGS = -version-info $(JNI_VERSION_INFO)
67 libguestfs_jni_la_CFLAGS = -Wall -I$(top_srcdir)/src -I$(top_builddir)/src $(JNI_CFLAGS)
69 BUILT_SOURCES = com_redhat_et_libguestfs_GuestFS.h
71 com_redhat_et_libguestfs_GuestFS.h: $(java_prefix)/GuestFS.class
72 $(JAVAH) -classpath @srcdir@:$(builddir) com.redhat.et.libguestfs.GuestFS
76 noinst_SCRIPTS = doc-stamp
78 doc-stamp: $(java_sources)
79 $(JAVADOC) $(JAVADOC_FLAGS) -d api \
80 -sourcepath $(srcdir) \
81 -windowtitle "libguestfs java $(VERSION) API reference" \
82 -doctitle "libguestfs java $(VERSION) API reference" \
83 com.redhat.et.libguestfs
87 mkdir -p $(DESTDIR)$(datadir)/javadoc/$(PACKAGE_NAME)-java-$(PACKAGE_VERSION)
88 cp -a api/* $(DESTDIR)$(datadir)/javadoc/$(PACKAGE_NAME)-java-$(PACKAGE_VERSION)
90 # Tests (not comprehensive).
92 TESTS = run-bindtests run-java-tests
95 CLASSPATH=.:t:libguestfs-$(VERSION).jar \
96 LIBGUESTFS_PATH=$(top_builddir)/appliance
98 noinst_DATA = Bindtests.class $(java_tests:.java=.class)
101 $(JAVAC) $(JAVAC_FLAGS) -classpath libguestfs-$(VERSION).jar $<
103 Bindtests.class: Bindtests.java
104 $(JAVAC) $(JAVAC_FLAGS) -classpath libguestfs-$(VERSION).jar $<
108 # Tell version 3.79 and up of GNU make to not build goals in this
109 # directory in parallel.