From: Michael Jeanson Date: Wed, 22 Apr 2020 20:32:51 +0000 (-0400) Subject: fix: Java examples CLASSPATH override X-Git-Tag: v2.12.1~11 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=72e6e0369d6b5c9178cdc103b17ae6350a8c96e6;p=lttng-ust.git fix: Java examples CLASSPATH override Variables provided to make as arguments, called 'command variables' can't be reassigned a new value in the Makefile. Since the CLASSPATH is now passed this way in the glue between automake and the example makefiles, use different names for the internal variables. Change-Id: Id6289273f211f544a66d933a96f06df75243415f Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/doc/examples/java-jul/Makefile b/doc/examples/java-jul/Makefile index 8597c7af..5a594ff3 100644 --- a/doc/examples/java-jul/Makefile +++ b/doc/examples/java-jul/Makefile @@ -22,20 +22,20 @@ JARFILE_COMMON=lttng-ust-agent-common.jar # Check if the top level makefile overrides the JUL Jar file's path. ifeq "$(JAVA_CLASSPATH_OVERRIDE_JUL)" "" - CLASSPATH=/usr/local/share/java/$(JARFILE_JUL):/usr/share/java/$(JARFILE_JUL) + JUL_CP = /usr/local/share/java/$(JARFILE_JUL):/usr/share/java/$(JARFILE_JUL) else - CLASSPATH=$(JAVA_CLASSPATH_OVERRIDE_JUL)/$(JARFILE_JUL) + JUL_CP = $(JAVA_CLASSPATH_OVERRIDE_JUL)/$(JARFILE_JUL) endif # Check if the top level makefile overrides the Common Jar file's path. ifeq "$(JAVA_CLASSPATH_OVERRIDE_COMMON)" "" - CLASSPATH:=$(CLASSPATH):/usr/local/share/java/$(JARFILE_COMMON):/usr/share/java/$(JARFILE_COMMON) + COMMON_CP = /usr/local/share/java/$(JARFILE_COMMON):/usr/share/java/$(JARFILE_COMMON) else - CLASSPATH:=$(CLASSPATH):$(JAVA_CLASSPATH_OVERRIDE_COMMON)/$(JARFILE_COMMON) + COMMON_CP = $(JAVA_CLASSPATH_OVERRIDE_COMMON)/$(JARFILE_COMMON) endif JFLAGS = -g -JC = javac -classpath "$(CLASSPATH):." +JC = javac -classpath "$(CLASSPATH):$(JUL_CP):$(COMMON_CP):." .SUFFIXES: .java .class .java.class: $(JC) $(JFLAGS) $*.java diff --git a/doc/examples/java-log4j/Makefile b/doc/examples/java-log4j/Makefile index 59ffdf79..39c2e788 100644 --- a/doc/examples/java-log4j/Makefile +++ b/doc/examples/java-log4j/Makefile @@ -27,20 +27,20 @@ endif # Check if the top level makefile overrides the Log4j Jar file's path. ifeq "$(JAVA_CLASSPATH_OVERRIDE_LOG4J)" "" - CLASSPATH:=$(CLASSPATH):/usr/local/share/java/$(JARFILE_LOG4J):/usr/share/java/$(JARFILE_LOG4J) + LOG4J_CP = /usr/local/share/java/$(JARFILE_LOG4J):/usr/share/java/$(JARFILE_LOG4J) else - CLASSPATH:=$(CLASSPATH):$(JAVA_CLASSPATH_OVERRIDE_LOG4J)/$(JARFILE_LOG4J) + LOG4J_CP = $(JAVA_CLASSPATH_OVERRIDE_LOG4J)/$(JARFILE_LOG4J) endif # Check if the top level makefile overrides the Common Jar file's path. ifeq "$(JAVA_CLASSPATH_OVERRIDE_COMMON)" "" - CLASSPATH:=$(CLASSPATH):/usr/local/share/java/$(JARFILE_COMMON):/usr/share/java/$(JARFILE_COMMON) + COMMON_CP = /usr/local/share/java/$(JARFILE_COMMON):/usr/share/java/$(JARFILE_COMMON) else - CLASSPATH:=$(CLASSPATH):$(JAVA_CLASSPATH_OVERRIDE_COMMON)/$(JARFILE_COMMON) + COMMON_CP = $(JAVA_CLASSPATH_OVERRIDE_COMMON)/$(JARFILE_COMMON) endif JFLAGS = -g -JC = javac -classpath "$(CLASSPATH):." +JC = javac -classpath "$(CLASSPATH):$(LOG4J_CP):$(COMMON_CP):." .SUFFIXES: .java .class .java.class: $(JC) $(JFLAGS) $*.java