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.59 2005/04/14 21:07:10 rpantos
28 # Bug #: 4089257, Clean build broken for Java support on POSIX
29 # Submitted by: Roger Pantos
30 # Reviewed by: Kiren Sekar
32 # Revision 1.58 2005/04/08 21:37:57 ksekar
33 # <rdar://problem/3792767> get_ifi_info doesn't return IPv6 interfaces on Linux
35 # Revision 1.57 2005/03/17 04:02:28 cheshire
36 # <rdar://problem/3986419> mDNSResponder won't compile with gcc4 on Tiger
37 # Changed Makefile to link using gcc instead of libtool
39 # Revision 1.56 2005/02/02 02:25:21 cheshire
40 # <rdar://problem/3980388> /var/run/mDNSResponder should be /var/run/mdnsd on Linux
42 # Revision 1.55 2005/01/27 22:55:00 cheshire
43 # Add "make os=tiger" target which uses gcc4 and "-Wdeclaration-after-statement"
45 # Revision 1.54 2004/12/17 19:33:03 cheshire
46 # Add "-lresolv" for Solaris
48 # Revision 1.53 2004/12/01 20:04:31 cheshire
51 # Revision 1.52 2004/12/01 19:46:12 cheshire
52 # Add install case for Suse 9 (rc*.d directories *inside* the init.d directory)
54 # Revision 1.51 2004/12/01 03:30:29 cheshire
55 # <rdar://problem/3889346> Add Unicast DNS support to mDNSPosix
57 # Revision 1.50 2004/12/01 01:14:20 cheshire
58 # Add $(LIBFLAGS) to cc command to build dnsextd (required for Solaris)
60 # Revision 1.49 2004/11/11 01:44:52 cheshire
61 # Updated error message
63 # Revision 1.48 2004/10/06 02:22:19 cheshire
64 # Changed MacRoman copyright symbol (should have been UTF-8 in any case :-) to ASCII-compatible "(c)"
66 # Revision 1.47 2004/10/01 22:15:54 rpantos
67 # rdar://problem/3824265: Replace APSL in client lib with BSD license.
69 # Revision 1.46 2004/09/24 21:15:25 cheshire
70 # <rdar://problem/3724985> Library "libmdns" misnamed; should be "libdns_sd"
72 # Revision 1.45 2004/09/22 16:23:41 cheshire
73 # Modify installation for compatibility with Gentoo Linux
74 # (Thanks to David Black for this information)
76 # Revision 1.44 2004/09/17 01:08:53 cheshire
77 # Renamed mDNSClientAPI.h to mDNSEmbeddedAPI.h
78 # The name "mDNSClientAPI.h" is misleading to new developers looking at this code. The interfaces
79 # declared in that file are ONLY appropriate to single-address-space embedded applications.
80 # For clients on general-purpose computers, the interfaces defined in dns_sd.h should be used.
82 # Revision 1.43 2004/09/17 00:30:11 cheshire
83 # Added some '@' signs to make build output less verbose --
84 # when there's too much on the screen it's easy to miss build errors and warnings
86 # Revision 1.42 2004/08/24 22:04:37 cheshire
87 # Need to specify -lpthread for building dnsextd
89 # Revision 1.41 2004/08/11 00:43:26 ksekar
90 # <rdar://problem/3722542>: DNS Extension daemon for DNS Update Lease
92 # Revision 1.40 2004/07/08 21:45:55 cheshire
93 # Make nss_mdns only build on Linux. We can add it to other targets (Solaris,
94 # FreeBSD, etc., as we verify them). In particular, NSS is NOT supported on
95 # OS X, so including it for "os=jaguar" or "os=panther" broke those builds.
97 # Revision 1.39 2004/06/29 03:34:28 cheshire
98 # Add 'dot-local' Name Service Switch support from Andrew White at NICTA
100 # Revision 1.38 2004/06/25 02:19:40 rpantos
103 # Revision 1.37 2004/06/25 00:51:09 rpantos
104 # And fix the Java build for Posix on Solaris, too.
106 # Revision 1.36 2004/06/25 00:26:27 rpantos
107 # Changes to fix the Posix build on Solaris.
109 # Revision 1.35 2004/06/18 18:51:31 cheshire
110 # Add (commented out) "-pedantic" for when we want to check for "mixed declarations and code" warnings
112 # Revision 1.34 2004/05/25 18:29:33 cheshire
113 # Move DNSServiceConstructFullName() from dnssd_clientstub.c to dnssd_clientlib.c,
114 # so that it's also accessible to dnssd_clientshim.c (single address space) clients.
116 # Revision 1.33 2004/04/30 16:46:32 rpantos
117 # Add support for building Java libraries.
119 # Revision 1.32 2004/04/14 23:09:29 ksekar
120 # Support for TSIG signed dynamic updates.
122 # Revision 1.31 2004/03/15 19:07:06 cheshire
125 # Revision 1.30 2004/03/11 18:58:29 rpantos
126 # Fix Kill /etc/rc scripts so they run at halt & reboot.
128 # Revision 1.29 2004/03/04 23:35:41 cheshire
129 # Instead of using a dummy target to generate an error message, use "$(error text...)"
131 # Revision 1.28 2004/03/04 23:33:42 cheshire
132 # Fixes from Alfred Perlstein for FreeBSD's benefit
134 # Revision 1.27 2004/02/11 21:00:21 cheshire
135 # Update URL for GNU Make manual page
137 # Revision 1.26 2004/02/05 21:28:30 cheshire
138 # Fixes so that "sudo make install" works on *BSD
140 # Revision 1.25 2004/02/05 20:00:22 cheshire
141 # Define mdnsd's PID file to be /var/run/mdnsd.pid on Posix builds
143 # Revision 1.24 2004/02/05 01:00:01 rpantos
144 # Fix some issues that turned up when building for FreeBSD.
146 # Revision 1.23 2004/02/04 01:50:54 cheshire
147 # Make InstalledStartup conditional, so it automatically installs into
148 # either /etc/init.d/ or /etc/rc.d/init.d/ as appropriate
150 # Revision 1.22 2004/01/20 01:41:21 rpantos
151 # Define USES_NETLINK for Linux builds.
153 # Revision 1.21 2003/12/17 00:51:22 cheshire
154 # Changed mDNSNetMonitor and mDNSIdentify to link the object files
155 # instead of #including the "DNSCommon.c" "uDNS.c" and source files
157 # Revision 1.20 2003/12/13 03:05:28 ksekar
158 # Bug #: <rdar://problem/3192548>: DynDNS: Unicast query of service records
160 # Revision 1.19 2003/12/11 19:42:13 cheshire
161 # Change name "mDNSResponderd" to "mdnsd" for consistency with standard Linux (Unix) naming conventions
163 # Revision 1.18 2003/12/11 19:38:34 cheshire
166 # Revision 1.17 2003/12/11 03:16:49 rpantos
167 # One more change for OS X build: make install work a little better.
169 # Revision 1.16 2003/12/11 03:03:51 rpantos
170 # Clean up mDNSPosix so that it builds on OS X again.
172 # Revision 1.15 2003/12/08 20:47:02 rpantos
173 # Add support for mDNSResponder on Linux.
175 # Revision 1.14 2003/11/14 20:59:09 cheshire
176 # Clients can't use AssignDomainName macro because mDNSPlatformMemCopy is defined in mDNSPlatformFunctions.h.
177 # Best solution is just to combine mDNSEmbeddedAPI.h and mDNSPlatformFunctions.h into a single file.
179 # Revision 1.13 2003/08/06 18:20:51 cheshire
182 # Revision 1.12 2003/08/01 02:20:02 cheshire
183 # Add mDNSIdentify tool, used to discover what version of mDNSResponder a particular host is running
185 # Revision 1.11 2003/07/14 18:11:54 cheshire
186 # Fix stricter compiler warnings
188 # Revision 1.10 2003/06/18 05:47:41 cheshire
189 # Enable stricter warnings on Jaguar and Panther builds
191 # Revision 1.9 2003/06/04 18:34:45 ksekar
192 # Bug #: <rdar://problem/3218120>: mDNSPosix does not build on Panther that has socklen_t
193 # Changed build targets "osx10.2" and "osx10.3" to "jaguar" and "panther".
195 # Revision 1.8 2003/06/04 00:23:12 ksekar
196 # Bug #: <rdar://problem/3218120>: mDNSPosix does not build on Panther that has socklen_t
197 # Created separate target OS's for 10.2 and 10.3.
199 # Revision 1.7 2003/04/16 02:11:37 cheshire
200 # Remove unnecessary $(CFLAGS) from linking rules
202 # Revision 1.6 2003/04/04 01:37:14 cheshire
206 # This Makefile builds an mDNSResponder daemon and a libdns_sd.so shared library
207 # for Linux. It also builds several example programs for embedded systems.
209 # Make with no arguments to build all production targets.
210 # 'make DEBUG=1' to build debugging targets.
211 # 'make clean' or 'make clean DEBUG=1' to delete prod/debug objects & targets
212 # 'sudo make install [DEBUG=1]' to install mdnsd daemon and libdns_sd.
215 # $@ means "The file name of the target of the rule"
216 # $< means "The name of the first prerequisite"
217 # $+ means "The names of all the prerequisites, with spaces between them, exactly as given"
218 # For more magic automatic variables, see
219 # <http://www.gnu.org/software/make/manual/html_chapter/make_10.html#SEC111>
221 #############################################################################
225 COREDIR = ../mDNSCore
226 SHAREDDIR = ../mDNSShared
234 CFLAGS_COMMON = -I. -I$(COREDIR) -I$(SHAREDDIR) -W -Wall -DPID_FILE=\"/var/run/mdnsd.pid\" -DMDNS_UDS_SERVERPATH=\"/var/run/mdnsd\"
236 DNSEXT_FLAGS = -D_REENTRANT -g -Wall -lpthread
238 JAVACFLAGS_OS = -fPIC -shared -ldns_sd
240 # Set up diverging paths for debug vs. prod builds
243 CFLAGS_DEBUG = -g -DMDNS_DEBUGMSGS=2
244 OBJDIR = objects/debug
245 BUILDDIR = build/debug
248 CFLAGS_DEBUG = -O0 -DMDNS_DEBUGMSGS=0
249 OBJDIR = objects/prod
250 BUILDDIR = build/prod
254 # Configure per-OS peculiarities
256 CFLAGS_OS = -DNOT_HAVE_DAEMON -DNOT_HAVE_SA_LEN -DNOT_HAVE_SOCKLEN_T -DNOT_HAVE_IF_NAMETOINDEX \
257 -DLOG_PERROR=0 -D_XPG4_2 -D__EXTENSIONS__ -DHAVE_BROKEN_RECVIF_NAME -DUSE_TCP_LOOPBACK
260 LIBFLAGS = -lsocket -lnsl -lresolv
261 JAVACFLAGS_OS += -I$(JDK)/include/solaris
268 CFLAGS_OS = -DNOT_HAVE_SA_LEN -DUSES_NETLINK -DHAVE_LINUX
269 JAVACFLAGS_OS += -I$(JDK)/include/linux
270 OPTIONALTARG = nss_mdns
271 OPTINSTALL = InstalledNSS
280 # If not already defined, set LOCALBASE to /usr/local
281 # FreeBSD requires the startup script to end in ".sh"
282 LOCALBASE?=/usr/local
283 INSTBASE=$(LOCALBASE)
284 STARTUPSCRIPTNAME=mdns.sh
286 JAVACFLAGS_OS += -I$(JDK)/include/freebsd
291 CFLAGS_OS = -DHAVE_BROKEN_RECVDSTADDR
296 CFLAGS_OS = -DHAVE_IPV6 -no-cpp-precomp -DNOT_HAVE_SOCKLEN_T
297 LD = libtool -dynamic
300 JDK = /System/Library/Frameworks/JavaVM.framework/Home
301 JAVACFLAGS_OS = -dynamiclib -I/System/Library/Frameworks/JavaVM.framework/Headers -framework JavaVM
305 CFLAGS_OS = -DHAVE_IPV6 -no-cpp-precomp #-pedantic
306 LD = libtool -dynamic
309 JDK = /System/Library/Frameworks/JavaVM.framework/Home
310 JAVACFLAGS_OS = -dynamiclib -I/System/Library/Frameworks/JavaVM.framework/Headers -framework JavaVM
314 CFLAGS_OS = -DHAVE_IPV6 -no-cpp-precomp -Wdeclaration-after-statement
316 LD = $(CC) -dynamiclib
319 JDK = /System/Library/Frameworks/JavaVM.framework/Home
320 JAVACFLAGS_OS = -dynamiclib -I/System/Library/Frameworks/JavaVM.framework/Headers -framework JavaVM
323 $(error ERROR: Must specify target OS on command-line, e.g. "make os=tiger [target]".\
324 Supported operating systems include: jaguar, panther, linux, netbsd, freebsd, openbsd, solaris)
334 NSSLIBNAME := libnss_mdns
336 NSSLIBFILE := $(NSSLIBNAME)-$(NSSVERSION).so
337 NSSLINKNAME := $(NSSLIBNAME).so.2
340 # If not otherwise defined, we install into /usr/lib and /usr/include
341 # and our startup script is called mdns (e.g. /etc/init.d/mdns)
343 STARTUPSCRIPTNAME?=mdns
345 ifeq ($(HAVE_IPV6),1)
346 CFLAGS_OS += -DHAVE_IPV6=1
348 ifeq ($(HAVE_IPV6),0)
349 CFLAGS_OS += -DHAVE_IPV6=0
353 # If directory /usr/share/man exists, then we install man pages into that, else /usr/man
354 ifeq ($(wildcard /usr/share/man), /usr/share/man)
355 MANPATH := /usr/share/man
360 # If directories /etc/init.d/rc*.d exist, then we install into that (Suse)
361 ifeq ($(wildcard /etc/init.d/rc2.d/), /etc/init.d/rc2.d/)
362 STARTUPSCRIPTDIR = /etc/init.d
363 RUNLEVELSCRIPTSDIR = /etc/init.d
365 # else if directory /etc/rc.d/init.d/ exists, then we install into that (old Linux)
366 ifeq ($(wildcard /etc/rc.d/init.d/), /etc/rc.d/init.d/)
367 STARTUPSCRIPTDIR = /etc/rc.d/init.d
368 RUNLEVELSCRIPTSDIR = /etc/rc.d
370 # else if directory /etc/init.d/ exists, then we install into that (new Linux)
371 ifeq ($(wildcard /etc/init.d/), /etc/init.d/)
372 STARTUPSCRIPTDIR = /etc/init.d
373 RUNLEVELSCRIPTSDIR = /etc
375 # else install into /etc/rc.d/ (*BSD)
376 STARTUPSCRIPTDIR = $(INSTBASE)/etc/rc.d
381 CFLAGS = $(CFLAGS_COMMON) $(CFLAGS_OS) $(CFLAGS_DEBUG)
383 #############################################################################
385 all: setup Daemon libdns_sd Client Responder ProxyResponder Identify NetMonitor dnsextd $(OPTIONALTARG)
387 install: setup InstalledDaemon InstalledLib InstalledStartup InstalledManPages $(OPTINSTALL)
389 # 'setup' sets up the build directory structure the way we want
391 @if test ! -d objects ; then mkdir objects ; fi
392 @if test ! -d build ; then mkdir build ; fi
393 @if test ! -d $(OBJDIR) ; then mkdir $(OBJDIR) ; fi
394 @if test ! -d $(BUILDDIR) ; then mkdir $(BUILDDIR) ; fi
396 # clean removes targets and objects
398 if test -d $(OBJDIR) ; then rm -r $(OBJDIR) ; fi
399 if test -d $(BUILDDIR) ; then rm -r $(BUILDDIR) ; fi
401 #############################################################################
403 # daemon target builds the daemon
404 DAEMONOBJS = $(OBJDIR)/PosixDaemon.c.o $(OBJDIR)/mDNSPosix.c.o $(OBJDIR)/mDNSUNP.c.o $(OBJDIR)/mDNS.c.o \
405 $(OBJDIR)/DNSDigest.c.o $(OBJDIR)/uDNS.c.o $(OBJDIR)/DNSCommon.c.o $(OBJDIR)/uds_daemon.c.o \
406 $(OBJDIR)/mDNSDebug.c.o $(OBJDIR)/dnssd_ipc.c.o $(OBJDIR)/GenLinkedList.c.o $(OBJDIR)/PlatformCommon.c.o
408 Daemon: setup $(BUILDDIR)/mdnsd
409 @echo "Responder daemon done"
411 $(BUILDDIR)/mdnsd: $(DAEMONOBJS)
412 $(CC) -o $@ $+ $(CFLAGS) $(LIBFLAGS)
415 # libdns_sd target builds the client library
416 libdns_sd: setup $(BUILDDIR)/libdns_sd.$(LDSUFFIX)
417 @echo "Client library done"
419 CLIENTLIBOBJS = $(OBJDIR)/dnssd_clientlib.c.so.o $(OBJDIR)/dnssd_clientstub.c.so.o $(OBJDIR)/dnssd_ipc.c.so.o
421 $(BUILDDIR)/libdns_sd.$(LDSUFFIX): $(CLIENTLIBOBJS)
422 @$(LD) $(LIBFLAGS) -o $@ $+
425 # nss_mdns target builds the Name Service Switch module
426 nss_mdns: setup $(BUILDDIR)/$(NSSLIBFILE)
427 @echo "Name Service Switch module done"
429 $(BUILDDIR)/$(NSSLIBFILE): $(CLIENTLIBOBJS) $(OBJDIR)/nss_mdns.c.so.o
430 @$(LD) $(LIBFLAGS) -o $@ $+
433 #############################################################################
435 # The Install targets place built stuff in their proper places
436 InstalledDaemon: $(INSTBASE)/sbin/mdnsd
437 @echo $+ " installed"
439 InstalledLib: $(INSTBASE)/lib/libdns_sd.$(LDSUFFIX).$(LIBVERS) $(INSTBASE)/include/dns_sd.h
440 @echo $+ " installed"
442 InstalledStartup: $(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME)
443 @echo $+ " installed"
445 InstalledNSS: $(NSSINSTPATH)/$(NSSLINKNAME) /etc/nss_mdns.conf $(MANPATH)/man5/nss_mdns.conf.5 $(MANPATH)/man8/libnss_mdns.8
446 @echo $+ " installed"
448 InstalledManPages: $(MANPATH)/man8/mdnsd.8
449 @echo $+ " installed"
451 $(INSTBASE)/sbin/mdnsd: $(BUILDDIR)/mdnsd
454 $(INSTBASE)/lib/libdns_sd.$(LDSUFFIX).$(LIBVERS): $(BUILDDIR)/libdns_sd.$(LDSUFFIX)
456 $(LN) $@ $(INSTBASE)/lib/libdns_sd.$(LDSUFFIX)
458 # -m means 'merge into existing database', -R means 'rescan directories'
462 $(INSTBASE)/include/dns_sd.h: $(SHAREDDIR)/dns_sd.h
465 $(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME): mdnsd.sh $(STARTUPSCRIPTDIR)
468 ifdef RUNLEVELSCRIPTSDIR
469 ifeq ($(wildcard $(RUNLEVELSCRIPTSDIR)/runlevels/default), $(RUNLEVELSCRIPTSDIR)/runlevels/default)
470 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/runlevels/default/mdns
472 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc2.d/S52mdns
473 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc3.d/S52mdns
474 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc4.d/S52mdns
475 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc5.d/S52mdns
476 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc0.d/K16mdns
477 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc6.d/K16mdns
481 $(NSSINSTPATH)/$(NSSLINKNAME): $(NSSINSTPATH)/$(NSSLIBFILE)
485 $(NSSINSTPATH)/$(NSSLIBFILE): $(BUILDDIR)/$(NSSLIBFILE)
489 /etc/nss_mdns.conf: nss_mdns.conf
492 # Check the nsswitch.conf file.
493 # If 'mdns' does not already appear on the "hosts:" line, then add it right before 'dns'
494 cp -f /etc/nsswitch.conf /etc/nsswitch.conf.pre-mdns
495 sed -e '/mdns/!s/^\(hosts:.*\)dns\(.*\)/\1mdns dns\2/' /etc/nsswitch.conf.pre-mdns > /etc/nsswitch.conf
497 $(MANPATH)/man5/%.5: %.5
501 $(MANPATH)/man8/%.8: %.8
505 $(MANPATH)/man8/mdnsd.8: $(SHAREDDIR)/mDNSResponder.8
509 #############################################################################
511 # The following targets build Java wrappers for the dns-sd.h API.
513 JAVAC = $(JDK)/bin/javac
514 JAVAH = $(JDK)/bin/javah
515 JAVADOC = $(JDK)/bin/javadoc
517 JAVACFLAGS = $(CFLAGS) $(JAVACFLAGS_OS) -I$(JDK)/include
519 Java: setup $(BUILDDIR)/dns_sd.jar $(BUILDDIR)/libjdns_sd.$(LDSUFFIX)
520 @echo "Java wrappers done"
522 JAVASRC = $(SHAREDDIR)/Java
523 JARCONTENTS = $(OBJDIR)/com/apple/dnssd/DNSSDService.class \
524 $(OBJDIR)/com/apple/dnssd/DNSSDException.class \
525 $(OBJDIR)/com/apple/dnssd/DNSRecord.class \
526 $(OBJDIR)/com/apple/dnssd/TXTRecord.class \
527 $(OBJDIR)/com/apple/dnssd/DNSSDRegistration.class \
528 $(OBJDIR)/com/apple/dnssd/BaseListener.class \
529 $(OBJDIR)/com/apple/dnssd/BrowseListener.class \
530 $(OBJDIR)/com/apple/dnssd/ResolveListener.class \
531 $(OBJDIR)/com/apple/dnssd/RegisterListener.class \
532 $(OBJDIR)/com/apple/dnssd/QueryListener.class \
533 $(OBJDIR)/com/apple/dnssd/DomainListener.class \
534 $(OBJDIR)/com/apple/dnssd/DNSSD.class
536 $(BUILDDIR)/dns_sd.jar: $(JARCONTENTS)
537 $(JAR) -cf $@ -C $(OBJDIR) com
539 $(BUILDDIR)/libjdns_sd.$(LDSUFFIX): $(JAVASRC)/JNISupport.c $(OBJDIR)/DNSSD.java.h
540 $(CC) -o $@ $< $(JAVACFLAGS) -I$(OBJDIR)
542 $(OBJDIR)/com/apple/dnssd/%.class: $(JAVASRC)/%.java
543 $(JAVAC) -d $(OBJDIR) -classpath $(OBJDIR) $<
545 $(OBJDIR)/DNSSD.java.h: $(OBJDIR)/com/apple/dnssd/DNSSD.class
546 $(JAVAH) -force -classpath $(OBJDIR) -o $@ \
547 com.apple.dnssd.AppleDNSSD \
548 com.apple.dnssd.AppleBrowser \
549 com.apple.dnssd.AppleResolver \
550 com.apple.dnssd.AppleRegistration \
551 com.apple.dnssd.AppleQuery \
552 com.apple.dnssd.AppleDomainEnum \
553 com.apple.dnssd.AppleService
555 #############################################################################
557 # The following target builds documentation for the Java wrappers.
560 $(JAVADOC) $(JAVASRC)/*.java -classpath $(OBJDIR) -d $(BUILDDIR) -public
562 #############################################################################
564 # The following targets build embedded example programs
565 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
566 COMMONOBJ = $(SPECIALOBJ) $(OBJDIR)/mDNS.c.o
567 APPOBJ = $(COMMONOBJ) $(OBJDIR)/ExampleClientApp.c.o
569 Client: setup $(BUILDDIR)/mDNSClientPosix
570 @echo "Embedded Standalone Client done"
572 Responder: setup $(BUILDDIR)/mDNSResponderPosix
573 @echo "Embedded Standalone Responder done"
575 ProxyResponder: setup $(BUILDDIR)/mDNSProxyResponderPosix
576 @echo "Embedded Standalone ProxyResponder done"
578 Identify: setup $(BUILDDIR)/mDNSIdentify
579 @echo "Identify done"
581 NetMonitor: setup $(BUILDDIR)/mDNSNetMonitor
582 @echo "NetMonitor done"
584 dnsextd: setup $(BUILDDIR)/dnsextd
587 $(BUILDDIR)/mDNSClientPosix: $(APPOBJ) $(OBJDIR)/Client.c.o
588 $(CC) $+ -o $@ $(LIBFLAGS)
590 $(BUILDDIR)/mDNSResponderPosix: $(COMMONOBJ) $(OBJDIR)/Responder.c.o
591 $(CC) $+ -o $@ $(LIBFLAGS)
593 $(BUILDDIR)/mDNSProxyResponderPosix: $(COMMONOBJ) $(OBJDIR)/ProxyResponder.c.o
594 $(CC) $+ -o $@ $(LIBFLAGS)
596 $(BUILDDIR)/mDNSIdentify: $(SPECIALOBJ) $(OBJDIR)/Identify.c.o
597 $(CC) $+ -o $@ $(LIBFLAGS)
599 $(BUILDDIR)/mDNSNetMonitor: $(SPECIALOBJ) $(OBJDIR)/NetMonitor.c.o
600 $(CC) $+ -o $@ $(LIBFLAGS)
602 $(BUILDDIR)/dnsextd: $(SPECIALOBJ) $(OBJDIR)/dnsextd.c.o
603 $(CC) $+ -o $@ $(LIBFLAGS) $(DNSEXT_FLAGS)
605 #############################################################################
609 $(CC) $(CFLAGS) -c -o $@ $<
611 $(OBJDIR)/%.c.o: $(COREDIR)/%.c
612 $(CC) $(CFLAGS) -c -o $@ $<
614 $(OBJDIR)/%.c.o: $(SHAREDDIR)/%.c
615 $(CC) $(CFLAGS) -c -o $@ $<
617 $(OBJDIR)/%.c.so.o: %.c
618 $(CC) $(CFLAGS) -c -fPIC -o $@ $<
620 $(OBJDIR)/%.c.so.o: $(SHAREDDIR)/%.c
621 $(CC) $(CFLAGS) -c -fPIC -o $@ $<