]>
Commit | Line | Data |
---|---|---|
7f0064bd A |
1 | # Copyright (c) 2002-2004 Apple Computer, Inc. All rights reserved. |
2 | # | |
3 | # @APPLE_LICENSE_HEADER_START@ | |
4 | # | |
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 | |
10 | # file. | |
11 | # | |
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. | |
19 | # | |
20 | # @APPLE_LICENSE_HEADER_END@ | |
21 | # | |
22 | # | |
23 | # This Makefile builds .jar files for the DNS-SD Java sample apps. | |
24 | # You must have the Java support installed. | |
25 | # | |
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 | |
29 | # | |
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" | |
32 | # | |
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'). | |
35 | ||
36 | ############################################################################ | |
37 | ||
4aea607d | 38 | JDK = $(JAVA_HOME) |
7f0064bd A |
39 | |
40 | CP = copy | |
41 | RM = del /Q | |
42 | RMDIR = rmdir /S /Q | |
43 | JAVAC = $(JDK)\bin\javac | |
44 | JAVAH = $(JDK)\bin\javah | |
45 | JAR = $(JDK)\bin\jar | |
46 | ||
47 | # Set up diverging paths for debug vs. prod builds | |
48 | DEBUG=0 | |
49 | !if $(DEBUG) == 1 | |
50 | JFLAGS = -g | |
51 | OBJDIR = objects\debug | |
52 | BUILDDIR = build\debug | |
53 | !else | |
54 | JFLAGS = | |
55 | OBJDIR = objects\prod | |
56 | BUILDDIR = build\prod | |
57 | !endif | |
58 | ||
59 | SCOBJ = $(OBJDIR)\SimpleChat | |
60 | BAOBJ = $(OBJDIR)\BrowserApp | |
61 | ||
62 | ############################################################################# | |
63 | ||
64 | all: setup Java | |
65 | ||
66 | # 'setup' sets up the build directory structure the way we want | |
67 | setup: | |
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) | |
74 | ||
75 | # clean removes targets and objects | |
76 | clean: | |
77 | @if exist $(OBJDIR) $(RMDIR) $(OBJDIR) | |
78 | @if exist $(BUILDDIR) $(RMDIR) $(BUILDDIR) | |
79 | ||
80 | ############################################################################# | |
81 | ||
82 | Java: setup $(BUILDDIR)\SimpleChat.jar $(BUILDDIR)\BrowserApp.jar | |
83 | @echo "Build complete" | |
84 | ||
85 | SIMPLECHATOBJ = $(SCOBJ)\SwingBrowseListener.class \ | |
86 | $(SCOBJ)\SwingQueryListener.class \ | |
87 | $(SCOBJ)\SimpleChat.class | |
88 | SIMPLECHATMAN = SimpleChat.manifest | |
89 | ||
90 | $(BUILDDIR)\SimpleChat.jar: $(SIMPLECHATOBJ) $(SIMPLECHATMAN) | |
91 | $(JAR) -cfm $@ $(SIMPLECHATMAN) -C $(SCOBJ) . | |
92 | ||
93 | BROWSERAPPOBJ = $(BAOBJ)\SwingResolveListener.class \ | |
94 | $(BAOBJ)\BrowserApp.class | |
95 | BROWSERAPPMAN = BrowserApp.manifest | |
96 | ||
97 | $(BUILDDIR)\BrowserApp.jar: $(BROWSERAPPOBJ) $(BROWSERAPPMAN) | |
98 | $(JAR) -cfm $@ $(BROWSERAPPMAN) -C $(BAOBJ) . | |
99 | ||
100 | JAVASRC = . | |
101 | .SUFFIXES : .java | |
102 | {$(JAVASRC)}.java{$(BAOBJ)}.class: | |
7cb34e5c | 103 | $(JAVAC) -d $(BAOBJ) -classpath $(BAOBJ);$(DNS_SD) $< |
7f0064bd | 104 | {$(JAVASRC)}.java{$(SCOBJ)}.class: |
7cb34e5c | 105 | $(JAVAC) -d $(SCOBJ) -classpath $(SCOBJ);$(DNS_SD) $< |
7f0064bd | 106 |