Fix: Use env CLASSPATH when building log4j example
[lttng-ust.git] / doc / examples / java-log4j / Makefile
CommitLineData
501f6777
CB
1#
2# Copyright (C) 2014 - Christian Babeux <christian.babeux@efficios.com>
3#
4# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED OR
5# IMPLIED. ANY USE IS AT YOUR OWN RISK.
6#
7# Permission is hereby granted to use or copy this program for any purpose,
8# provided the above notices are retained on all copies. Permission to modify
9# the code and to distribute modified code is granted, provided the above
10# notices are retained, and a notice that the code was modified is included
11# with the above copyright notice.
12#
13# This Makefile is not using automake so that users may see how to build a
14# program with tracepoint provider probes as stand-alone shared objects.
15#
16# This makefile is purposefully kept simple to support GNU and BSD make.
17#
18
19JFLAGS = -g
20
21# Default JUL jar name.
22JARFILE=liblttng-ust-agent.jar
2345c467
MJ
23
24# If system classpath is empty, try to guess log4j location
25ifeq "$(CLASSPATH)" ""
26 CLASSPATH="/usr/local/share/java/log4j.jar:/usr/share/java/log4j.jar"
27endif
501f6777
CB
28
29# Check if the top level makefile overrides the JUL Jar file name.
30ifneq "$(JAVA_JARFILE_OVERRIDE)" ""
31 JARFILE=$(JAVA_JARFILE_OVERRIDE)
32endif
33
34# Check if the top level makefile overrides the JUL classpath.
35ifeq "$(JAVA_CLASSPATH_OVERRIDE)" ""
2345c467 36 CLASSPATH:=/usr/local/share/java/$(JARFILE):/usr/share/java/$(JARFILE):$(CLASSPATH)
501f6777 37else
2345c467 38 CLASSPATH:=$(JAVA_CLASSPATH_OVERRIDE)/$(JARFILE):$(CLASSPATH)
501f6777
CB
39endif
40
e9f19220 41JC = javac -classpath "$(CLASSPATH):."
501f6777
CB
42.SUFFIXES: .java .class
43.java.class:
44 $(JC) $(JFLAGS) $*.java
45
46CLASSES = Hello.java
47
48all: classes
49
50classes: $(CLASSES:.java=.class)
51
52.PHONY: clean
53clean:
54 $(RM) *.class
This page took 0.034511 seconds and 4 git commands to generate.