From 349814e9d912c4f372b8fbdfb10b03749911021f Mon Sep 17 00:00:00 2001 From: Matthew Booth Date: Fri, 3 Jul 2009 11:52:50 +0100 Subject: Make it possible to build in a separate directory This patch allows you to do: mkdir build cd build ../configure ... make This will output all generated files to the build directory. Given that autogen automatically runs configure, you can also do: BUILDDIR=./build ./autogen.sh which will do the right thing. Also: * Fix a dependency bug which means that guestfs_protocol.h isn't automatically rebuilt. * Re-running autogen.sh with no arguments won't blow away your previous configure arguments. --- java/Makefile.am | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'java') diff --git a/java/Makefile.am b/java/Makefile.am index ea90a482..b6827473 100644 --- a/java/Makefile.am +++ b/java/Makefile.am @@ -15,18 +15,18 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -CPTH = com/redhat/et/libguestfs +java_prefix = com/redhat/et/libguestfs java_sources = \ - $(CPTH)/LibGuestFSException.java \ - $(CPTH)/IntBool.java \ - $(CPTH)/PV.java \ - $(CPTH)/VG.java \ - $(CPTH)/LV.java \ - $(CPTH)/Stat.java \ - $(CPTH)/StatVFS.java \ - $(CPTH)/Dirent.java \ - $(CPTH)/GuestFS.java + $(java_prefix)/LibGuestFSException.java \ + $(java_prefix)/IntBool.java \ + $(java_prefix)/PV.java \ + $(java_prefix)/VG.java \ + $(java_prefix)/LV.java \ + $(java_prefix)/Stat.java \ + $(java_prefix)/StatVFS.java \ + $(java_prefix)/Dirent.java \ + $(java_prefix)/GuestFS.java java_tests = \ Bindtests.java \ @@ -50,7 +50,7 @@ libguestfs_jardir = $(JAR_INSTALL_DIR) libguestfs_jar_DATA = libguestfs-${VERSION}.jar libguestfs_jar_class_files = $(java_sources:.java=.class) $(libguestfs_jar_class_files): %.class: %.java - $(JAVAC) $(JAVAC_FLAGS) -classpath $(CPTH) $(java_sources) + $(JAVAC) $(JAVAC_FLAGS) -d @builddir@ -classpath @srcdir@:@builddir@ -sourcepath @srcdir@:@builddir@ $< libguestfs-${VERSION}.jar: $(libguestfs_jar_class_files) $(JAR) cf $@ $^ @@ -64,12 +64,12 @@ libguestfs_jni_la_SOURCES = \ libguestfs_jni_la_LIBADD = $(top_builddir)/src/libguestfs.la libguestfs_jni_la_LDFLAGS = -version-info $(JNI_VERSION_INFO) -libguestfs_jni_la_CFLAGS = -Wall -I$(top_builddir)/src $(JNI_CFLAGS) +libguestfs_jni_la_CFLAGS = -Wall -I$(top_srcdir)/src -I$(top_builddir)/src $(JNI_CFLAGS) BUILT_SOURCES = com_redhat_et_libguestfs_GuestFS.h -com_redhat_et_libguestfs_GuestFS.h: $(CPTH)/GuestFS.class - $(JAVAH) -classpath .:$(CPTH) com.redhat.et.libguestfs.GuestFS +com_redhat_et_libguestfs_GuestFS.h: $(java_prefix)/GuestFS.class + $(JAVAH) -classpath @srcdir@:@builddir@ com.redhat.et.libguestfs.GuestFS # Documentation. -- cgit