From 16b36e5502b612f3c99e34bf8f5e794029ca3263 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 15 Nov 2013 13:24:40 -0500 Subject: [PATCH] JUL: fix out of tree build Signed-off-by: Mathieu Desnoyers --- liblttng-ust-java/Makefile.am | 4 ++-- liblttng-ust-jul/Makefile.am | 23 ++++++++++++++++------- tests/java-jul/Makefile.am | 2 +- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/liblttng-ust-java/Makefile.am b/liblttng-ust-java/Makefile.am index 5d43cfc7..37867a7c 100644 --- a/liblttng-ust-java/Makefile.am +++ b/liblttng-ust-java/Makefile.am @@ -26,8 +26,8 @@ clean-local: LTTngUst.c: org_lttng_ust_LTTngUst.h -$(LTTNG_JUST_DESTDIR)/LTTngUst.class: $(LTTNG_JUST_DESTDIR)/LTTngUst.java - $(JCC)/javac -d "$(builddir)" "$(LTTNG_JUST_DESTDIR)/LTTngUst.java" +$(LTTNG_JUST_DESTDIR)/LTTngUst.class: $(LTTNG_JUST_SRCDIR)/LTTngUst.java + $(JCC)/javac -d "$(builddir)" "$(LTTNG_JUST_SRCDIR)/LTTngUst.java" org_lttng_ust_LTTngUst.h: $(LTTNG_JUST_DESTDIR)/LTTngUst.class $(JCC)/javah org.lttng.ust.LTTngUst diff --git a/liblttng-ust-jul/Makefile.am b/liblttng-ust-jul/Makefile.am index ffcc5380..89c90804 100644 --- a/liblttng-ust-jul/Makefile.am +++ b/liblttng-ust-jul/Makefile.am @@ -24,8 +24,10 @@ else JCC=javac endif -all-local: $(LTTNG_JUL_DESTDIR)/LTTngAgent.class $(LTTNG_JUL_DESTDIR)/LTTngUst.class \ - org_lttng_ust_jul_LTTngUst.h liblttng-ust-jul.jar +all-local: $(LTTNG_JUL_DESTDIR)/LTTngAgent.class \ + $(LTTNG_JUL_DESTDIR)/LTTngUst.class \ + org_lttng_ust_jul_LTTngUst.h \ + liblttng-ust-jul.jar clean-local: rm -f org_lttng_ust_jul_LTTngUst.h @@ -34,16 +36,23 @@ clean-local: LTTngUst.c: org_lttng_ust_jul_LTTngUst.h -$(LTTNG_JUL_DESTDIR)/LTTngUst.class: $(LTTNG_JUL_SRCDIR)/LTTngUst.java - $(JCC)/javac -d "$(builddir)" "$(LTTNG_JUL_SRCDIR)/LTTngUst.java" +%.class: %.java + $(JCC)/javac -d "$(builddir)" $< -$(LTTNG_JUL_DESTDIR)/LTTngAgent.class: $(LTTNG_JUL_SRCDIR)/LTTngAgent.java - $(JCC)/javac -d "$(builddir)" "$(LTTNG_JUL_SRCDIR)/LTTngAgent.java" +LTTNG_AGENT_FILES = $(LTTNG_JUL_SRCDIR)/LTTngAgent.java \ + $(LTTNG_JUL_SRCDIR)/LTTngLogHandler.java \ + $(LTTNG_JUL_SRCDIR)/LTTngSessiondCmd2_4.java \ + $(LTTNG_JUL_SRCDIR)/LTTngTCPSessiondClient.java \ + $(LTTNG_JUL_SRCDIR)/LTTngThread.java + +$(LTTNG_JUL_DESTDIR)/LTTngAgent.class: $(LTTNG_AGENT_FILES) \ + $(LTTNG_JUL_DESTDIR)/LTTngUst.class + $(JCC)/javac -d "$(builddir)" $(LTTNG_AGENT_FILES) org_lttng_ust_jul_LTTngUst.h: $(LTTNG_JUL_DESTDIR)/LTTngUst.class $(JCC)/javah org.lttng.ust.jul.LTTngUst -liblttng-ust-jul.jar: $(LTTNG_JUL_DESTDIR)/LTTngUst.class $(LTTNG_JUL_DESTDIR)/LTTngAgent.class +liblttng-ust-jul.jar: $(LTTNG_JUL_DESTDIR)/LTTngAgent.class $(JCC)/jar cf liblttng-ust-jul.jar \ $(LTTNG_JUL_DESTDIR)/*.class diff --git a/tests/java-jul/Makefile.am b/tests/java-jul/Makefile.am index b4dfc4ca..ba50fbf1 100644 --- a/tests/java-jul/Makefile.am +++ b/tests/java-jul/Makefile.am @@ -10,7 +10,7 @@ endif AM_CPPFLAGS = -I$(top_srcdir)/include -JUL_jar_file = "$(srcdir)/../../liblttng-ust-jul/liblttng-ust-jul.jar" +JUL_jar_file = "$(builddir)/../../liblttng-ust-jul/liblttng-ust-jul.jar" default: all -- 2.34.1