1 # SPDX-License-Identifier: LGPL-2.1-only
3 # Copyright (C) 2014 Christian Babeux <christian.babeux@efficios.com>
5 # This Makefile is not using automake so that users may see how to build a
6 # program with tracepoint provider probes as stand-alone shared objects.
8 # This makefile is purposefully kept simple to support GNU and BSD make.
11 # Required JAR files for Log4j 2.x
12 JARFILE_LOG4J2
=lttng-ust-agent-log4j2.jar
13 JARFILE_COMMON
=lttng-ust-agent-common.jar
15 # If system classpath is empty, try to guess log4j location
16 ifeq "$(CLASSPATH)" ""
17 CLASSPATH
=/usr
/local
/share
/java
/log4j.jar
:/usr
/share
/java
/log4j.jar
20 # Check if the top level makefile overrides the Log4j Jar file's path.
21 ifeq "$(JAVA_CLASSPATH_OVERRIDE_LOG4J2)" ""
22 LOG4J2_CP
= /usr
/local
/share
/java
/$(JARFILE_LOG4J2
):/usr
/share
/java
/$(JARFILE_LOG4J2
)
24 LOG4J2_CP
= $(JAVA_CLASSPATH_OVERRIDE_LOG4J2
)/$(JARFILE_LOG4J2
)
27 # Check if the top level makefile overrides the Common Jar file's path.
28 ifeq "$(JAVA_CLASSPATH_OVERRIDE_COMMON)" ""
29 COMMON_CP
= /usr
/local
/share
/java
/$(JARFILE_COMMON
):/usr
/share
/java
/$(JARFILE_COMMON
)
31 COMMON_CP
= $(JAVA_CLASSPATH_OVERRIDE_COMMON
)/$(JARFILE_COMMON
)
35 JC
= javac
-classpath
"$(CLASSPATH):$(LOG4J2_CP):$(COMMON_CP):."
36 .SUFFIXES
: .java .class
38 $(JC
) $(JFLAGS
) $*.java
40 CLASSES
= HelloLog4j2Ctx.java
44 classes
: $(CLASSES
:.java
=.class
)
48 $(RM
) $(CLASSES
:.java
=.class
)