3 # Copyright (c) 2002-2004, Apple Computer, Inc. All rights reserved.
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions are met:
8 # 1. Redistributions of source code must retain the above copyright notice,
9 # this list of conditions and the following disclaimer.
10 # 2. Redistributions in binary form must reproduce the above copyright notice,
11 # this list of conditions and the following disclaimer in the documentation
12 # and/or other materials provided with the distribution.
13 # 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of its
14 # contributors may be used to endorse or promote products derived from this
15 # software without specific prior written permission.
17 # THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
18 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 # DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 # IMPORTANT NOTE: This is a Makefile for *GNU make*
29 # On some systems, a different program may be the default "make" command.
30 # If "make os=xxx" gives lots of errors like "Missing dependency operator",
31 # then try typing "gmake os=xxx" instead.
33 # This Makefile builds an mDNSResponder daemon and a libdns_sd.so shared library
34 # for Linux. It also builds several example programs for embedded systems.
36 # Make with no arguments to build all production targets.
37 # 'make DEBUG=1' to build debugging targets.
38 # 'make clean' or 'make clean DEBUG=1' to delete prod/debug objects & targets
39 # 'sudo make install [DEBUG=1]' to install mdnsd daemon and libdns_sd.
42 # $@ means "The file name of the target of the rule"
43 # $< means "The name of the first prerequisite"
44 # $* means "The stem with which an implicit rule matches"
45 # $+ means "The names of all the prerequisites, with spaces between them, exactly as given"
46 # For more magic automatic variables, see
47 # <http://www.gnu.org/software/make/manual/html_node/Automatic-Variables.html>
49 #############################################################################
54 SHAREDDIR ?= ../mDNSShared
64 CFLAGS_COMMON = -I$(COREDIR) -I$(SHAREDDIR) -I$(OBJDIR) -fwrapv -W -Wall -DPID_FILE=\"/var/run/mdnsd.pid\" -DMDNS_UDS_SERVERPATH=\"/var/run/mdnsd\"
67 LINKOPTS_PTHREAD = -lpthread
69 JAVACFLAGS_OS = -fPIC -shared -ldns_sd
71 # Set up diverging paths for debug vs. prod builds
74 CFLAGS_DEBUG = -g -DMDNS_DEBUGMSGS=2
75 OBJDIR = objects/debug
76 BUILDDIR = build/debug
79 # We use -Os for two reasons:
80 # 1. We want to make small binaries, suitable for putting into hardware devices
81 # 2. Some of the code analysis warnings only work when some form of optimization is enabled
82 CFLAGS_DEBUG = -Os -DMDNS_DEBUGMSGS=0
83 OBJDIR ?= objects/prod
84 BUILDDIR ?= build/prod
88 # Configure per-OS peculiarities
90 CFLAGS_DEBUG = -O0 -DMDNS_DEBUGMSGS=0
91 CFLAGS_OS = -DNOT_HAVE_DAEMON -DNOT_HAVE_SA_LEN -DNOT_HAVE_SOCKLEN_T -DNOT_HAVE_IF_NAMETOINDEX \
92 -DLOG_PERROR=0 -D_XPG4_2 -D__EXTENSIONS__ -DHAVE_BROKEN_RECVIF_NAME -DTARGET_OS_SOLARIS
95 LINKOPTS = -lsocket -lnsl -lresolv
96 JAVACFLAGS_OS += -I$(JDK)/include/solaris
103 CFLAGS_OS = -DNOT_HAVE_SA_LEN -DUSES_NETLINK -DHAVE_LINUX -DTARGET_OS_LINUX -fno-strict-aliasing
106 JAVACFLAGS_OS += -I$(JDK)/include/linux
107 OPTIONALTARG = nss_mdns
108 OPTINSTALL = InstalledNSS
117 # If not already defined, set LOCALBASE to /usr/local
118 # FreeBSD requires the startup script to end in ".sh"
119 LOCALBASE?=/usr/local
120 INSTBASE=$(LOCALBASE)
121 STARTUPSCRIPTNAME=mdns.sh
123 # FreeBSD 4 requires threaded code to be compiled and linked using the "-pthread" option,
124 # and requires that the "-lpthread" link option NOT be used
125 # This appies only to FreeBSD -- "man cc" on FreeBSD says:
126 # FreeBSD SPECIFIC OPTIONS
128 # Link a user-threaded process against libc_r instead of libc.
129 CFLAGS_PTHREAD = -pthread -D_THREAD_SAFE
130 LINKOPTS_PTHREAD = -pthread
131 JAVACFLAGS_OS += -I$(JDK)/include/freebsd
136 CFLAGS_OS = -DHAVE_BROKEN_RECVDSTADDR
141 # We have to define __MAC_OS_X_VERSION_MIN_REQUIRED=__MAC_OS_X_VERSION_10_4 or on Leopard
142 # we get build failures: ‘daemon’ is deprecated (declared at /usr/include/stdlib.h:283)
143 CFLAGS_OS = -DHAVE_IPV6 -no-cpp-precomp -Werror -Wdeclaration-after-statement \
144 -D__MAC_OS_X_VERSION_MIN_REQUIRED=__MAC_OS_X_VERSION_10_4 \
145 -D__APPLE_USE_RFC_2292 #-Wunreachable-code
147 LD = $(CC) -dynamiclib
150 JDK = /System/Library/Frameworks/JavaVM.framework/Home
151 JAVACFLAGS_OS = -dynamiclib -I/System/Library/Frameworks/JavaVM.framework/Headers -framework JavaVM
154 $(error ERROR: Must specify target OS on command-line, e.g. "make os=x [target]".\
155 Supported operating systems include: x, linux, netbsd, freebsd, openbsd, solaris)
163 NSSLIBNAME := libnss_mdns
165 NSSLIBFILE := $(NSSLIBNAME)-$(NSSVERSION).so
166 NSSLINKNAME := $(NSSLIBNAME).so.2
169 # If not otherwise defined, we install into /usr/lib and /usr/include
170 # and our startup script is called mdns (e.g. /etc/init.d/mdns)
172 STARTUPSCRIPTNAME?=mdns
174 ifeq ($(HAVE_IPV6),1)
175 CFLAGS_OS += -DHAVE_IPV6=1
177 ifeq ($(HAVE_IPV6),0)
178 CFLAGS_OS += -DHAVE_IPV6=0
182 # If directory /usr/share/man exists, then we install man pages into that, else /usr/man
183 ifeq ($(wildcard /usr/share/man), /usr/share/man)
184 MANPATH := /usr/share/man
189 # If directories /etc/init.d/rc*.d exist, then we install into that (Suse)
190 ifeq ($(wildcard /etc/init.d/rc2.d/), /etc/init.d/rc2.d/)
191 STARTUPSCRIPTDIR = /etc/init.d
192 RUNLEVELSCRIPTSDIR = /etc/init.d
194 # else if directory /etc/rc.d/init.d/ exists, then we install into that (old Linux)
195 ifeq ($(wildcard /etc/rc.d/init.d/), /etc/rc.d/init.d/)
196 STARTUPSCRIPTDIR = /etc/rc.d/init.d
197 RUNLEVELSCRIPTSDIR = /etc/rc.d
199 # else if directory /etc/init.d/ exists, then we install into that (new Linux)
200 ifeq ($(wildcard /etc/init.d/), /etc/init.d/)
201 STARTUPSCRIPTDIR = /etc/init.d
202 RUNLEVELSCRIPTSDIR = /etc
204 # else install into /etc/rc.d/ (*BSD)
205 STARTUPSCRIPTDIR = $(INSTBASE)/etc/rc.d
210 CFLAGS = $(CFLAGS_COMMON) $(CFLAGS_OS) $(CFLAGS_DEBUG)
212 #############################################################################
214 all: setup Daemon libdns_sd Clients SAClient SAResponder SAProxyResponder Identify NetMonitor dnsextd $(OPTIONALTARG)
216 install: setup InstalledDaemon InstalledStartup InstalledLib InstalledManPages InstalledClients $(OPTINSTALL)
218 # 'setup' sets up the build directory structure the way we want
220 @if test ! -d $(OBJDIR) ; then mkdir -p $(OBJDIR) ; fi
221 @if test ! -d $(BUILDDIR) ; then mkdir -p $(BUILDDIR) ; fi
223 # clean removes targets and objects
225 @if test -d $(OBJDIR) ; then rm -r $(OBJDIR) ; fi
226 @if test -d $(BUILDDIR) ; then rm -r $(BUILDDIR) ; fi
227 @$(MAKE) -C ../Clients clean
229 #############################################################################
231 # daemon target builds the daemon
232 DAEMONOBJS = $(OBJDIR)/PosixDaemon.c.o $(OBJDIR)/mDNSPosix.c.o $(OBJDIR)/mDNSUNP.c.o $(OBJDIR)/mDNS.c.o \
233 $(OBJDIR)/DNSDigest.c.o $(OBJDIR)/uDNS.c.o $(OBJDIR)/DNSCommon.c.o $(OBJDIR)/uds_daemon.c.o \
234 $(OBJDIR)/mDNSDebug.c.o $(OBJDIR)/dnssd_ipc.c.o $(OBJDIR)/GenLinkedList.c.o $(OBJDIR)/PlatformCommon.c.o
236 # dnsextd target build dnsextd
237 DNSEXTDOBJ = $(OBJDIR)/mDNSPosix.c.o $(OBJDIR)/mDNSUNP.c.o $(OBJDIR)/mDNSDebug.c.o $(OBJDIR)/GenLinkedList.c.o $(OBJDIR)/DNSDigest.c.o \
238 $(OBJDIR)/DNSCommon.c.o $(OBJDIR)/PlatformCommon.c.o $(OBJDIR)/dnsextd_parser.y.o $(OBJDIR)/dnsextd_lexer.l.o
240 Daemon: setup $(BUILDDIR)/mdnsd
241 @echo "Responder daemon done"
243 $(BUILDDIR)/mdnsd: $(DAEMONOBJS)
244 $(CC) -o $@ $+ $(LINKOPTS)
247 # libdns_sd target builds the client library
248 libdns_sd: setup $(BUILDDIR)/libdns_sd.$(LDSUFFIX)
249 @echo "Client library done"
251 CLIENTLIBOBJS = $(OBJDIR)/dnssd_clientlib.c.so.o $(OBJDIR)/dnssd_clientstub.c.so.o $(OBJDIR)/dnssd_ipc.c.so.o
253 $(BUILDDIR)/libdns_sd.$(LDSUFFIX): $(CLIENTLIBOBJS)
254 @$(LD) $(LINKOPTS) -o $@ $+
257 Clients: setup libdns_sd ../Clients/build/dns-sd
260 ../Clients/build/dns-sd:
261 @$(MAKE) -C ../Clients
263 # nss_mdns target builds the Name Service Switch module
264 nss_mdns: setup $(BUILDDIR)/$(NSSLIBFILE)
265 @echo "Name Service Switch module done"
267 $(BUILDDIR)/$(NSSLIBFILE): $(CLIENTLIBOBJS) $(OBJDIR)/nss_mdns.c.so.o
268 @$(LD) $(LINKOPTS) -o $@ $+
271 #############################################################################
273 # The Install targets place built stuff in their proper places
274 InstalledDaemon: $(INSTBASE)/sbin/mdnsd
275 @echo $+ " installed"
277 InstalledLib: $(INSTBASE)/lib/libdns_sd.$(LDSUFFIX).$(LIBVERS) $(INSTBASE)/include/dns_sd.h
278 @echo $+ " installed"
280 InstalledStartup: $(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME)
281 @echo $+ " installed"
283 InstalledManPages: $(MANPATH)/man8/mdnsd.8
284 @echo $+ " installed"
286 InstalledClients: $(INSTBASE)/bin/dns-sd
287 @echo $+ " installed"
289 InstalledNSS: $(NSSINSTPATH)/$(NSSLINKNAME) /etc/nss_mdns.conf $(MANPATH)/man5/nss_mdns.conf.5 $(MANPATH)/man8/libnss_mdns.8
290 @echo $+ " installed"
292 # Note: If daemon already installed, we make sure it's stopped before overwriting it
293 $(INSTBASE)/sbin/mdnsd: $(BUILDDIR)/mdnsd
294 @if test -x $@; then $(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME) stop; fi
297 $(INSTBASE)/lib/libdns_sd.$(LDSUFFIX).$(LIBVERS): $(BUILDDIR)/libdns_sd.$(LDSUFFIX)
299 $(LN) $@ $(INSTBASE)/lib/libdns_sd.$(LDSUFFIX)
301 # -m means 'merge into existing database', -R means 'rescan directories'
305 $(INSTBASE)/include/dns_sd.h: $(SHAREDDIR)/dns_sd.h
308 # We make this target dependent on $(INSTBASE)/sbin/mdnsd because we need to ensure
309 # that the daemon is installed *before* we try to execute the command to start it.
310 $(STARTUPSCRIPTDIR)/$(STARTUPSCRIPTNAME): mdnsd.sh $(STARTUPSCRIPTDIR) $(INSTBASE)/sbin/mdnsd
314 ifdef RUNLEVELSCRIPTSDIR
315 ifeq ($(wildcard $(RUNLEVELSCRIPTSDIR)/runlevels/default), $(RUNLEVELSCRIPTSDIR)/runlevels/default)
316 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/runlevels/default/mdns
318 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc2.d/S52mdns
319 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc3.d/S52mdns
320 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc4.d/S52mdns
321 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc5.d/S52mdns
322 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc0.d/K16mdns
323 $(LN) $@ $(RUNLEVELSCRIPTSDIR)/rc6.d/K16mdns
327 $(MANPATH)/man5/%.5: %.5
331 $(MANPATH)/man8/%.8: %.8
335 $(MANPATH)/man8/mdnsd.8: $(SHAREDDIR)/mDNSResponder.8
339 $(INSTBASE)/bin/dns-sd: ../Clients/build/dns-sd
342 $(NSSINSTPATH)/$(NSSLINKNAME): $(NSSINSTPATH)/$(NSSLIBFILE)
346 $(NSSINSTPATH)/$(NSSLIBFILE): $(BUILDDIR)/$(NSSLIBFILE)
350 /etc/nss_mdns.conf: nss_mdns.conf
353 # Check the nsswitch.conf file.
354 # If 'mdns' does not already appear on the "hosts:" line, then add it right before 'dns'
355 cp -f /etc/nsswitch.conf /etc/nsswitch.conf.pre-mdns
356 sed -e '/mdns/!s/^\(hosts:.*\)dns\(.*\)/\1mdns dns\2/' /etc/nsswitch.conf.pre-mdns > /etc/nsswitch.conf
358 #############################################################################
360 # The following targets build Java wrappers for the dns-sd.h API.
361 # Note that the JavaForXcode targets are used when building the project for OS X using Xcode
363 JAVAC = $(JDK)/bin/javac
364 JAVAH = $(JDK)/bin/javah
365 JAVADOC = $(JDK)/bin/javadoc
367 JAVACFLAGS = $(CFLAGS) $(JAVACFLAGS_OS) -I$(JDK)/include
369 JavaForXcode_: setup $(BUILDDIR)/dns_sd.jar $(PROJECT_DERIVED_FILE_DIR)/DNSSD.java.h
372 $(PROJECT_DERIVED_FILE_DIR)/DNSSD.java.h: $(OBJDIR)/DNSSD.java.h
373 @if test ! -d $(PROJECT_DERIVED_FILE_DIR) ; then mkdir -p $(PROJECT_DERIVED_FILE_DIR) ; fi
377 @if test -d $(OBJDIR) ; then rm -r $(OBJDIR) ; fi
378 @if test -f $(PROJECT_DERIVED_FILE_DIR)/DNSSD.java.h ; then $(RM) $(PROJECT_DERIVED_FILE_DIR)/DNSSD.java.h ; fi
379 @if test -f $(BUILDDIR)/dns_sd.jar ; then $(RM) $(BUILDDIR)/dns_sd.jar ; fi
382 JavaForXcode_installhdrs:
385 JavaForXcode_install: JavaForXcode_ $(DSTROOT)/$(SYSTEM_LIBRARY_DIR)/Java/Extensions/dns_sd.jar
388 $(DSTROOT)/$(SYSTEM_LIBRARY_DIR)/Java/Extensions/dns_sd.jar: $(BUILDDIR)/dns_sd.jar
389 @if test ! -d $(DSTROOT)/$(SYSTEM_LIBRARY_DIR)/Java/Extensions ; then mkdir -p $(DSTROOT)/$(SYSTEM_LIBRARY_DIR)/Java/Extensions ; fi
392 Java: setup $(BUILDDIR)/dns_sd.jar $(BUILDDIR)/libjdns_sd.$(LDSUFFIX)
393 @echo "Java wrappers done"
395 JAVASRC = $(SHAREDDIR)/Java
396 JARCONTENTS = $(OBJDIR)/com/apple/dnssd/DNSSDService.class \
397 $(OBJDIR)/com/apple/dnssd/DNSSDException.class \
398 $(OBJDIR)/com/apple/dnssd/DNSRecord.class \
399 $(OBJDIR)/com/apple/dnssd/TXTRecord.class \
400 $(OBJDIR)/com/apple/dnssd/DNSSDRegistration.class \
401 $(OBJDIR)/com/apple/dnssd/BaseListener.class \
402 $(OBJDIR)/com/apple/dnssd/BrowseListener.class \
403 $(OBJDIR)/com/apple/dnssd/ResolveListener.class \
404 $(OBJDIR)/com/apple/dnssd/RegisterListener.class \
405 $(OBJDIR)/com/apple/dnssd/QueryListener.class \
406 $(OBJDIR)/com/apple/dnssd/DomainListener.class \
407 $(OBJDIR)/com/apple/dnssd/RegisterRecordListener.class \
408 $(OBJDIR)/com/apple/dnssd/DNSSDRecordRegistrar.class \
409 $(OBJDIR)/com/apple/dnssd/DNSSD.class
411 $(BUILDDIR)/dns_sd.jar: $(JARCONTENTS) setup
412 $(JAR) -cf $@ -C $(OBJDIR) com
414 $(BUILDDIR)/libjdns_sd.$(LDSUFFIX): $(JAVASRC)/JNISupport.c $(OBJDIR)/DNSSD.java.h setup libdns_sd
415 $(CC) -o $@ $< $(JAVACFLAGS) -I$(OBJDIR) -L$(BUILDDIR)
417 $(OBJDIR)/com/apple/dnssd/%.class: $(JAVASRC)/%.java
418 $(JAVAC) -d $(OBJDIR) -classpath $(OBJDIR) $<
420 $(OBJDIR)/DNSSD.java.h: $(OBJDIR)/com/apple/dnssd/DNSSD.class
421 $(JAVAH) -force -classpath $(OBJDIR) -o $@ \
422 com.apple.dnssd.AppleDNSSD \
423 com.apple.dnssd.AppleBrowser \
424 com.apple.dnssd.AppleResolver \
425 com.apple.dnssd.AppleRegistration \
426 com.apple.dnssd.AppleQuery \
427 com.apple.dnssd.AppleDomainEnum \
428 com.apple.dnssd.AppleService \
429 com.apple.dnssd.AppleDNSRecord \
430 com.apple.dnssd.AppleRecordRegistrar
432 #############################################################################
434 # The following target builds documentation for the Java wrappers.
437 $(JAVADOC) $(JAVASRC)/*.java -classpath $(OBJDIR) -d $(BUILDDIR) -public
439 #############################################################################
441 # The following targets build embedded example programs
442 SPECIALOBJ = $(OBJDIR)/mDNSPosix.c.o $(OBJDIR)/mDNSUNP.c.o $(OBJDIR)/mDNSDebug.c.o $(OBJDIR)/GenLinkedList.c.o \
443 $(OBJDIR)/DNSDigest.c.o $(OBJDIR)/uDNS.c.o $(OBJDIR)/DNSCommon.c.o $(OBJDIR)/PlatformCommon.c.o
444 COMMONOBJ = $(SPECIALOBJ) $(OBJDIR)/mDNS.c.o
445 APPOBJ = $(COMMONOBJ) $(OBJDIR)/ExampleClientApp.c.o
447 SAClient: setup $(BUILDDIR)/mDNSClientPosix
448 @echo "Embedded Standalone Client done"
450 SAResponder: setup $(BUILDDIR)/mDNSResponderPosix
451 @echo "Embedded Standalone Responder done"
453 SAProxyResponder: setup $(BUILDDIR)/mDNSProxyResponderPosix
454 @echo "Embedded Standalone ProxyResponder done"
456 Identify: setup $(BUILDDIR)/mDNSIdentify
457 @echo "Identify done"
459 NetMonitor: setup $(BUILDDIR)/mDNSNetMonitor
460 @echo "NetMonitor done"
462 dnsextd: setup $(BUILDDIR)/dnsextd
465 $(BUILDDIR)/mDNSClientPosix: $(APPOBJ) $(OBJDIR)/Client.c.o
466 $(CC) $+ -o $@ $(LINKOPTS)
468 $(BUILDDIR)/mDNSResponderPosix: $(COMMONOBJ) $(OBJDIR)/Responder.c.o
469 $(CC) $+ -o $@ $(LINKOPTS)
471 $(BUILDDIR)/mDNSProxyResponderPosix: $(COMMONOBJ) $(OBJDIR)/ProxyResponder.c.o
472 $(CC) $+ -o $@ $(LINKOPTS)
474 $(BUILDDIR)/mDNSIdentify: $(SPECIALOBJ) $(OBJDIR)/Identify.c.o
475 $(CC) $+ -o $@ $(LINKOPTS)
477 $(OBJDIR)/Identify.c.o: $(COREDIR)/mDNS.c # Note: Identify.c textually imports mDNS.c
479 $(BUILDDIR)/mDNSNetMonitor: $(SPECIALOBJ) $(OBJDIR)/NetMonitor.c.o
480 $(CC) $+ -o $@ $(LINKOPTS)
482 $(OBJDIR)/NetMonitor.c.o: $(COREDIR)/mDNS.c # Note: NetMonitor.c textually imports mDNS.c
484 $(BUILDDIR)/dnsextd: $(DNSEXTDOBJ) $(OBJDIR)/dnsextd.c.threadsafe.o
485 $(CC) $+ -o $@ $(LINKOPTS) $(LINKOPTS_PTHREAD)
487 #############################################################################
491 $(CC) $(CFLAGS) -c -o $@ $<
493 $(OBJDIR)/%.c.o: $(COREDIR)/%.c
494 $(CC) $(CFLAGS) -c -o $@ $<
496 $(OBJDIR)/%.c.o: $(SHAREDDIR)/%.c
497 $(CC) $(CFLAGS) -c -o $@ $<
499 $(OBJDIR)/%.c.threadsafe.o: %.c
500 $(CC) $(CFLAGS) $(CFLAGS_PTHREAD) -D_REENTRANT -c -o $@ $<
502 $(OBJDIR)/%.c.threadsafe.o: $(SHAREDDIR)/%.c
503 $(CC) $(CFLAGS) $(CFLAGS_PTHREAD) -D_REENTRANT -c -o $@ $<
505 $(OBJDIR)/%.c.so.o: %.c
506 $(CC) $(CFLAGS) -c -fPIC -o $@ $<
508 $(OBJDIR)/%.c.so.o: $(SHAREDDIR)/%.c
509 $(CC) $(CFLAGS) -c -fPIC -o $@ $<
511 $(OBJDIR)/%.y.o: $(SHAREDDIR)/%.y
512 $(BISON) -o $(OBJDIR)/$*.c -d $<
513 $(CC) $(CFLAGS) -c -o $@ $(OBJDIR)/$*.c
515 $(OBJDIR)/%.l.o: $(SHAREDDIR)/%.l
516 $(FLEX) $(FLEXFLAGS_OS) -i -o$(OBJDIR)/$*.l.c $<
517 $(CC) $(CFLAGS) -Wno-error -c -o $@ $(OBJDIR)/$*.l.c