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