field-theory.org
the blog of wolfram schroers

Source code — Makefile.java

 1 #!/usr/bin/env make
 2 #
 3 # Java example program - The Protocol client, an implementation of a
 4 # logging facility that can receive messages from different processes
 5 # and even different machines. This file compiles and runs the client
 6 # for the Java 6 SDK ORB only. The source code is in Java.
 7 #
 8 # This file only compiles the Java client. For the other clients use
 9 # the "Makefile.mico" and "Makefile.orbit2" files!
10 #
11 # Written 2010 by Dr. W. Schroers, NuAS <http://www.field-theory.org>
12 #
13 # Published under the GPLv3, see file <gpl-3.0.txt>
14 #
15 
16 # NOTE: This Makefile has been used for mico v2.3.13 installed via
17 #       Fink (32-bit, unstable tree enabled) on MacOS X 10.6.4 On
18 #       different systems (or for non-standard Fink installations) you
19 #       HAVE to adjust the following directory!
20 
21 PREFIX = /sw
22 
23 
24 # The following settings work for the default ORB of Java SDK v1.6.0
25 # (as by Apple's installation). They will need to be adjusted for
26 # different CORBA implementations!
27 
28 JAVA-IDL = idlj
29 JAVAC = javac
30 
31 
32 # The following are general commands and file dependencies 
33 
34 # General makefile command configuration
35 .PHONY: all clean
36 .SUFFIXES:
37 .SUFFIXES: .idl .java .class .jar
38 .SILENT:
39 
40 # IDL-file dependencies, targets and general commands
41 IDL-OBJS = ORBExample
42 TARGETS = client_java
43 
44 all: $(IDL-OBJS) $(TARGETS)
45 
46 clean:
47 	printf "Cleaning up ..."
48 	\$(RM) -r *.class $(IDL-OBJS) $(TARGETS)
49 	printf " done.\n"
50 
51 client_java: client_java.java $(IDL-OBJS)
52 	printf "Compiling target $@ ..."
53 	$(JAVAC) $<
54 	printf " done.\n"
55 
56 $(IDL-OBJS): protocol.idl
57 	printf "Parsing IDL file $< ..."
58 	$(JAVA-IDL) $<
59 	$(JAVAC) -d . $(IDL-OBJS)/*.java
60 	printf " done.\n"
61 
62 # Specific dependencies
63 client_java: client_java.java $(IDL-OBJS)
64 
65 # Generic compilation command
66 %.class: %.java
67 	$(JAVAC) $<