]> git.saurik.com Git - apple/mdnsresponder.git/blame - Clients/Java/nmakefile
mDNSResponder-212.1.tar.gz
[apple/mdnsresponder.git] / Clients / Java / nmakefile
CommitLineData
67c8f8a1
A
1# -*- tab-width: 4 -*-
2#
7f0064bd
A
3# Copyright (c) 2002-2004 Apple Computer, Inc. All rights reserved.
4#
67c8f8a1
A
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
7f0064bd 8#
67c8f8a1 9# http://www.apache.org/licenses/LICENSE-2.0
7f0064bd 10#
67c8f8a1
A
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
7f0064bd 15# limitations under the License.
7f0064bd
A
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
4aea607d 32JDK = $(JAVA_HOME)
7f0064bd
A
33
34CP = copy
35RM = del /Q
36RMDIR = rmdir /S /Q
37JAVAC = $(JDK)\bin\javac
38JAVAH = $(JDK)\bin\javah
39JAR = $(JDK)\bin\jar
40
41# Set up diverging paths for debug vs. prod builds
42DEBUG=0
43!if $(DEBUG) == 1
44JFLAGS = -g
45OBJDIR = objects\debug
46BUILDDIR = build\debug
47!else
48JFLAGS =
49OBJDIR = objects\prod
50BUILDDIR = build\prod
51!endif
52
53SCOBJ = $(OBJDIR)\SimpleChat
54BAOBJ = $(OBJDIR)\BrowserApp
55
56#############################################################################
57
32bb7e43 58all: setup Java postbuild
7f0064bd
A
59
60# 'setup' sets up the build directory structure the way we want
61setup:
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
32bb7e43
A
69postbuild:
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
7f0064bd
A
79# clean removes targets and objects
80clean:
81 @if exist $(OBJDIR) $(RMDIR) $(OBJDIR)
82 @if exist $(BUILDDIR) $(RMDIR) $(BUILDDIR)
83
84#############################################################################
85
86Java: setup $(BUILDDIR)\SimpleChat.jar $(BUILDDIR)\BrowserApp.jar
87 @echo "Build complete"
88
89SIMPLECHATOBJ = $(SCOBJ)\SwingBrowseListener.class \
90 $(SCOBJ)\SwingQueryListener.class \
91 $(SCOBJ)\SimpleChat.class
92SIMPLECHATMAN = SimpleChat.manifest
93
94$(BUILDDIR)\SimpleChat.jar: $(SIMPLECHATOBJ) $(SIMPLECHATMAN)
95 $(JAR) -cfm $@ $(SIMPLECHATMAN) -C $(SCOBJ) .
96
32bb7e43 97BROWSERAPPOBJ = $(BAOBJ)\BrowserApp.class
7f0064bd
A
98BROWSERAPPMAN = BrowserApp.manifest
99
100$(BUILDDIR)\BrowserApp.jar: $(BROWSERAPPOBJ) $(BROWSERAPPMAN)
101 $(JAR) -cfm $@ $(BROWSERAPPMAN) -C $(BAOBJ) .
102
103JAVASRC = .
104.SUFFIXES : .java
105{$(JAVASRC)}.java{$(BAOBJ)}.class:
7cb34e5c 106 $(JAVAC) -d $(BAOBJ) -classpath $(BAOBJ);$(DNS_SD) $<
7f0064bd 107{$(JAVASRC)}.java{$(SCOBJ)}.class:
7cb34e5c 108 $(JAVAC) -d $(SCOBJ) -classpath $(SCOBJ);$(DNS_SD) $<
7f0064bd 109