]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSWindows/Applications/Java/makefile
mDNSResponder-66.3.tar.gz
[apple/mdnsresponder.git] / mDNSWindows / Applications / Java / makefile
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 # $Log: makefile,v $
23 # Revision 1.2 2004/05/01 00:31:41 rpantos
24 # Change line endings for CVS.
25 #
26 # Revision 1.1 2004/04/30 16:32:34 rpantos
27 # First checked in.
28 #
29 # This Makefile builds a .jar file and accompanying JNI support library
30 # containing the DNSSD implementation for Java and support classes.
31 #
32 # Prior to building Java support, you must build DNSSD.dll.
33 #
34 # nmake with no arguments builds all production targets.
35 # 'nmake DEBUG=1' to build debugging targets.
36 # 'nmake clean' or 'nmake clean DEBUG=1' to delete prod/debug objects & targets
37 #
38 # To run nmake, you may need to set up your PATH correctly, using a script
39 # such as: "\Program Files\Microsoft Visual Studio .NET\Vc7\bin\vcvars32.bat"
40 #
41 # The default location of the JDK is d:\javasdk. You can override this on the
42 # command line (e.g. 'nmake JDK=\j2dk1.4.2_03').
43
44 ############################################################################
45
46 COREDIR = ..\..\..\mDNSCore
47 SHAREDDIR = ..\..\..\mDNSShared
48
49 JDK = d:\javasdk
50
51 CC = cl
52 LD = ld
53 CP = copy
54 RM = del /Q
55 RMDIR = rmdir /S /Q
56 JAVAC = $(JDK)\bin\javac
57 JAVAH = $(JDK)\bin\javah
58 JAR = $(JDK)\bin\jar
59 CFLAGS_COMMON = -LD -DAUTO_CALLBACKS=1 -DUSE_WIN_API=1 -I. -I..\.. \
60 -I$(COREDIR) -I$(SHAREDDIR) -I$(JDK)\include -I$(JDK)\include\win32
61
62 # Set up diverging paths for debug vs. prod builds
63 DEBUG=0
64 !if $(DEBUG) == 1
65 CFLAGS_DEBUG = -Zi -DMDNS_DEBUGMSGS=2
66 OBJDIR = objects\debug
67 BUILDDIR = build\debug
68 LIBDIR = ..\DLL\Debug
69 !else
70 CFLAGS_DEBUG = -Os -DMDNS_DEBUGMSGS=0
71 OBJDIR = objects\prod
72 BUILDDIR = build\prod
73 LIBDIR = ..\DLL\Release
74 !endif
75
76 CFLAGS = $(CFLAGS_COMMON) $(CFLAGS_DEBUG)
77 JAVACFLAGS = $(CFLAGS) $(JAVACFLAGS_OS)
78
79 #############################################################################
80
81 all: setup Java
82
83 # 'setup' sets up the build directory structure the way we want
84 setup:
85 @if not exist objects mkdir objects
86 @if not exist build mkdir build
87 @if not exist $(OBJDIR) mkdir $(OBJDIR)
88 @if not exist $(BUILDDIR) mkdir $(BUILDDIR)
89
90 # clean removes targets and objects
91 clean:
92 @if exist $(OBJDIR) $(RMDIR) $(OBJDIR)
93 @if exist $(BUILDDIR) $(RMDIR) $(BUILDDIR)
94
95 #############################################################################
96
97 # The following targets build Java wrappers for the dns-sd.h API.
98
99 Java: setup $(BUILDDIR)\dns_sd.jar $(BUILDDIR)\jdns_sd.dll
100 @echo "Java wrappers done"
101
102 JAVASRC = $(SHAREDDIR)\Java
103 JARCONTENTS = $(OBJDIR)\com\apple\dnssd\DNSSDService.class \
104 $(OBJDIR)\com\apple\dnssd\DNSRecord.class \
105 $(OBJDIR)\com\apple\dnssd\DNSSDException.class \
106 $(OBJDIR)\com\apple\dnssd\TXTRecord.class \
107 $(OBJDIR)\com\apple\dnssd\DNSSDRegistration.class \
108 $(OBJDIR)\com\apple\dnssd\BaseListener.class \
109 $(OBJDIR)\com\apple\dnssd\BrowseListener.class \
110 $(OBJDIR)\com\apple\dnssd\ResolveListener.class \
111 $(OBJDIR)\com\apple\dnssd\RegisterListener.class \
112 $(OBJDIR)\com\apple\dnssd\QueryListener.class \
113 $(OBJDIR)\com\apple\dnssd\DomainListener.class \
114 $(OBJDIR)\com\apple\dnssd\DNSSD.class
115
116 $(BUILDDIR)\dns_sd.jar: $(JARCONTENTS)
117 $(JAR) -cf $@ -C $(OBJDIR) com
118
119 $(BUILDDIR)\jdns_sd.dll: $(JAVASRC)\JNISupport.c $(OBJDIR)\DNSSD.java.h
120 $(CC) -Fe$@ $(JAVASRC)\JNISupport.c $(CFLAGS) -I$(OBJDIR) \
121 $(LIBDIR)\DNSSD.lib $(JDK)\lib\jvm.lib
122
123 .SUFFIXES : .java
124 {$(JAVASRC)}.java{$(OBJDIR)\com\apple\dnssd}.class:
125 $(JAVAC) -d $(OBJDIR) -classpath $(OBJDIR) $<
126
127 $(OBJDIR)\DNSSD.java.h: $(OBJDIR)\com\apple\dnssd\DNSSD.class
128 $(JAVAH) -classpath $(OBJDIR) -o $@ \
129 com.apple.dnssd.AppleBrowser \
130 com.apple.dnssd.AppleResolver \
131 com.apple.dnssd.AppleRegistration \
132 com.apple.dnssd.AppleQuery \
133 com.apple.dnssd.AppleService
134