fix: 'make dist' without javah
[lttng-ust.git] / liblttng-ust-java / Makefile.am
CommitLineData
51faf6d0 1JAVAROOT = .build
8d179959
CB
2jarfile = liblttng-ust-java.jar
3jardir = $(datadir)/java
4pkgpath = org/lttng/ust
378fa1c7 5
8d179959
CB
6dist_noinst_JAVA = $(pkgpath)/LTTngUst.java
7jar_DATA = $(jarfile)
8d179959 8
e1c62734 9AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(JNI_CPPFLAGS)
51faf6d0 10
69400ac4 11lib_LTLIBRARIES = liblttng-ust-java.la
ca7bd68c 12liblttng_ust_java_la_SOURCES = LTTngUst.c lttng_ust_java.h
51faf6d0
MJ
13
14# Generated by javac / javah
ca7bd68c 15nodist_liblttng_ust_java_la_SOURCES = org_lttng_ust_LTTngUst.h
d880b43f 16
8d179959 17liblttng_ust_java_la_LIBADD = -lc -L$(top_builddir)/liblttng-ust/.libs -llttng-ust
378fa1c7 18
51faf6d0
MJ
19# Explicit dependency to ensure the header is generated before the
20# C file is built.
21LTTngUst.lo: org_lttng_ust_LTTngUst.h
22
8d179959 23$(jarfile): classnoinst.stamp
51faf6d0
MJ
24 $(JAR) cf $(JARFLAGS) $@ -C $(JAVAROOT) $(pkgpath)/LTTngUst.class
25
26# Ensure the javaroot directory is created before the Java class files are built.
27$(pkgpath)/LTTngUst.java: $(JAVAROOT)
28$(JAVAROOT):
29 -test -d $(JAVAROOT) || mkdir $(JAVAROOT)
378fa1c7 30
ca08b2bf
MJ
31if !HAVE_JAVAH
32# If we don't have javah, assume we are running openjdk >= 10 and use javac
33# to generate the jni header file.
34AM_JAVACFLAGS = -h .
35
51faf6d0
MJ
36# The header file will be generated by javac when building the Java class
37# files, add a dependency on the stamp file to ensure proper ordering.
38org_lttng_ust_LTTngUst.h: classnoinst.stamp
ca08b2bf 39else
51faf6d0
MJ
40org_lttng_ust_LTTngUst.h:
41 $(JAVAH) -classpath $(srcdir) $(JAVAHFLAGS) org.lttng.ust.LTTngUst
ca08b2bf 42endif
2b6f8df9 43
51faf6d0 44CLEANFILES = $(jarfile) org_lttng_ust_LTTngUst.h
3077257a 45
51faf6d0
MJ
46clean-local:
47 -rm -rf $(JAVAROOT)
This page took 0.033069 seconds and 4 git commands to generate.