1 # Copyright (c) 2002-2004 Apple Computer, Inc. All rights reserved.
3 # @APPLE_LICENSE_HEADER_START@
5 # This file contains Original Code and/or Modifications of Original Code
6 # as defined in and that are subject to the Apple Public Source License
7 # Version 2.0 (the 'License'). You may not use this file except in
8 # compliance with the License. Please obtain a copy of the License at
9 # http://www.opensource.apple.com/apsl/ and read it before using this
12 # The Original Code and all software distributed under the License are
13 # distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 # EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 # INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 # FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
17 # Please see the License for the specific language governing rights and
18 # limitations under the License.
20 # @APPLE_LICENSE_HEADER_END@
23 # This Makefile builds .jar files for the DNS-SD Java sample apps.
24 # You must have the Java support installed.
26 # nmake with no arguments builds all production targets.
27 # 'nmake DEBUG=1' to build debugging targets.
28 # 'nmake clean' or 'nmake clean DEBUG=1' to delete prod/debug objects & targets
30 # To run nmake, you may need to set up your PATH correctly, using a script
31 # such as: "\Program Files\Microsoft Visual Studio .NET\Common7\tools\vsvars32.bat"
33 # The default location of the JDK is \javasdk. You can override this on the
34 # command line (e.g. 'nmake JDK=\j2dk1.4.2_03').
36 ############################################################################
43 JAVAC = $(JDK)\bin\javac
44 JAVAH = $(JDK)\bin\javah
47 # Set up diverging paths for debug vs. prod builds
51 OBJDIR = objects\debug
52 BUILDDIR = build\debug
59 SCOBJ = $(OBJDIR)\SimpleChat
60 BAOBJ = $(OBJDIR)\BrowserApp
62 #############################################################################
66 # 'setup' sets up the build directory structure the way we want
68 @if not exist objects mkdir objects
69 @if not exist build mkdir build
70 @if not exist $(OBJDIR) mkdir $(OBJDIR)
71 @if not exist $(SCOBJ) mkdir $(SCOBJ)
72 @if not exist $(BAOBJ) mkdir $(BAOBJ)
73 @if not exist $(BUILDDIR) mkdir $(BUILDDIR)
75 # clean removes targets and objects
77 @if exist $(OBJDIR) $(RMDIR) $(OBJDIR)
78 @if exist $(BUILDDIR) $(RMDIR) $(BUILDDIR)
80 #############################################################################
82 Java: setup $(BUILDDIR)\SimpleChat.jar $(BUILDDIR)\BrowserApp.jar
83 @echo "Build complete"
85 SIMPLECHATOBJ = $(SCOBJ)\SwingBrowseListener.class \
86 $(SCOBJ)\SwingQueryListener.class \
87 $(SCOBJ)\SimpleChat.class
88 SIMPLECHATMAN = SimpleChat.manifest
90 $(BUILDDIR)\SimpleChat.jar: $(SIMPLECHATOBJ) $(SIMPLECHATMAN)
91 $(JAR) -cfm $@ $(SIMPLECHATMAN) -C $(SCOBJ) .
93 BROWSERAPPOBJ = $(BAOBJ)\SwingResolveListener.class \
94 $(BAOBJ)\BrowserApp.class
95 BROWSERAPPMAN = BrowserApp.manifest
97 $(BUILDDIR)\BrowserApp.jar: $(BROWSERAPPOBJ) $(BROWSERAPPMAN)
98 $(JAR) -cfm $@ $(BROWSERAPPMAN) -C $(BAOBJ) .
102 {$(JAVASRC)}.java{$(BAOBJ)}.class:
103 $(JAVAC) -d $(BAOBJ) -classpath $(BAOBJ);$(DNS_SD) $<
104 {$(JAVASRC)}.java{$(SCOBJ)}.class:
105 $(JAVAC) -d $(SCOBJ) -classpath $(SCOBJ);$(DNS_SD) $<