]> git.saurik.com Git - apple/mdnsresponder.git/blob - Clients/Java/nmakefile
mDNSResponder-765.1.2.tar.gz
[apple/mdnsresponder.git] / Clients / Java / nmakefile
1 # -*- tab-width: 4 -*-
2 #
3 # Copyright (c) 2002-2004 Apple Computer, Inc. All rights reserved.
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #
17 # This Makefile builds .jar files for the DNS-SD Java sample apps.
18 # You must have the Java support installed.
19 #
20 # nmake with no arguments builds all production targets.
21 # 'nmake DEBUG=1' to build debugging targets.
22 # 'nmake clean' or 'nmake clean DEBUG=1' to delete prod/debug objects & targets
23 #
24 # To run nmake, you may need to set up your PATH correctly, using a script
25 # such as: "\Program Files\Microsoft Visual Studio .NET\Common7\tools\vsvars32.bat"
26 #
27 # The default location of the JDK is \javasdk. You can override this on the
28 # command line (e.g. 'nmake JDK=\j2dk1.4.2_03').
29
30 ############################################################################
31
32 JDK = "$(JAVA_HOME)"
33
34 CP = copy
35 RM = del /Q
36 RMDIR = rmdir /S /Q
37 JAVAC = $(JDK)\bin\javac
38 JAVAH = $(JDK)\bin\javah
39 JAR = $(JDK)\bin\jar
40
41 # Set up diverging paths for debug vs. prod builds
42 DEBUG=0
43 !if $(DEBUG) == 1
44 JFLAGS = -g
45 OBJDIR = objects\debug
46 BUILDDIR = build\debug
47 !else
48 JFLAGS =
49 OBJDIR = objects\prod
50 BUILDDIR = build\prod
51 !endif
52
53 SCOBJ = $(OBJDIR)\SimpleChat
54 BAOBJ = $(OBJDIR)\BrowserApp
55
56 #############################################################################
57
58 all: setup Java postbuild
59
60 # 'setup' sets up the build directory structure the way we want
61 setup:
62 @if not exist objects mkdir objects
63 @if not exist build mkdir build
64 @if not exist $(OBJDIR) mkdir $(OBJDIR)
65 @if not exist $(SCOBJ) mkdir $(SCOBJ)
66 @if not exist $(BAOBJ) mkdir $(BAOBJ)
67 @if not exist $(BUILDDIR) mkdir $(BUILDDIR)
68
69 postbuild:
70 @if not "%RC_XBS%"=="YES" GOTO END
71 @if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\Java" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\Java"
72 @copy "nmakefile" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\Java"
73 @copy "BrowserApp.java" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\Java"
74 @copy "SimpleChat.java" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\Java"
75 @copy "Swing*.java" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\Java"
76 @copy "$(BUILDDIR)\*.jar" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\Java"
77 @:END
78
79 # clean removes targets and objects
80 clean:
81 @if exist $(OBJDIR) $(RMDIR) $(OBJDIR)
82 @if exist $(BUILDDIR) $(RMDIR) $(BUILDDIR)
83
84 #############################################################################
85
86 Java: setup $(BUILDDIR)\SimpleChat.jar $(BUILDDIR)\BrowserApp.jar
87 @echo "Build complete"
88
89 SIMPLECHATOBJ = $(SCOBJ)\SwingBrowseListener.class \
90 $(SCOBJ)\SwingQueryListener.class \
91 $(SCOBJ)\SimpleChat.class
92 SIMPLECHATMAN = SimpleChat.manifest
93
94 $(BUILDDIR)\SimpleChat.jar: $(SIMPLECHATOBJ) $(SIMPLECHATMAN)
95 $(JAR) -cfm $@ $(SIMPLECHATMAN) -C $(SCOBJ) .
96
97 BROWSERAPPOBJ = $(BAOBJ)\BrowserApp.class
98 BROWSERAPPMAN = BrowserApp.manifest
99
100 $(BUILDDIR)\BrowserApp.jar: $(BROWSERAPPOBJ) $(BROWSERAPPMAN)
101 $(JAR) -cfm $@ $(BROWSERAPPMAN) -C $(BAOBJ) .
102
103 JAVASRC = .
104 .SUFFIXES : .java
105 {$(JAVASRC)}.java{$(BAOBJ)}.class:
106 $(JAVAC) -d $(BAOBJ) -classpath $(BAOBJ);$(DNS_SD) $<
107 {$(JAVASRC)}.java{$(SCOBJ)}.class:
108 $(JAVAC) -d $(SCOBJ) -classpath $(SCOBJ);$(DNS_SD) $<
109