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 include $(top_srcdir)/subdir-rules.mk
20 # Old RHEL 5 autoconf doesn't have builddir.
21 builddir ?= $(top_builddir)/java
23 # XXX: Need to fix generator.ml dependencies
25 # Files generated by generator.ml:
27 # All files listed in Makefile.inc
28 # com_redhat_et_libguestfs_GuestFS.c
31 java_prefix = com/redhat/et/libguestfs
33 # Pull in automatically generated built sources
34 include $(srcdir)/Makefile.inc
37 $(java_built_sources) \
38 com/redhat/et/libguestfs/LibGuestFSException.java
42 t/GuestFS005Load.java \
43 t/GuestFS010Basic.java
52 CLEANFILES = doc-stamp $(builddir)/com/redhat/et/libguestfs/*.class com_redhat_et_libguestfs_GuestFS.h *.class *.jar api/com/redhat/et/libguestfs/*.html api/*
58 libguestfs_jardir = $(JAR_INSTALL_DIR)
59 libguestfs_jar_DATA = libguestfs-${VERSION}.jar
60 libguestfs_jar_class_files = $(java_sources:.java=.class)
61 $(libguestfs_jar_class_files): %.class: %.java
62 $(JAVAC) $(JAVAC_FLAGS) -d $(builddir) -classpath @srcdir@:$(builddir) -sourcepath @srcdir@:$(builddir) $<
64 libguestfs-${VERSION}.jar: $(libguestfs_jar_class_files)
69 lib_LTLIBRARIES = libguestfs_jni.la
70 libguestfs_jni_la_SOURCES = \
71 com_redhat_et_libguestfs_GuestFS.h \
72 com_redhat_et_libguestfs_GuestFS.c
74 libguestfs_jni_la_LIBADD = $(top_builddir)/src/libguestfs.la
75 libguestfs_jni_la_LDFLAGS = -version-info $(JNI_VERSION_INFO)
76 libguestfs_jni_la_CFLAGS = -Wall -I$(top_srcdir)/src -I$(top_builddir)/src $(JNI_CFLAGS)
78 BUILT_SOURCES = com_redhat_et_libguestfs_GuestFS.h
80 com_redhat_et_libguestfs_GuestFS.h: $(java_prefix)/GuestFS.class
81 $(JAVAH) -classpath @srcdir@:$(builddir) com.redhat.et.libguestfs.GuestFS
85 noinst_SCRIPTS = doc-stamp
87 doc-stamp: $(java_sources)
88 $(JAVADOC) $(JAVADOC_FLAGS) -d api \
89 -sourcepath $(srcdir) \
90 -windowtitle "libguestfs java $(VERSION) API reference" \
91 -doctitle "libguestfs java $(VERSION) API reference" \
92 com.redhat.et.libguestfs
96 mkdir -p $(DESTDIR)$(datadir)/javadoc/$(PACKAGE_NAME)-java-$(PACKAGE_VERSION)
97 cp -a api/* $(DESTDIR)$(datadir)/javadoc/$(PACKAGE_NAME)-java-$(PACKAGE_VERSION)
99 # Tests (not comprehensive).
101 TESTS = run-bindtests run-java-tests
102 TESTS_ENVIRONMENT = \
104 CLASSPATH=.:t:libguestfs-$(VERSION).jar \
105 LIBGUESTFS_PATH=$(top_builddir)/appliance \
106 TMPDIR=$(top_builddir)
108 noinst_DATA = Bindtests.class $(java_tests:.java=.class)
111 $(JAVAC) $(JAVAC_FLAGS) -classpath libguestfs-$(VERSION).jar $<
113 Bindtests.class: Bindtests.java
114 $(JAVAC) $(JAVAC_FLAGS) -classpath libguestfs-$(VERSION).jar $<
118 # Tell version 3.79 and up of GNU make to not build goals in this
119 # directory in parallel.