1 # Copyright (c) 2002-2004, Apple Computer, Inc. All rights reserved.
3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are met:
6 # 1. Redistributions of source code must retain the above copyright notice,
7 # this list of conditions and the following disclaimer.
8 # 2. Redistributions in binary form must reproduce the above copyright notice,
9 # this list of conditions and the following disclaimer in the documentation
10 # and/or other materials provided with the distribution.
11 # 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of its
12 # contributors may be used to endorse or promote products derived from this
13 # software without specific prior written permission.
15 # THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
16 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 # DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
19 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 # Revision 1.64 2005/10/25 23:55:47 cheshire
28 # Add tiger to list of target platforms
30 # Revision 1.63 2005/10/11 21:30:44 cheshire
31 # Add "-Wunreachable-code" (commented out for now)
33 # Revision 1.62 2005/06/30 21:46:55 cheshire
34 # <rdar://problem/4167287> Solaris should use unix domain sockets, not loopback
36 # Revision 1.61 2005/06/30 20:46:05 cheshire
37 # Added Makefile rule to build threadsafe object files where necessary using "-D_REENTRANT".
39 # Revision 1.60 2005/06/30 10:42:38 cheshire
40 # Turn on "-Werror" and "-O" for better error reporting
42 # Revision 1.59 2005/04/14 21:07:10 rpantos
43 # Bug #: 4089257, Clean build broken for Java support on POSIX
44 # Submitted by: Roger Pantos
45 # Reviewed by: Kiren Sekar
47 # Revision 1.58 2005/04/08 21:37:57 ksekar
48 # <rdar://problem/3792767> get_ifi_info doesn't return IPv6 interfaces on Linux
50 # Revision 1.57 2005/03/17 04:02:28 cheshire
51 # <rdar://problem/3986419> mDNSResponder won't compile with gcc4 on Tiger
52 # Changed Makefile to link using gcc instead of libtool
54 # Revision 1.56 2005/02/02 02:25:21 cheshire
55 # <rdar://problem/3980388> /var/run/mDNSResponder should be /var/run/mdnsd on Linux
57 # Revision 1.55 2005/01/27 22:55:00 cheshire
58 # Add "make os=tiger" target which uses gcc4 and "-Wdeclaration-after-statement"
60 # Revision 1.54 2004/12/17 19:33:03 cheshire
61 # Add "-lresolv" for Solaris
63 # Revision 1.53 2004/12/01 20:04:31 cheshire
66 # Revision 1.52 2004/12/01 19:46:12 cheshire
67 # Add install case for Suse 9 (rc*.d directories *inside* the init.d directory)
69 # Revision 1.51 2004/12/01 03:30:29 cheshire
70 # <rdar://problem/3889346> Add Unicast DNS support to mDNSPosix
72 # Revision 1.50 2004/12/01 01:14:20 cheshire
73 # Add $(LIBFLAGS) to cc command to build dnsextd (required for Solaris)
75 # Revision 1.49 2004/11/11 01:44:52 cheshire
76 # Updated error message
78 # Revision 1.48 2004/10/06 02:22:19 cheshire
79 # Changed MacRoman copyright symbol (should have been UTF-8 in any case :-) to ASCII-compatible "(c)"
81 # Revision 1.47 2004/10/01 22:15:54 rpantos
82 # rdar://problem/3824265: Replace APSL in client lib with BSD license.
84 # Revision 1.46 2004/09/24 21:15:25 cheshire
85 # <rdar://problem/3724985> Library "libmdns" misnamed; should be "libdns_sd"
87 # Revision 1.45 2004/09/22 16:23:41 cheshire
88 # Modify installation for compatibility with Gentoo Linux
89 # (Thanks to David Black for this information)
91 # Revision 1.44 2004/09/17 01:08:53 cheshire
92 # Renamed mDNSClientAPI.h to mDNSEmbeddedAPI.h
93 # The name "mDNSClientAPI.h" is misleading to new developers looking at this code. The interfaces
94 # declared in that file are ONLY appropriate to single-address-space embedded applications.
95 # For clients on general-purpose computers, the interfaces defined in dns_sd.h should be used.
97 # Revision 1.43 2004/09/17 00:30:11 cheshire
98 # Added some '@' signs to make build output less verbose --
99 # when there's too much on the screen it's easy to miss build errors and warnings
101 # Revision 1.42 2004/08/24 22:04:37 cheshire
102 # Need to specify -lpthread for building dnsextd
104 # Revision 1.41 2004/08/11 00:43:26 ksekar
105 # <rdar://problem/3722542>: DNS Extension daemon for DNS Update Lease
107 # Revision 1.40 2004/07/08 21:45:55 cheshire
108 # Make nss_mdns only build on Linux. We can add it to other targets (Solaris,
109 # FreeBSD, etc., as we verify them). In particular, NSS is NOT supported on
110 # OS X, so including it for "os=jaguar" or "os=panther" broke those builds.
112 # Revision 1.39 2004/06/29 03:34:28 cheshire
113 # Add 'dot-local' Name Service Switch support from Andrew White at NICTA
115 # Revision 1.38 2004/06/25 02:19:40 rpantos
118 # Revision 1.37 2004/06/25 00:51:09 rpantos
119 # And fix the Java build for Posix on Solaris, too.
121 # Revision 1.36 2004/06/25 00:26:27 rpantos
122 # Changes to fix the Posix build on Solaris.
124 # Revision 1.35 2004/06/18 18:51:31 cheshire
125 # Add (commented out) "-pedantic" for when we want to check for "mixed declarations and code" warnings
127 # Revision 1.34 2004/05/25 18:29:33 cheshire
128 # Move DNSServiceConstructFullName() from dnssd_clientstub.c to dnssd_clientlib.c,
129 # so that it's also accessible to dnssd_clientshim.c (single address space) clients.
131 # Revision 1.33 2004/04/30 16:46:32 rpantos
132 # Add support for building Java libraries.
134 # Revision 1.32 2004/04/14 23:09:29 ksekar
135 # Support for TSIG signed dynamic updates.
137 # Revision 1.31 2004/03/15 19:07:06 cheshire
140 # Revision 1.30 2004/03/11 18:58:29 rpantos
141 # Fix Kill /etc/rc scripts so they run at halt & reboot.
143 # Revision 1.29 2004/03/04 23:35:41 cheshire
144 # Instead of using a dummy target to generate an error message, use "$(error text...)"
146 # Revision 1.28 2004/03/04 23:33:42 cheshire
147 # Fixes from Alfred Perlstein for FreeBSD's benefit
149 # Revision 1.27 2004/02/11 21:00:21 cheshire
150 # Update URL for GNU Make manual page
152 # Revision 1.26 2004/02/05 21:28:30 cheshire
153 # Fixes so that "sudo make install" works on *BSD
155 # Revision 1.25 2004/02/05 20:00:22 cheshire
156 # Define mdnsd's PID file to be /var/run/mdnsd.pid on Posix builds
158 # Revision 1.24 2004/02/05 01:00:01 rpantos
159 # Fix some issues that turned up when building for FreeBSD.
161 # Revision 1.23 2004/02/04 01:50:54 cheshire
162 # Make InstalledStartup conditional, so it automatically installs into
163 # either /etc/init.d/ or /etc/rc.d/init.d/ as appropriate
165 # Revision 1.22 2004/01/20 01:41:21 rpantos
166 # Define USES_NETLINK for Linux builds.
168 # Revision 1.21 2003/12/17 00:51:22 cheshire
169 # Changed mDNSNetMonitor and mDNSIdentify to link the object files
170 # instead of #including the "DNSCommon.c" "uDNS.c" and source files
172 # Revision 1.20 2003/12/13 03:05:28 ksekar
173 # Bug #: <rdar://problem/3192548>: DynDNS: Unicast query of service records
175 # Revision 1.19 2003/12/11 19:42:13 cheshire
176 # Change name "mDNSResponderd" to "mdnsd" for consistency with standard Linux (Unix) naming conventions
178 # Revision 1.18 2003/12/11 19:38:34 cheshire
181 # Revision 1.17 2003/12/11 03:16:49 rpantos
182 # One more change for OS X build: make install work a little better.
184 # Revision 1.16 2003/12/11 03:03:51 rpantos
185 # Clean up mDNSPosix so that it builds on OS X again.
187 # Revision 1.15 2003/12/08 20:47:02 rpantos
188 # Add support for mDNSResponder on Linux.
190 # Revision 1.14 2003/11/14 20:59:09 cheshire
191 # Clients can't use AssignDomainName macro because mDNSPlatformMemCopy is defined in mDNSPlatformFunctions.h.
192 # Best solution is just to combine mDNSEmbeddedAPI.h and mDNSPlatformFunctions.h into a single file.
194 # Revision 1.13 2003/08/06 18:20:51 cheshire
197 # Revision 1.12 2003/08/01 02:20:02 cheshire
198 # Add mDNSIdentify tool, used to discover what version of mDNSResponder a particular host is running
200 # Revision 1.11 2003/07/14 18:11:54 cheshire
201 # Fix stricter compiler warnings
203 # Revision 1.10 2003/06/18 05:47:41 cheshire
204 # Enable stricter warnings on Jaguar and Panther builds
206 # Revision 1.9 2003/06/04 18:34:45 ksekar
207 # Bug #: <rdar://problem/3218120>: mDNSPosix does not build on Panther that has socklen_t
208 # Changed build targets "osx10.2" and "osx10.3" to "jaguar" and "panther".
210 # Revision 1.8 2003/06/04 00:23:12 ksekar
211 # Bug #: <rdar://problem/3218120>: mDNSPosix does not build on Panther that has socklen_t
212 # Created separate target OS's for 10.2 and 10.3.
214 # Revision 1.7 2003/04/16 02:11:37 cheshire
215 # Remove unnecessary $(CFLAGS) from linking rules
217 # Revision 1.6 2003/04/04 01:37:14 cheshire
221 # This Makefile builds an mDNSResponder daemon and a libdns_sd.so shared library
222 # for Linux. It also builds several example programs for embedded systems.
224 # Make with no arguments to build all production targets.
225 # 'make DEBUG=1' to build debugging targets.
226 # 'make clean' or 'make clean DEBUG=1' to delete prod/debug objects & targets
227 # 'sudo make install [DEBUG=1]' to install mdnsd daemon and libdns_sd.
230 # $@ means "The file name of the target of the rule"
231 # $< means "The name of the first prerequisite"
232 # $+ means "The names of all the prerequisites, with spaces between them, exactly as given"
233 # For more magic automatic variables, see
234 # <http://www.gnu.org/software/make/manual/html_chapter/make_10.html#SEC111>
236 #############################################################################
240 COREDIR = ../mDNSCore
241 SHAREDDIR = ../mDNSShared
249 CFLAGS_COMMON = -I. -I$(COREDIR) -I$(SHAREDDIR) -W -Wall -DPID_FILE=\"/var/run/mdnsd.pid\" -DMDNS_UDS_SERVERPATH=\"/var/run/mdnsd\"
252 JAVACFLAGS_OS = -fPIC -shared -ldns_sd
254 # Set up diverging paths for debug vs. prod builds
257 CFLAGS_DEBUG = -g -DMDNS_DEBUGMSGS=2
258 OBJDIR = objects/debug
259 BUILDDIR = build/debug
262 # We use -Os for two reasons:
263 # 1. We want to make small binaries, suitable for putting into hardware devices
264 # 2. Some of the code analysis warnings only work when some form of optimization is enabled
265 CFLAGS_DEBUG = -Os -DMDNS_DEBUGMSGS=0
266 OBJDIR = objects/prod
267 BUILDDIR = build/prod
271 # Configure per-OS peculiarities
273 CFLAGS_OS = -DNOT_HAVE_DAEMON -DNOT_HAVE_SA_LEN -DNOT_HAVE_SOCKLEN_T -DNOT_HAVE_IF_NAMETOINDEX \
274 -DLOG_PERROR=0 -D_XPG4_2 -D__EXTENSIONS__ -DHAVE_BROKEN_RECVIF_NAME
277 LIBFLAGS = -lsocket -lnsl -lresolv
278 JAVACFLAGS_OS += -I$(JDK)/include/solaris
285 CFLAGS_OS = -DNOT_HAVE_SA_LEN -DUSES_NETLINK -DHAVE_LINUX
286 JAVACFLAGS_OS += -I$(JDK)/include/linux
287 OPTIONALTARG = nss_mdns
288 OPTINSTALL = InstalledNSS
297 # If not already defined, set LOCALBASE to /usr/local
298 # FreeBSD requires the startup script to end in ".sh"
299 LOCALBASE?=/usr/local
300 INSTBASE=$(LOCALBASE)
301 STARTUPSCRIPTNAME=mdns.sh
303 JAVACFLAGS_OS += -I$(JDK)/include/freebsd
308 CFLAGS_OS = -DHAVE_BROKEN_RECVDSTADDR
313 CFLAGS_OS = -DHAVE_IPV6 -no-cpp-precomp -Werror -DNOT_HAVE_SOCKLEN_T
314 LD = libtool -dynamic
317 JDK = /System/Library/Frameworks/JavaVM.framework/Home
318 JAVACFLAGS_OS = -dynamiclib -I/System/Library/Frameworks/JavaVM.framework/Headers -framework JavaVM
322 CFLAGS_OS = -DHAVE_IPV6 -no-cpp-precomp -Werror
323 LD = libtool -dynamic
326 JDK = /System/Library/Frameworks/JavaVM.framework/Home
327 JAVACFLAGS_OS = -dynamiclib -I/System/Library/Frameworks/JavaVM.framework/Headers -framework JavaVM
331 CFLAGS_OS = -DHAVE_IPV6 -no-cpp-precomp -Werror -Wdeclaration-after-statement #-Wunreachable-code
333 LD = $(CC) -dynamiclib
336 JDK = /System/Library/Frameworks/JavaVM.framework/Home
337 JAVACFLAGS_OS = -dynamiclib -I/System/Library/Frameworks/JavaVM.framework/Headers -framework JavaVM
340 $(error ERROR: Must specify target OS on command-line, e.g. "make os=tiger [target]".\
341 Supported operating systems include: jaguar, panther, tiger, linux, netbsd, freebsd, openbsd, solaris)
351 NSSLIBNAME := libnss_mdns
353 NSSLIBFILE := $(NSSLIBNAME)-$(NSSVERSION).so
354 NSSLINKNAME := $(NSSLIBNAME).so.2
357 # If not otherwise defined, we install into /usr/lib and /usr/include
358 # and our startup script is called mdns (e.g. /etc/init.d/mdns)
360 STARTUPSCRIPTNAME?=mdns
362 ifeq ($(HAVE_IPV6),1)
363 CFLAGS_OS += -DHAVE_IPV6=1
365 ifeq ($(HAVE_IPV6),0)
366 CFLAGS_OS += -DHAVE_IPV6=0
370 # If directory /usr/share/man exists, then we install man pages into that, else /usr/man
371 ifeq ($(wildcard /usr/share/man), /usr/share/man)
372 MANPATH := /usr/share/man
377 # If directories /etc/init.d/rc*.d exist, then we install into that (Suse)
378 ifeq ($(wildcard /etc/init.d/rc2.d/), /etc/init.d/rc2.d/)
379 STARTUPSCRIPTDIR = /etc/init.d
380 RUNLEVELSCRIPTSDIR = /etc/init.d
382 # else if directory /etc/rc.d/init.d/ exists, then we install into that (old Linux)
383 ifeq ($(wildcard /etc/rc.d/init.d/), /etc/rc.d/init.d/)
384 STARTUPSCRIPTDIR = /etc/rc.d/init.d
385 RUNLEVELSCRIPTSDIR = /etc/rc.d
387 # else if directory /etc/init.d/ exists, then we install into that (new Linux)
388 ifeq ($(wildcard /etc/init.d/), /etc/init.d/)
389 STARTUPSCRIPTDIR = /etc/init.d
390 RUNLEVELSCRIPTSDIR = /etc
392 # else install into /etc/rc.d/ (*BSD)
393 STARTUPSCRIPTDIR = $(INSTBASE)/etc/rc.d
398 CFLAGS = $(CFLAGS_COMMON) $(CFLAGS_OS) $(CFLAGS_DEBUG)
400 #############################################################################
402 all: setup Daemon libdns_sd Client Responder ProxyResponder Identify NetMonitor dnsextd $(OPTIONALTARG)
404 install: setup InstalledDaemon InstalledLib InstalledStartup InstalledManPages $(OPTINSTALL)
406 # 'setup' sets up the build directory structure the way we want
408 @if test ! -d objects ; then mkdir objects ; fi
409 @if test ! -d build ; then mkdir build ; fi
410 @if test ! -d $(OBJDIR) ; then mkdir $(OBJDIR) ; fi
411 @if test ! -d $(BUILDDIR) ; then mkdir $(BUILDDIR) ; fi
413 # clean removes targets and objects
415 if test -d $(OBJDIR) ; then rm -r $(OBJDIR) ; fi
416 if test -d $(BUILDDIR) ; then rm -r $(BUILDDIR) ; fi
418 #############################################################################
420 # daemon target builds the daemon
421 DAEMONOBJS = $(OBJDIR)/PosixDaemon.c.o $(OBJDIR)/mDNSPosix.c.o $(OBJDIR)/mDNSUNP.c.o $(OBJDIR)/mDNS.c.o \
422 $(OBJDIR)/DNSDigest.c.o $(OBJDIR)/uDNS.c.o $(OBJDIR)/DNSCommon.c.o $(OBJDIR)/uds_daemon.c.o \
423 $(OBJDIR)/mDNSDebug.c.o $(OBJDIR)/dnssd_ipc.c.o $(OBJDIR)/GenLinkedList.c.o $(OBJDIR)/PlatformCommon.c.o
425 Daemon: setup $(BUILDDIR)/mdnsd
426 @echo "Responder daemon done"
428 $(BUILDDIR)/mdnsd: $(DAEMONOBJS)
429 $(CC) -o $@ $+ $(CFLAGS) $(LIBFLAGS)
432 # libdns_sd target builds the client library
433 libdns_sd: setup $(BUILDDIR)/libdns_sd.$(LDSUFFIX)
434 @echo "Client library done"
436 CLIENTLIBOBJS = $(OBJDIR)/dnssd_clientlib.c.so.o $(OBJDIR)/dnssd_clientstub.c.so.o $(OBJDIR)/dnssd_ipc.c.so.o
438 $(BUILDDIR)/libdns_sd.$(LDSUFFIX): $(CLIENTLIBOBJS)
439 @$(LD) $(LIBFLAGS) -o $@ $+
442 # nss_mdns target builds the Name Service Switch module
443 nss_mdns: setup $(BUILDDIR)/$(NSSLIBFILE)
444 @echo "Name Service Switch module done"
446 $(BUILDDIR)/$(NSSLIBFILE): $(CLIENTLIBOBJS) $(OBJDIR)/nss_mdns.c.so.o
447 @$(LD) $(LIBFLAGS) -o $@ $+
450 #############################################################################
452 # The Install targets place built stuff in their proper places
453 InstalledDaemon: $(INSTBASE)/sbin/mdnsd
454 @echo $+ " installed"
456 InstalledLib: $(INSTBASE)/lib/libdns_sd.$(LDSUFFIX).$(LIBVERS) $(INSTBASE)/include/dns_sd.h
457 @echo $+ " installed"
459 InstalledStartup: $(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME)
460 @echo $+ " installed"
462 InstalledNSS: $(NSSINSTPATH)/$(NSSLINKNAME) /etc/nss_mdns.conf $(MANPATH)/man5/nss_mdns.conf.5 $(MANPATH)/man8/libnss_mdns.8
463 @echo $+ " installed"
465 InstalledManPages: $(MANPATH)/man8/mdnsd.8
466 @echo $+ " installed"
468 $(INSTBASE)/sbin/mdnsd: $(BUILDDIR)/mdnsd
471 $(INSTBASE)/lib/libdns_sd.$(LDSUFFIX).$(LIBVERS): $(BUILDDIR)/libdns_sd.$(LDSUFFIX)
473 $(LN) $@ $(INSTBASE)/lib/libdns_sd.$(LDSUFFIX)
475 # -m means 'merge into existing database', -R means 'rescan directories'
479 $(INSTBASE)/include/dns_sd.h: $(SHAREDDIR)/dns_sd.h
482 $(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME): mdnsd.sh $(STARTUPSCRIPTDIR)
485 ifdef RUNLEVELSCRIPTSDIR
486 ifeq ($(wildcard $(RUNLEVELSCRIPTSDIR)/runlevels/default), $(RUNLEVELSCRIPTSDIR)/runlevels/default)
487 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/runlevels/default/mdns
489 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc2.d/S52mdns
490 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc3.d/S52mdns
491 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc4.d/S52mdns
492 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc5.d/S52mdns
493 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc0.d/K16mdns
494 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc6.d/K16mdns
498 $(NSSINSTPATH)/$(NSSLINKNAME): $(NSSINSTPATH)/$(NSSLIBFILE)
502 $(NSSINSTPATH)/$(NSSLIBFILE): $(BUILDDIR)/$(NSSLIBFILE)
506 /etc/nss_mdns.conf: nss_mdns.conf
509 # Check the nsswitch.conf file.
510 # If 'mdns' does not already appear on the "hosts:" line, then add it right before 'dns'
511 cp -f /etc/nsswitch.conf /etc/nsswitch.conf.pre-mdns
512 sed -e '/mdns/!s/^\(hosts:.*\)dns\(.*\)/\1mdns dns\2/' /etc/nsswitch.conf.pre-mdns > /etc/nsswitch.conf
514 $(MANPATH)/man5/%.5: %.5
518 $(MANPATH)/man8/%.8: %.8
522 $(MANPATH)/man8/mdnsd.8: $(SHAREDDIR)/mDNSResponder.8
526 #############################################################################
528 # The following targets build Java wrappers for the dns-sd.h API.
530 JAVAC = $(JDK)/bin/javac
531 JAVAH = $(JDK)/bin/javah
532 JAVADOC = $(JDK)/bin/javadoc
534 JAVACFLAGS = $(CFLAGS) $(JAVACFLAGS_OS) -I$(JDK)/include
536 Java: setup $(BUILDDIR)/dns_sd.jar $(BUILDDIR)/libjdns_sd.$(LDSUFFIX)
537 @echo "Java wrappers done"
539 JAVASRC = $(SHAREDDIR)/Java
540 JARCONTENTS = $(OBJDIR)/com/apple/dnssd/DNSSDService.class \
541 $(OBJDIR)/com/apple/dnssd/DNSSDException.class \
542 $(OBJDIR)/com/apple/dnssd/DNSRecord.class \
543 $(OBJDIR)/com/apple/dnssd/TXTRecord.class \
544 $(OBJDIR)/com/apple/dnssd/DNSSDRegistration.class \
545 $(OBJDIR)/com/apple/dnssd/BaseListener.class \
546 $(OBJDIR)/com/apple/dnssd/BrowseListener.class \
547 $(OBJDIR)/com/apple/dnssd/ResolveListener.class \
548 $(OBJDIR)/com/apple/dnssd/RegisterListener.class \
549 $(OBJDIR)/com/apple/dnssd/QueryListener.class \
550 $(OBJDIR)/com/apple/dnssd/DomainListener.class \
551 $(OBJDIR)/com/apple/dnssd/DNSSD.class
553 $(BUILDDIR)/dns_sd.jar: $(JARCONTENTS)
554 $(JAR) -cf $@ -C $(OBJDIR) com
556 $(BUILDDIR)/libjdns_sd.$(LDSUFFIX): $(JAVASRC)/JNISupport.c $(OBJDIR)/DNSSD.java.h
557 $(CC) -o $@ $< $(JAVACFLAGS) -I$(OBJDIR)
559 $(OBJDIR)/com/apple/dnssd/%.class: $(JAVASRC)/%.java
560 $(JAVAC) -d $(OBJDIR) -classpath $(OBJDIR) $<
562 $(OBJDIR)/DNSSD.java.h: $(OBJDIR)/com/apple/dnssd/DNSSD.class
563 $(JAVAH) -force -classpath $(OBJDIR) -o $@ \
564 com.apple.dnssd.AppleDNSSD \
565 com.apple.dnssd.AppleBrowser \
566 com.apple.dnssd.AppleResolver \
567 com.apple.dnssd.AppleRegistration \
568 com.apple.dnssd.AppleQuery \
569 com.apple.dnssd.AppleDomainEnum \
570 com.apple.dnssd.AppleService
572 #############################################################################
574 # The following target builds documentation for the Java wrappers.
577 $(JAVADOC) $(JAVASRC)/*.java -classpath $(OBJDIR) -d $(BUILDDIR) -public
579 #############################################################################
581 # The following targets build embedded example programs
582 SPECIALOBJ = $(OBJDIR)/mDNSPosix.c.o $(OBJDIR)/mDNSUNP.c.o $(OBJDIR)/mDNSDebug.c.o $(OBJDIR)/GenLinkedList.c.o $(OBJDIR)/DNSDigest.c.o $(OBJDIR)/uDNS.c.o $(OBJDIR)/DNSCommon.c.o
583 COMMONOBJ = $(SPECIALOBJ) $(OBJDIR)/mDNS.c.o
584 APPOBJ = $(COMMONOBJ) $(OBJDIR)/ExampleClientApp.c.o
586 Client: setup $(BUILDDIR)/mDNSClientPosix
587 @echo "Embedded Standalone Client done"
589 Responder: setup $(BUILDDIR)/mDNSResponderPosix
590 @echo "Embedded Standalone Responder done"
592 ProxyResponder: setup $(BUILDDIR)/mDNSProxyResponderPosix
593 @echo "Embedded Standalone ProxyResponder done"
595 Identify: setup $(BUILDDIR)/mDNSIdentify
596 @echo "Identify done"
598 NetMonitor: setup $(BUILDDIR)/mDNSNetMonitor
599 @echo "NetMonitor done"
601 dnsextd: setup $(BUILDDIR)/dnsextd
604 $(BUILDDIR)/mDNSClientPosix: $(APPOBJ) $(OBJDIR)/Client.c.o
605 $(CC) $+ -o $@ $(LIBFLAGS)
607 $(BUILDDIR)/mDNSResponderPosix: $(COMMONOBJ) $(OBJDIR)/Responder.c.o
608 $(CC) $+ -o $@ $(LIBFLAGS)
610 $(BUILDDIR)/mDNSProxyResponderPosix: $(COMMONOBJ) $(OBJDIR)/ProxyResponder.c.o
611 $(CC) $+ -o $@ $(LIBFLAGS)
613 $(BUILDDIR)/mDNSIdentify: $(SPECIALOBJ) $(OBJDIR)/Identify.c.o
614 $(CC) $+ -o $@ $(LIBFLAGS)
616 $(BUILDDIR)/mDNSNetMonitor: $(SPECIALOBJ) $(OBJDIR)/NetMonitor.c.o
617 $(CC) $+ -o $@ $(LIBFLAGS)
619 $(BUILDDIR)/dnsextd: $(SPECIALOBJ) $(OBJDIR)/dnsextd.c.threadsafe.o
620 $(CC) $+ -o $@ $(LIBFLAGS) -lpthread
622 #############################################################################
626 $(CC) $(CFLAGS) -c -o $@ $<
628 $(OBJDIR)/%.c.o: $(COREDIR)/%.c
629 $(CC) $(CFLAGS) -c -o $@ $<
631 $(OBJDIR)/%.c.o: $(SHAREDDIR)/%.c
632 $(CC) $(CFLAGS) -c -o $@ $<
634 $(OBJDIR)/%.c.threadsafe.o: %.c
635 $(CC) $(CFLAGS) -D_REENTRANT -c -o $@ $<
637 $(OBJDIR)/%.c.so.o: %.c
638 $(CC) $(CFLAGS) -c -fPIC -o $@ $<
640 $(OBJDIR)/%.c.so.o: $(SHAREDDIR)/%.c
641 $(CC) $(CFLAGS) -c -fPIC -o $@ $<