]> git.saurik.com Git - apple/mdnsresponder.git/blame - mDNSPosix/Makefile
mDNSResponder-58.tar.gz
[apple/mdnsresponder.git] / mDNSPosix / Makefile
CommitLineData
c9b9ae52
A
1# $Log: Makefile,v $
2# Revision 1.13 2003/08/06 18:20:51 cheshire
3# Makefile cleanup
4#
5# Revision 1.12 2003/08/01 02:20:02 cheshire
6# Add mDNSIdentify tool, used to discover what version of mDNSResponder a particular host is running
7#
8# Revision 1.11 2003/07/14 18:11:54 cheshire
9# Fix stricter compiler warnings
10#
11# Revision 1.10 2003/06/18 05:47:41 cheshire
12# Enable stricter warnings on Jaguar and Panther builds
13#
14# Revision 1.9 2003/06/04 18:34:45 ksekar
15# Bug #: <rdar://problem/3218120>: mDNSPosix does not build on Panther that has socklen_t
16# Changed build targets "osx10.2" and "osx10.3" to "jaguar" and "panther".
17#
18# Revision 1.8 2003/06/04 00:23:12 ksekar
19# Bug #: <rdar://problem/3218120>: mDNSPosix does not build on Panther that has socklen_t
20# Created separate target OS's for 10.2 and 10.3.
21#
22# Revision 1.7 2003/04/16 02:11:37 cheshire
23# Remove unnecessary $(CFLAGS) from linking rules
24#
25# Revision 1.6 2003/04/04 01:37:14 cheshire
26# Added NetMonitor.c
27#
28
29# I assume that cc will be in your path. If not, you have to change the following to point to it.
30CC = cc
31CFLAGS_COMMON = -g -I../mDNSCore -I. -DMDNS_DEBUGMSGS=2
32
33ifeq ($(os),solaris)
34CFLAGS_OS = -DNOT_HAVE_DAEMON -DNOT_HAVE_SA_LEN -D_XPG4_2 -D__EXTENSIONS__ -DHAVE_BROKEN_RECVIF_NAME -lsocket -lnsl
35else
36ifeq ($(os),linux)
37CFLAGS_OS = -DNOT_HAVE_SA_LEN -W -Wall
38else
39ifeq ($(os),netbsd)
40CFLAGS_OS =
41else
42ifeq ($(os),freebsd)
43CFLAGS_OS =
44else
45ifeq ($(os),openbsd)
46CFLAGS_OS = -DHAVE_BROKEN_RECVDSTADDR
47else
48ifeq ($(os),jaguar)
49CFLAGS_OS = -DHAVE_IPV6 -W -Wall -no-cpp-precomp -DNOT_HAVE_SOCKLEN_T
50else
51ifeq ($(os),panther)
52CFLAGS_OS = -DHAVE_IPV6 -W -Wall -no-cpp-precomp
53else
54cantbuild:
55 @echo "Error: Must specify target OS on command-line, e.g. \"make os=panther\" or \"make os=jaguar\" or \"make os=linux\""
56endif
57endif
58endif
59endif
60endif
61endif
62endif
63CFLAGS = $(CFLAGS_COMMON) $(CFLAGS_OS)
64
65COMMONOBJ = objects/mDNSPosix.c.o objects/mDNSUNP.c.o objects/ExampleClientApp.c.o
66
67HEADERS = Makefile mDNSUNP.h mDNSPosix.h \
68../mDNSCore/mDNSDebug.h \
69../mDNSCore/mDNSClientAPI.h \
70../mDNSCore/mDNSPlatformFunctions.h
71
72all: setup Client Responder ProxyResponder Identify NetMonitor
73
74setup:
75 if test ! -d objects ; then mkdir objects ; fi
76 if test ! -d build ; then mkdir build ; fi
77
78Client: setup build/mDNSClientPosix
79 @echo "Client done"
80
81Responder: setup build/mDNSResponderPosix
82 @echo "Responder done"
83
84ProxyResponder: setup build/mDNSProxyResponderPosix
85 @echo "ProxyResponder done"
86
87Identify: setup build/mDNSIdentify
88 @echo "Identify done"
89
90NetMonitor: setup build/mDNSNetMonitor
91 @echo "NetMonitor done"
92
93# $@ means "The file name of the target of the rule"
94# $< means "The name of the first prerequisite"
95# $+ means "The names of all the prerequisites, with spaces between them, exactly as given"
96# For more magic automatic sariables, see
97# <http://www.gnu.org/manual/make-3.80/html_chapter/make_10.html#SEC111>
98build/mDNSClientPosix: $(COMMONOBJ) objects/mDNS.c.o objects/Client.c.o
99 $(CC) $+ -o $@
100
101build/mDNSResponderPosix: $(COMMONOBJ) objects/mDNS.c.o objects/Responder.c.o
102 $(CC) $+ -o $@
103
104build/mDNSProxyResponderPosix: $(COMMONOBJ) objects/mDNS.c.o objects/ProxyResponder.c.o
105 $(CC) $+ -o $@
106
107build/mDNSIdentify: $(COMMONOBJ) objects/Identify.c.o
108 $(CC) $+ -o $@
109
110build/mDNSNetMonitor: $(COMMONOBJ) objects/NetMonitor.c.o
111 $(CC) $+ -o $@
112
113objects/%.c.o: %.c ../mDNSCore/mDNS.c $(HEADERS)
114 $(CC) -c $(CFLAGS) $< -o $@
115
116objects/mDNS.c.o: ../mDNSCore/mDNS.c $(HEADERS)
117 $(CC) -c $(CFLAGS) $< -o $@
118
119clean:
120 -rm -rf objects build .gdb_history