Refactor liblttng-ust-jul in liblttng-ust-agent
[lttng-ust.git] / doc / examples / java-log4j / Makefile
diff --git a/doc/examples/java-log4j/Makefile b/doc/examples/java-log4j/Makefile
new file mode 100644 (file)
index 0000000..e174e31
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# Copyright (C) 2014 - Christian Babeux <christian.babeux@efficios.com>
+#
+# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED OR
+# IMPLIED. ANY USE IS AT YOUR OWN RISK.
+#
+# Permission is hereby granted to use or copy this program for any purpose,
+# provided the above notices are retained on all copies.  Permission to modify
+# the code and to distribute modified code is granted, provided the above
+# notices are retained, and a notice that the code was modified is included
+# with the above copyright notice.
+#
+# This Makefile is not using automake so that users may see how to build a
+# program with tracepoint provider probes as stand-alone shared objects.
+#
+# This makefile is purposefully kept simple to support GNU and BSD make.
+#
+
+JFLAGS = -g
+
+# Default JUL jar name.
+JARFILE=liblttng-ust-agent.jar
+LOG4J=/usr/share/java/log4j.jar
+
+# Check if the top level makefile overrides the JUL Jar file name.
+ifneq "$(JAVA_JARFILE_OVERRIDE)" ""
+       JARFILE=$(JAVA_JARFILE_OVERRIDE)
+endif
+
+# Check if the top level makefile overrides the JUL classpath.
+ifeq "$(JAVA_CLASSPATH_OVERRIDE)" ""
+       CLASSPATH=/usr/local/share/java/$(JARFILE):/usr/share/java/$(JARFILE):$(LOG4J)
+else
+       CLASSPATH=$(JAVA_CLASSPATH_OVERRIDE)/$(JARFILE):$(LOG4J)
+endif
+
+JC = javac -cp "$(CLASSPATH):."
+.SUFFIXES: .java .class
+.java.class:
+       $(JC) $(JFLAGS) $*.java
+
+CLASSES = Hello.java
+
+all: classes
+
+classes: $(CLASSES:.java=.class)
+
+.PHONY: clean
+clean:
+       $(RM) *.class
This page took 0.024601 seconds and 4 git commands to generate.