Fix: Don't override user variables within the build system
[lttng-ust.git] / liblttng-ust-java / Makefile.am
index fb25cb7bde49062698126cfe54c0ad76724787e5..399b62cac1d06cb322d3b549c9998523d72027fe 100644 (file)
@@ -1,21 +1,28 @@
-if BUILD_JNI_INTERFACE
+JAVAROOT = .
+jarfile = liblttng-ust-java.jar
+jardir = $(datadir)/java
+pkgpath = org/lttng/ust
 
-AM_CPPFLAGS = -I$(top_srcdir)/include
+dist_noinst_JAVA = $(pkgpath)/LTTngUst.java
+jar_DATA = $(jarfile)
+BUILT_SOURCES = org_lttng_ust_LTTngUst.h
 
+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(JNI_CPPFLAGS)
 lib_LTLIBRARIES = liblttng-ust-java.la
-liblttng_ust_java_la_SOURCES = UST.c UST.h ust_java.h
-dist_noinst_DATA = UST.java
+liblttng_ust_java_la_SOURCES = LTTngUst.c lttng_ust_java.h
+nodist_liblttng_ust_java_la_SOURCES = org_lttng_ust_LTTngUst.h
+
 liblttng_ust_java_la_LIBADD = -lc -L$(top_builddir)/liblttng-ust/.libs -llttng-ust
 
-all: UST.class UST.h
+$(jarfile): classnoinst.stamp
+       $(JAR) cf $(JARFLAGS) $@ $(pkgpath)/*.class
 
-clean-local:
-       rm -rf UST.h UST.class
+org_lttng_ust_LTTngUst.h: jni-header.stamp
 
-UST.class: UST.java
-       javac -d "$(builddir)" "$(srcdir)/UST.java"
+jni-header.stamp: $(dist_noinst_JAVA)
+       $(JAVAH) -classpath $(srcdir) $(JAVAHFLAGS) org.lttng.ust.LTTngUst && \
+       echo "JNI header generated" > jni-header.stamp
 
-UST.h: UST.class
-       javah -jni UST
+all-local: org_lttng_ust_LTTngUst.h
 
-endif
+CLEANFILES = $(jarfile) $(pkgpath)/*.class jni-header.stamp org_lttng_ust_LTTngUst.h
This page took 0.023737 seconds and 4 git commands to generate.