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.56 2005/02/02 02:25:21 cheshire
28 # <rdar://problem/3980388> /var/run/mDNSResponder should be /var/run/mdnsd on Linux
30 # Revision 1.55 2005/01/27 22:55:00 cheshire
31 # Add "make os=tiger" target which uses gcc4 and "-Wdeclaration-after-statement"
33 # Revision 1.54 2004/12/17 19:33:03 cheshire
34 # Add "-lresolv" for Solaris
36 # Revision 1.53 2004/12/01 20:04:31 cheshire
39 # Revision 1.52 2004/12/01 19:46:12 cheshire
40 # Add install case for Suse 9 (rc*.d directories *inside* the init.d directory)
42 # Revision 1.51 2004/12/01 03:30:29 cheshire
43 # <rdar://problem/3889346> Add Unicast DNS support to mDNSPosix
45 # Revision 1.50 2004/12/01 01:14:20 cheshire
46 # Add $(LIBFLAGS) to cc command to build dnsextd (required for Solaris)
48 # Revision 1.49 2004/11/11 01:44:52 cheshire
49 # Updated error message
51 # Revision 1.48 2004/10/06 02:22:19 cheshire
52 # Changed MacRoman copyright symbol (should have been UTF-8 in any case :-) to ASCII-compatible "(c)"
54 # Revision 1.47 2004/10/01 22:15:54 rpantos
55 # rdar://problem/3824265: Replace APSL in client lib with BSD license.
57 # Revision 1.46 2004/09/24 21:15:25 cheshire
58 # <rdar://problem/3724985> Library "libmdns" misnamed; should be "libdns_sd"
60 # Revision 1.45 2004/09/22 16:23:41 cheshire
61 # Modify installation for compatibility with Gentoo Linux
62 # (Thanks to David Black for this information)
64 # Revision 1.44 2004/09/17 01:08:53 cheshire
65 # Renamed mDNSClientAPI.h to mDNSEmbeddedAPI.h
66 # The name "mDNSClientAPI.h" is misleading to new developers looking at this code. The interfaces
67 # declared in that file are ONLY appropriate to single-address-space embedded applications.
68 # For clients on general-purpose computers, the interfaces defined in dns_sd.h should be used.
70 # Revision 1.43 2004/09/17 00:30:11 cheshire
71 # Added some '@' signs to make build output less verbose --
72 # when there's too much on the screen it's easy to miss build errors and warnings
74 # Revision 1.42 2004/08/24 22:04:37 cheshire
75 # Need to specify -lpthread for building dnsextd
77 # Revision 1.41 2004/08/11 00:43:26 ksekar
78 # <rdar://problem/3722542>: DNS Extension daemon for DNS Update Lease
80 # Revision 1.40 2004/07/08 21:45:55 cheshire
81 # Make nss_mdns only build on Linux. We can add it to other targets (Solaris,
82 # FreeBSD, etc., as we verify them). In particular, NSS is NOT supported on
83 # OS X, so including it for "os=jaguar" or "os=panther" broke those builds.
85 # Revision 1.39 2004/06/29 03:34:28 cheshire
86 # Add 'dot-local' Name Service Switch support from Andrew White at NICTA
88 # Revision 1.38 2004/06/25 02:19:40 rpantos
91 # Revision 1.37 2004/06/25 00:51:09 rpantos
92 # And fix the Java build for Posix on Solaris, too.
94 # Revision 1.36 2004/06/25 00:26:27 rpantos
95 # Changes to fix the Posix build on Solaris.
97 # Revision 1.35 2004/06/18 18:51:31 cheshire
98 # Add (commented out) "-pedantic" for when we want to check for "mixed declarations and code" warnings
100 # Revision 1.34 2004/05/25 18:29:33 cheshire
101 # Move DNSServiceConstructFullName() from dnssd_clientstub.c to dnssd_clientlib.c,
102 # so that it's also accessible to dnssd_clientshim.c (single address space) clients.
104 # Revision 1.33 2004/04/30 16:46:32 rpantos
105 # Add support for building Java libraries.
107 # Revision 1.32 2004/04/14 23:09:29 ksekar
108 # Support for TSIG signed dynamic updates.
110 # Revision 1.31 2004/03/15 19:07:06 cheshire
113 # Revision 1.30 2004/03/11 18:58:29 rpantos
114 # Fix Kill /etc/rc scripts so they run at halt & reboot.
116 # Revision 1.29 2004/03/04 23:35:41 cheshire
117 # Instead of using a dummy target to generate an error message, use "$(error text...)"
119 # Revision 1.28 2004/03/04 23:33:42 cheshire
120 # Fixes from Alfred Perlstein for FreeBSD's benefit
122 # Revision 1.27 2004/02/11 21:00:21 cheshire
123 # Update URL for GNU Make manual page
125 # Revision 1.26 2004/02/05 21:28:30 cheshire
126 # Fixes so that "sudo make install" works on *BSD
128 # Revision 1.25 2004/02/05 20:00:22 cheshire
129 # Define mdnsd's PID file to be /var/run/mdnsd.pid on Posix builds
131 # Revision 1.24 2004/02/05 01:00:01 rpantos
132 # Fix some issues that turned up when building for FreeBSD.
134 # Revision 1.23 2004/02/04 01:50:54 cheshire
135 # Make InstalledStartup conditional, so it automatically installs into
136 # either /etc/init.d/ or /etc/rc.d/init.d/ as appropriate
138 # Revision 1.22 2004/01/20 01:41:21 rpantos
139 # Define USES_NETLINK for Linux builds.
141 # Revision 1.21 2003/12/17 00:51:22 cheshire
142 # Changed mDNSNetMonitor and mDNSIdentify to link the object files
143 # instead of #including the "DNSCommon.c" "uDNS.c" and source files
145 # Revision 1.20 2003/12/13 03:05:28 ksekar
146 # Bug #: <rdar://problem/3192548>: DynDNS: Unicast query of service records
148 # Revision 1.19 2003/12/11 19:42:13 cheshire
149 # Change name "mDNSResponderd" to "mdnsd" for consistency with standard Linux (Unix) naming conventions
151 # Revision 1.18 2003/12/11 19:38:34 cheshire
154 # Revision 1.17 2003/12/11 03:16:49 rpantos
155 # One more change for OS X build: make install work a little better.
157 # Revision 1.16 2003/12/11 03:03:51 rpantos
158 # Clean up mDNSPosix so that it builds on OS X again.
160 # Revision 1.15 2003/12/08 20:47:02 rpantos
161 # Add support for mDNSResponder on Linux.
163 # Revision 1.14 2003/11/14 20:59:09 cheshire
164 # Clients can't use AssignDomainName macro because mDNSPlatformMemCopy is defined in mDNSPlatformFunctions.h.
165 # Best solution is just to combine mDNSEmbeddedAPI.h and mDNSPlatformFunctions.h into a single file.
167 # Revision 1.13 2003/08/06 18:20:51 cheshire
170 # Revision 1.12 2003/08/01 02:20:02 cheshire
171 # Add mDNSIdentify tool, used to discover what version of mDNSResponder a particular host is running
173 # Revision 1.11 2003/07/14 18:11:54 cheshire
174 # Fix stricter compiler warnings
176 # Revision 1.10 2003/06/18 05:47:41 cheshire
177 # Enable stricter warnings on Jaguar and Panther builds
179 # Revision 1.9 2003/06/04 18:34:45 ksekar
180 # Bug #: <rdar://problem/3218120>: mDNSPosix does not build on Panther that has socklen_t
181 # Changed build targets "osx10.2" and "osx10.3" to "jaguar" and "panther".
183 # Revision 1.8 2003/06/04 00:23:12 ksekar
184 # Bug #: <rdar://problem/3218120>: mDNSPosix does not build on Panther that has socklen_t
185 # Created separate target OS's for 10.2 and 10.3.
187 # Revision 1.7 2003/04/16 02:11:37 cheshire
188 # Remove unnecessary $(CFLAGS) from linking rules
190 # Revision 1.6 2003/04/04 01:37:14 cheshire
194 # This Makefile builds an mDNSResponder daemon and a libdns_sd.so shared library
195 # for Linux. It also builds several example programs for embedded systems.
197 # Make with no arguments to build all production targets.
198 # 'make DEBUG=1' to build debugging targets.
199 # 'make clean' or 'make clean DEBUG=1' to delete prod/debug objects & targets
200 # 'sudo make install [DEBUG=1]' to install mdnsd daemon and libdns_sd.
203 # $@ means "The file name of the target of the rule"
204 # $< means "The name of the first prerequisite"
205 # $+ means "The names of all the prerequisites, with spaces between them, exactly as given"
206 # For more magic automatic variables, see
207 # <http://www.gnu.org/software/make/manual/html_chapter/make_10.html#SEC111>
209 #############################################################################
213 COREDIR = ../mDNSCore
214 SHAREDDIR = ../mDNSShared
222 CFLAGS_COMMON = -I. -I$(COREDIR) -I$(SHAREDDIR) -W -Wall -DPID_FILE=\"/var/run/mdnsd.pid\" -DMDNS_UDS_SERVERPATH=\"/var/run/mdnsd\"
224 DNSEXT_FLAGS = -D_REENTRANT -g -Wall -lpthread
226 JAVACFLAGS_OS = -fPIC -shared -ldns_sd
228 # Set up diverging paths for debug vs. prod builds
231 CFLAGS_DEBUG = -g -DMDNS_DEBUGMSGS=2
232 OBJDIR = objects/debug
233 BUILDDIR = build/debug
236 CFLAGS_DEBUG = -O0 -DMDNS_DEBUGMSGS=0
237 OBJDIR = objects/prod
238 BUILDDIR = build/prod
242 # Configure per-OS peculiarities
244 CFLAGS_OS = -DNOT_HAVE_DAEMON -DNOT_HAVE_SA_LEN -DNOT_HAVE_SOCKLEN_T -DNOT_HAVE_IF_NAMETOINDEX \
245 -DLOG_PERROR=0 -D_XPG4_2 -D__EXTENSIONS__ -DHAVE_BROKEN_RECVIF_NAME -DUSE_TCP_LOOPBACK
248 LIBFLAGS = -lsocket -lnsl -lresolv
249 JAVACFLAGS_OS += -I$(JDK)/include/solaris
256 CFLAGS_OS = -DNOT_HAVE_SA_LEN -DUSES_NETLINK
257 JAVACFLAGS_OS += -I$(JDK)/include/linux
258 OPTIONALTARG = nss_mdns
259 OPTINSTALL = InstalledNSS
268 # If not already defined, set LOCALBASE to /usr/local
269 # FreeBSD requires the startup script to end in ".sh"
270 LOCALBASE?=/usr/local
271 INSTBASE=$(LOCALBASE)
272 STARTUPSCRIPTNAME=mdns.sh
274 JAVACFLAGS_OS += -I$(JDK)/include/freebsd
279 CFLAGS_OS = -DHAVE_BROKEN_RECVDSTADDR
284 CFLAGS_OS = -DHAVE_IPV6 -no-cpp-precomp -DNOT_HAVE_SOCKLEN_T
285 LD = libtool -dynamic
288 JDK = /System/Library/Frameworks/JavaVM.framework/Home
289 JAVACFLAGS_OS = -dynamiclib -I/System/Library/Frameworks/JavaVM.framework/Headers -framework JavaVM
293 CFLAGS_OS = -DHAVE_IPV6 -no-cpp-precomp #-pedantic
294 LD = libtool -dynamic
297 JDK = /System/Library/Frameworks/JavaVM.framework/Home
298 JAVACFLAGS_OS = -dynamiclib -I/System/Library/Frameworks/JavaVM.framework/Headers -framework JavaVM
302 CFLAGS_OS = -DHAVE_IPV6 -no-cpp-precomp -Wdeclaration-after-statement
304 LD = libtool -dynamic
307 JDK = /System/Library/Frameworks/JavaVM.framework/Home
308 JAVACFLAGS_OS = -dynamiclib -I/System/Library/Frameworks/JavaVM.framework/Headers -framework JavaVM
311 $(error ERROR: Must specify target OS on command-line, e.g. "make os=tiger [target]".\
312 Supported operating systems include: jaguar, panther, linux, netbsd, freebsd, openbsd, solaris)
322 NSSLIBNAME := libnss_mdns
324 NSSLIBFILE := $(NSSLIBNAME)-$(NSSVERSION).so
325 NSSLINKNAME := $(NSSLIBNAME).so.2
328 # If not otherwise defined, we install into /usr/lib and /usr/include
329 # and our startup script is called mdns (e.g. /etc/init.d/mdns)
331 STARTUPSCRIPTNAME?=mdns
333 ifeq ($(HAVE_IPV6),1)
334 CFLAGS_OS += -DHAVE_IPV6=1
336 ifeq ($(HAVE_IPV6),0)
337 CFLAGS_OS += -DHAVE_IPV6=0
341 # If directory /usr/share/man exists, then we install man pages into that, else /usr/man
342 ifeq ($(wildcard /usr/share/man), /usr/share/man)
343 MANPATH := /usr/share/man
348 # If directories /etc/init.d/rc*.d exist, then we install into that (Suse)
349 ifeq ($(wildcard /etc/init.d/rc2.d/), /etc/init.d/rc2.d/)
350 STARTUPSCRIPTDIR = /etc/init.d
351 RUNLEVELSCRIPTSDIR = /etc/init.d
353 # else if directory /etc/rc.d/init.d/ exists, then we install into that (old Linux)
354 ifeq ($(wildcard /etc/rc.d/init.d/), /etc/rc.d/init.d/)
355 STARTUPSCRIPTDIR = /etc/rc.d/init.d
356 RUNLEVELSCRIPTSDIR = /etc/rc.d
358 # else if directory /etc/init.d/ exists, then we install into that (new Linux)
359 ifeq ($(wildcard /etc/init.d/), /etc/init.d/)
360 STARTUPSCRIPTDIR = /etc/init.d
361 RUNLEVELSCRIPTSDIR = /etc
363 # else install into /etc/rc.d/ (*BSD)
364 STARTUPSCRIPTDIR = $(INSTBASE)/etc/rc.d
369 CFLAGS = $(CFLAGS_COMMON) $(CFLAGS_OS) $(CFLAGS_DEBUG)
371 #############################################################################
373 all: setup Daemon libdns_sd Client Responder ProxyResponder Identify NetMonitor dnsextd $(OPTIONALTARG)
375 install: setup InstalledDaemon InstalledLib InstalledStartup InstalledManPages $(OPTINSTALL)
377 # 'setup' sets up the build directory structure the way we want
379 @if test ! -d objects ; then mkdir objects ; fi
380 @if test ! -d build ; then mkdir build ; fi
381 @if test ! -d $(OBJDIR) ; then mkdir $(OBJDIR) ; fi
382 @if test ! -d $(BUILDDIR) ; then mkdir $(BUILDDIR) ; fi
384 # clean removes targets and objects
386 if test -d $(OBJDIR) ; then rm -r $(OBJDIR) ; fi
387 if test -d $(BUILDDIR) ; then rm -r $(BUILDDIR) ; fi
389 #############################################################################
391 # daemon target builds the daemon
392 DAEMONOBJS = $(OBJDIR)/PosixDaemon.c.o $(OBJDIR)/mDNSPosix.c.o $(OBJDIR)/mDNSUNP.c.o $(OBJDIR)/mDNS.c.o \
393 $(OBJDIR)/DNSDigest.c.o $(OBJDIR)/uDNS.c.o $(OBJDIR)/DNSCommon.c.o $(OBJDIR)/uds_daemon.c.o \
394 $(OBJDIR)/mDNSDebug.c.o $(OBJDIR)/dnssd_ipc.c.o $(OBJDIR)/GenLinkedList.c.o $(OBJDIR)/PlatformCommon.c.o
396 Daemon: setup $(BUILDDIR)/mdnsd
397 @echo "Responder daemon done"
399 $(BUILDDIR)/mdnsd: $(DAEMONOBJS)
400 $(CC) -o $@ $+ $(CFLAGS) $(LIBFLAGS)
403 # libdns_sd target builds the client library
404 libdns_sd: setup $(BUILDDIR)/libdns_sd.$(LDSUFFIX)
405 @echo "Client library done"
407 CLIENTLIBOBJS = $(OBJDIR)/dnssd_clientlib.c.so.o $(OBJDIR)/dnssd_clientstub.c.so.o $(OBJDIR)/dnssd_ipc.c.so.o
409 $(BUILDDIR)/libdns_sd.$(LDSUFFIX): $(CLIENTLIBOBJS)
410 @$(LD) $(LIBFLAGS) -o $@ $+
413 # nss_mdns target builds the Name Service Switch module
414 nss_mdns: setup $(BUILDDIR)/$(NSSLIBFILE)
415 @echo "Name Service Switch module done"
417 $(BUILDDIR)/$(NSSLIBFILE): $(CLIENTLIBOBJS) $(OBJDIR)/nss_mdns.c.so.o
418 @$(LD) $(LIBFLAGS) -o $@ $+
421 #############################################################################
423 # The Install targets place built stuff in their proper places
424 InstalledDaemon: $(INSTBASE)/sbin/mdnsd
425 @echo $+ " installed"
427 InstalledLib: $(INSTBASE)/lib/libdns_sd.$(LDSUFFIX).$(LIBVERS) $(INSTBASE)/include/dns_sd.h
428 @echo $+ " installed"
430 InstalledStartup: $(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME)
431 @echo $+ " installed"
433 InstalledNSS: $(NSSINSTPATH)/$(NSSLINKNAME) /etc/nss_mdns.conf $(MANPATH)/man5/nss_mdns.conf.5 $(MANPATH)/man8/libnss_mdns.8
434 @echo $+ " installed"
436 InstalledManPages: $(MANPATH)/man8/mdnsd.8
437 @echo $+ " installed"
439 $(INSTBASE)/sbin/mdnsd: $(BUILDDIR)/mdnsd
442 $(INSTBASE)/lib/libdns_sd.$(LDSUFFIX).$(LIBVERS): $(BUILDDIR)/libdns_sd.$(LDSUFFIX)
444 $(LN) $@ $(INSTBASE)/lib/libdns_sd.$(LDSUFFIX)
446 # -m means 'merge into existing database', -R means 'rescan directories'
450 $(INSTBASE)/include/dns_sd.h: $(SHAREDDIR)/dns_sd.h
453 $(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME): mdnsd.sh $(STARTUPSCRIPTDIR)
456 ifdef RUNLEVELSCRIPTSDIR
457 ifeq ($(wildcard $(RUNLEVELSCRIPTSDIR)/runlevels/default), $(RUNLEVELSCRIPTSDIR)/runlevels/default)
458 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/runlevels/default/mdns
460 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc2.d/S52mdns
461 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc3.d/S52mdns
462 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc4.d/S52mdns
463 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc5.d/S52mdns
464 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc0.d/K16mdns
465 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc6.d/K16mdns
469 $(NSSINSTPATH)/$(NSSLINKNAME): $(NSSINSTPATH)/$(NSSLIBFILE)
473 $(NSSINSTPATH)/$(NSSLIBFILE): $(BUILDDIR)/$(NSSLIBFILE)
477 /etc/nss_mdns.conf: nss_mdns.conf
480 # Check the nsswitch.conf file.
481 # If 'mdns' does not already appear on the "hosts:" line, then add it right before 'dns'
482 cp -f /etc/nsswitch.conf /etc/nsswitch.conf.pre-mdns
483 sed -e '/mdns/!s/^\(hosts:.*\)dns\(.*\)/\1mdns dns\2/' /etc/nsswitch.conf.pre-mdns > /etc/nsswitch.conf
485 $(MANPATH)/man5/%.5: %.5
489 $(MANPATH)/man8/%.8: %.8
493 $(MANPATH)/man8/mdnsd.8: $(SHAREDDIR)/mDNSResponder.8
497 #############################################################################
499 # The following targets build Java wrappers for the dns-sd.h API.
501 JAVAC = $(JDK)/bin/javac
502 JAVAH = $(JDK)/bin/javah
503 JAVADOC = $(JDK)/bin/javadoc
505 JAVACFLAGS = $(CFLAGS) $(JAVACFLAGS_OS) -I$(JDK)/include
507 Java: setup $(BUILDDIR)/dns_sd.jar $(BUILDDIR)/libjdns_sd.$(LDSUFFIX)
508 @echo "Java wrappers done"
510 JAVASRC = $(SHAREDDIR)/Java
511 JARCONTENTS = $(OBJDIR)/com/apple/dnssd/DNSSDService.class \
512 $(OBJDIR)/com/apple/dnssd/DNSRecord.class \
513 $(OBJDIR)/com/apple/dnssd/DNSSDException.class \
514 $(OBJDIR)/com/apple/dnssd/TXTRecord.class \
515 $(OBJDIR)/com/apple/dnssd/DNSSDRegistration.class \
516 $(OBJDIR)/com/apple/dnssd/BaseListener.class \
517 $(OBJDIR)/com/apple/dnssd/BrowseListener.class \
518 $(OBJDIR)/com/apple/dnssd/ResolveListener.class \
519 $(OBJDIR)/com/apple/dnssd/RegisterListener.class \
520 $(OBJDIR)/com/apple/dnssd/QueryListener.class \
521 $(OBJDIR)/com/apple/dnssd/DomainListener.class \
522 $(OBJDIR)/com/apple/dnssd/DNSSD.class
524 $(BUILDDIR)/dns_sd.jar: $(JARCONTENTS)
525 $(JAR) -cf $@ -C $(OBJDIR) com
527 $(BUILDDIR)/libjdns_sd.$(LDSUFFIX): $(JAVASRC)/JNISupport.c $(OBJDIR)/DNSSD.java.h
528 $(CC) -o $@ $< $(JAVACFLAGS) -I$(OBJDIR)
530 $(OBJDIR)/com/apple/dnssd/%.class: $(JAVASRC)/%.java
531 $(JAVAC) -d $(OBJDIR) -classpath $(OBJDIR) $<
533 $(OBJDIR)/DNSSD.java.h: $(OBJDIR)/com/apple/dnssd/DNSSD.class
534 $(JAVAH) -force -classpath $(OBJDIR) -o $@ \
535 com.apple.dnssd.AppleDNSSD \
536 com.apple.dnssd.AppleBrowser \
537 com.apple.dnssd.AppleResolver \
538 com.apple.dnssd.AppleRegistration \
539 com.apple.dnssd.AppleQuery \
540 com.apple.dnssd.AppleDomainEnum \
541 com.apple.dnssd.AppleService
543 #############################################################################
545 # The following target builds documentation for the Java wrappers.
548 $(JAVADOC) $(JAVASRC)/*.java -classpath $(OBJDIR) -d $(BUILDDIR) -public
550 #############################################################################
552 # The following targets build embedded example programs
553 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
554 COMMONOBJ = $(SPECIALOBJ) $(OBJDIR)/mDNS.c.o
555 APPOBJ = $(COMMONOBJ) $(OBJDIR)/ExampleClientApp.c.o
557 Client: setup $(BUILDDIR)/mDNSClientPosix
558 @echo "Embedded Standalone Client done"
560 Responder: setup $(BUILDDIR)/mDNSResponderPosix
561 @echo "Embedded Standalone Responder done"
563 ProxyResponder: setup $(BUILDDIR)/mDNSProxyResponderPosix
564 @echo "Embedded Standalone ProxyResponder done"
566 Identify: setup $(BUILDDIR)/mDNSIdentify
567 @echo "Identify done"
569 NetMonitor: setup $(BUILDDIR)/mDNSNetMonitor
570 @echo "NetMonitor done"
572 dnsextd: setup $(BUILDDIR)/dnsextd
575 $(BUILDDIR)/mDNSClientPosix: $(APPOBJ) $(OBJDIR)/Client.c.o
576 $(CC) $+ -o $@ $(LIBFLAGS)
578 $(BUILDDIR)/mDNSResponderPosix: $(COMMONOBJ) $(OBJDIR)/Responder.c.o
579 $(CC) $+ -o $@ $(LIBFLAGS)
581 $(BUILDDIR)/mDNSProxyResponderPosix: $(COMMONOBJ) $(OBJDIR)/ProxyResponder.c.o
582 $(CC) $+ -o $@ $(LIBFLAGS)
584 $(BUILDDIR)/mDNSIdentify: $(SPECIALOBJ) $(OBJDIR)/Identify.c.o
585 $(CC) $+ -o $@ $(LIBFLAGS)
587 $(BUILDDIR)/mDNSNetMonitor: $(SPECIALOBJ) $(OBJDIR)/NetMonitor.c.o
588 $(CC) $+ -o $@ $(LIBFLAGS)
590 $(BUILDDIR)/dnsextd: $(SPECIALOBJ) $(OBJDIR)/dnsextd.c.o
591 $(CC) $+ -o $@ $(LIBFLAGS) $(DNSEXT_FLAGS)
593 #############################################################################
597 $(CC) $(CFLAGS) -c -o $@ $<
599 $(OBJDIR)/%.c.o: $(COREDIR)/%.c
600 $(CC) $(CFLAGS) -c -o $@ $<
602 $(OBJDIR)/%.c.o: $(SHAREDDIR)/%.c
603 $(CC) $(CFLAGS) -c -o $@ $<
605 $(OBJDIR)/%.c.so.o: %.c
606 $(CC) $(CFLAGS) -c -fPIC -o $@ $<
608 $(OBJDIR)/%.c.so.o: $(SHAREDDIR)/%.c
609 $(CC) $(CFLAGS) -c -fPIC -o $@ $<