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/GuestFS010Launch.java \
44 t/GuestFS050LVCreate.java
53 CLEANFILES = doc-stamp $(builddir)/com/redhat/et/libguestfs/*.class com_redhat_et_libguestfs_GuestFS.h *.class *.jar api/com/redhat/et/libguestfs/*.html api/*
59 libguestfs_jardir = $(JAR_INSTALL_DIR)
60 libguestfs_jar_DATA = libguestfs-${VERSION}.jar
61 libguestfs_jar_class_files = $(java_sources:.java=.class)
62 $(libguestfs_jar_class_files): %.class: %.java
63 $(JAVAC) $(JAVAC_FLAGS) -d $(builddir) -classpath @srcdir@:$(builddir) -sourcepath @srcdir@:$(builddir) $<
65 libguestfs-${VERSION}.jar: $(libguestfs_jar_class_files)
70 lib_LTLIBRARIES = libguestfs_jni.la
71 libguestfs_jni_la_SOURCES = \
72 com_redhat_et_libguestfs_GuestFS.h \
73 com_redhat_et_libguestfs_GuestFS.c
75 libguestfs_jni_la_LIBADD = $(top_builddir)/src/libguestfs.la
76 libguestfs_jni_la_LDFLAGS = -version-info $(JNI_VERSION_INFO)
77 libguestfs_jni_la_CFLAGS = -Wall -I$(top_srcdir)/src -I$(top_builddir)/src $(JNI_CFLAGS)
79 BUILT_SOURCES = com_redhat_et_libguestfs_GuestFS.h
81 com_redhat_et_libguestfs_GuestFS.h: $(java_prefix)/GuestFS.class
82 $(JAVAH) -classpath @srcdir@:$(builddir) com.redhat.et.libguestfs.GuestFS
86 noinst_SCRIPTS = doc-stamp
88 doc-stamp: $(java_sources)
89 $(JAVADOC) $(JAVADOC_FLAGS) -d api \
90 -sourcepath $(srcdir) \
91 -windowtitle "libguestfs java $(VERSION) API reference" \
92 -doctitle "libguestfs java $(VERSION) API reference" \
93 com.redhat.et.libguestfs
97 mkdir -p $(DESTDIR)$(datadir)/javadoc/$(PACKAGE_NAME)-java-$(PACKAGE_VERSION)
98 cp -a api/* $(DESTDIR)$(datadir)/javadoc/$(PACKAGE_NAME)-java-$(PACKAGE_VERSION)
100 # Tests (not comprehensive).
102 TESTS = run-bindtests run-java-tests
103 TESTS_ENVIRONMENT = \
105 CLASSPATH=.:t:libguestfs-$(VERSION).jar \
106 LIBGUESTFS_PATH=$(top_builddir)/appliance
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.