]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSPosix/Makefile
mDNSResponder-58.8.1.tar.gz
[apple/mdnsresponder.git] / mDNSPosix / Makefile
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.
30 CC = cc
31 CFLAGS_COMMON = -g -I../mDNSCore -I. -DMDNS_DEBUGMSGS=2
32
33 ifeq ($(os),solaris)
34 CFLAGS_OS = -DNOT_HAVE_DAEMON -DNOT_HAVE_SA_LEN -D_XPG4_2 -D__EXTENSIONS__ -DHAVE_BROKEN_RECVIF_NAME -lsocket -lnsl
35 else
36 ifeq ($(os),linux)
37 CFLAGS_OS = -DNOT_HAVE_SA_LEN -W -Wall
38 else
39 ifeq ($(os),netbsd)
40 CFLAGS_OS =
41 else
42 ifeq ($(os),freebsd)
43 CFLAGS_OS =
44 else
45 ifeq ($(os),openbsd)
46 CFLAGS_OS = -DHAVE_BROKEN_RECVDSTADDR
47 else
48 ifeq ($(os),jaguar)
49 CFLAGS_OS = -DHAVE_IPV6 -W -Wall -no-cpp-precomp -DNOT_HAVE_SOCKLEN_T
50 else
51 ifeq ($(os),panther)
52 CFLAGS_OS = -DHAVE_IPV6 -W -Wall -no-cpp-precomp
53 else
54 cantbuild:
55 @echo "Error: Must specify target OS on command-line, e.g. \"make os=panther\" or \"make os=jaguar\" or \"make os=linux\""
56 endif
57 endif
58 endif
59 endif
60 endif
61 endif
62 endif
63 CFLAGS = $(CFLAGS_COMMON) $(CFLAGS_OS)
64
65 COMMONOBJ = objects/mDNSPosix.c.o objects/mDNSUNP.c.o objects/ExampleClientApp.c.o
66
67 HEADERS = Makefile mDNSUNP.h mDNSPosix.h \
68 ../mDNSCore/mDNSDebug.h \
69 ../mDNSCore/mDNSClientAPI.h \
70 ../mDNSCore/mDNSPlatformFunctions.h
71
72 all: setup Client Responder ProxyResponder Identify NetMonitor
73
74 setup:
75 if test ! -d objects ; then mkdir objects ; fi
76 if test ! -d build ; then mkdir build ; fi
77
78 Client: setup build/mDNSClientPosix
79 @echo "Client done"
80
81 Responder: setup build/mDNSResponderPosix
82 @echo "Responder done"
83
84 ProxyResponder: setup build/mDNSProxyResponderPosix
85 @echo "ProxyResponder done"
86
87 Identify: setup build/mDNSIdentify
88 @echo "Identify done"
89
90 NetMonitor: 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>
98 build/mDNSClientPosix: $(COMMONOBJ) objects/mDNS.c.o objects/Client.c.o
99 $(CC) $+ -o $@
100
101 build/mDNSResponderPosix: $(COMMONOBJ) objects/mDNS.c.o objects/Responder.c.o
102 $(CC) $+ -o $@
103
104 build/mDNSProxyResponderPosix: $(COMMONOBJ) objects/mDNS.c.o objects/ProxyResponder.c.o
105 $(CC) $+ -o $@
106
107 build/mDNSIdentify: $(COMMONOBJ) objects/Identify.c.o
108 $(CC) $+ -o $@
109
110 build/mDNSNetMonitor: $(COMMONOBJ) objects/NetMonitor.c.o
111 $(CC) $+ -o $@
112
113 objects/%.c.o: %.c ../mDNSCore/mDNS.c $(HEADERS)
114 $(CC) -c $(CFLAGS) $< -o $@
115
116 objects/mDNS.c.o: ../mDNSCore/mDNS.c $(HEADERS)
117 $(CC) -c $(CFLAGS) $< -o $@
118
119 clean:
120 -rm -rf objects build .gdb_history