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 \
44 t/GuestFS080OptArgs.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 = \
78 $(WARN_CFLAGS) $(WERROR_CFLAGS) \
79 -I$(top_srcdir)/src -I$(top_builddir)/src \
82 BUILT_SOURCES = com_redhat_et_libguestfs_GuestFS.h
84 com_redhat_et_libguestfs_GuestFS.h: $(java_prefix)/GuestFS.class
85 $(JAVAH) -classpath @srcdir@:$(builddir) com.redhat.et.libguestfs.GuestFS
89 noinst_SCRIPTS = doc-stamp
91 doc-stamp: $(java_sources)
92 $(JAVADOC) $(JAVADOC_FLAGS) -d api \
93 -sourcepath $(srcdir) \
94 -windowtitle "libguestfs java $(VERSION) API reference" \
95 -doctitle "libguestfs java $(VERSION) API reference" \
96 com.redhat.et.libguestfs
100 mkdir -p $(DESTDIR)$(datadir)/javadoc/$(PACKAGE_NAME)-java-$(PACKAGE_VERSION)
101 cp -a api/* $(DESTDIR)$(datadir)/javadoc/$(PACKAGE_NAME)-java-$(PACKAGE_VERSION)
103 # Tests (not comprehensive).
105 TESTS = run-bindtests run-java-tests
106 TESTS_ENVIRONMENT = \
108 CLASSPATH=.:t:libguestfs-$(VERSION).jar \
109 LIBGUESTFS_PATH=$(top_builddir)/appliance \
110 TMPDIR=$(top_builddir)
112 noinst_DATA = Bindtests.class $(java_tests:.java=.class)
115 $(JAVAC) $(JAVAC_FLAGS) -classpath libguestfs-$(VERSION).jar $<
117 Bindtests.class: Bindtests.java
118 $(JAVAC) $(JAVAC_FLAGS) -classpath libguestfs-$(VERSION).jar $<
122 # Tell version 3.79 and up of GNU make to not build goals in this
123 # directory in parallel.