1 # SPDX-License-Identifier: LGPL-2.1-only
4 jarfile = liblttng-ust-java.jar
5 jardir = $(datadir)/java
6 pkgpath = org/lttng/ust
8 dist_noinst_JAVA = $(pkgpath)/LTTngUst.java
10 BUILT_SOURCES = org_lttng_ust_LTTngUst.h
12 AM_CPPFLAGS += -I$(builddir) -I$(srcdir) $(JNI_CPPFLAGS)
13 lib_LTLIBRARIES = liblttng-ust-java.la
14 liblttng_ust_java_la_SOURCES = LTTngUst.c lttng_ust_java.h
15 nodist_liblttng_ust_java_la_SOURCES = org_lttng_ust_LTTngUst.h
17 liblttng_ust_java_la_LIBADD = -lc \
18 $(top_builddir)/src/liblttng-ust/liblttng-ust.la
20 $(jarfile): classnoinst.stamp
21 $(JAR) cf $(JARFLAGS) $@ $(pkgpath)/*.class
24 # If we don't have javah, assume we are running openjdk >= 10 and use javac
25 # to generate the jni header file.
28 org_lttng_ust_LTTngUst.h: $(jarfile)
30 org_lttng_ust_LTTngUst.h: jni-header.stamp
32 jni-header.stamp: $(dist_noinst_JAVA)
33 $(JAVAH) -classpath $(srcdir) $(JAVAHFLAGS) org.lttng.ust.LTTngUst && \
34 echo "JNI header generated" > jni-header.stamp
37 all-local: org_lttng_ust_LTTngUst.h
41 CLEANFILES = $(jarfile) $(pkgpath)/*.class jni-header.stamp org_lttng_ust_LTTngUst.h