Move to kernel style SPDX license identifiers
[lttng-ust.git] / doc / examples / java-log4j / Makefile
1 # SPDX-License-Identifier: LGPL-2.1-only
2 #
3 # Copyright (C) 2014 Christian Babeux <christian.babeux@efficios.com>
4 #
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.
7 #
8 # This makefile is purposefully kept simple to support GNU and BSD make.
9 #
10
11 # Required JAR files for Log4j
12 JARFILE_LOG4J=lttng-ust-agent-log4j.jar
13 JARFILE_COMMON=lttng-ust-agent-common.jar
14
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
18 endif
19
20 # Check if the top level makefile overrides the Log4j Jar file's path.
21 ifeq "$(JAVA_CLASSPATH_OVERRIDE_LOG4J)" ""
22 LOG4J_CP = /usr/local/share/java/$(JARFILE_LOG4J):/usr/share/java/$(JARFILE_LOG4J)
23 else
24 LOG4J_CP = $(JAVA_CLASSPATH_OVERRIDE_LOG4J)/$(JARFILE_LOG4J)
25 endif
26
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)
30 else
31 COMMON_CP = $(JAVA_CLASSPATH_OVERRIDE_COMMON)/$(JARFILE_COMMON)
32 endif
33
34 JFLAGS = -g
35 JC = javac -classpath "$(CLASSPATH):$(LOG4J_CP):$(COMMON_CP):."
36 .SUFFIXES: .java .class
37 .java.class:
38 $(JC) $(JFLAGS) $*.java
39
40 CLASSES = Hello.java
41
42 all: classes
43
44 classes: $(CLASSES:.java=.class)
45
46 .PHONY: clean
47 clean:
48 $(RM) *.class
This page took 0.028479 seconds and 4 git commands to generate.