]>
Commit | Line | Data |
---|---|---|
67c8f8a1 A |
1 | # -*- tab-width: 4 -*- |
2 | # | |
8e92c31c A |
3 | # Copyright (c) 2002-2004 Apple Computer, Inc. All rights reserved. |
4 | # | |
67c8f8a1 A |
5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
6 | # you may not use this file except in compliance with the License. | |
7 | # You may obtain a copy of the License at | |
8e92c31c | 8 | # |
67c8f8a1 | 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
8e92c31c | 10 | # |
67c8f8a1 A |
11 | # Unless required by applicable law or agreed to in writing, software |
12 | # distributed under the License is distributed on an "AS IS" BASIS, | |
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
14 | # See the License for the specific language governing permissions and | |
8e92c31c | 15 | # limitations under the License. |
8e92c31c A |
16 | # |
17 | # $Log: Makefile,v $ | |
32bb7e43 A |
18 | # Revision 1.12 2008/09/05 17:37:08 cheshire |
19 | # Need to include ClientCommon.c when building dns-sd | |
20 | # | |
67c8f8a1 A |
21 | # Revision 1.11 2007/05/29 19:57:33 cheshire |
22 | # Use "-Wall" for stricter compiler warnings | |
23 | # | |
24 | # Revision 1.10 2006/09/21 00:56:37 cheshire | |
25 | # <rdar://problem/4245577> Need 64-bit version of dns-sd command-line tool | |
26 | # Add in missing "build/" in targets line for builds other than OS X | |
27 | # | |
28 | # Revision 1.9 2006/09/18 18:55:39 cheshire | |
29 | # <rdar://problem/4245577> Need 64-bit version of dns-sd command-line tool | |
30 | # | |
31 | # Revision 1.8 2006/08/14 23:23:55 cheshire | |
32 | # Re-licensed mDNSResponder daemon source code under Apache License, Version 2.0 | |
33 | # | |
34 | # Revision 1.7 2006/01/06 01:06:17 cheshire | |
35 | # <rdar://problem/3978979> Compile library and client programs in one pass | |
36 | # | |
7f0064bd A |
37 | # Revision 1.6 2004/09/24 21:15:26 cheshire |
38 | # <rdar://problem/3724985> Library "libmdns" misnamed; should be "libdns_sd" | |
39 | # | |
40 | # Revision 1.5 2004/09/02 17:32:45 cheshire | |
41 | # Look for headers in ../mDNSShared before we go to /usr/include | |
42 | # | |
8e92c31c A |
43 | # Revision 1.4 2004/05/21 17:25:56 cheshire |
44 | # Fixes to make sample client work on Linux | |
45 | # | |
46 | # Revision 1.3 2004/03/12 08:05:32 cheshire | |
47 | # Add a "make clean" target | |
48 | # | |
49 | # Revision 1.2 2004/02/11 20:59:26 cheshire | |
50 | # Fix Makefile so it creates the "build" directory if necessary | |
51 | # | |
52 | # Revision 1.1 2004/02/06 03:19:09 cheshire | |
53 | # Check in code to make command-line "dns-sd" testing tool | |
54 | # | |
55 | # | |
56 | # Notes: | |
57 | # $@ means "The file name of the target of the rule" | |
58 | # $< means "The name of the first prerequisite" | |
59 | # $+ means "The names of all the prerequisites, with spaces between them, exactly as given" | |
60 | # For more magic automatic variables, see | |
61 | # <http://www.gnu.org/software/make/manual/html_chapter/make_10.html#SEC111> | |
62 | ||
63 | ############################################################################# | |
64 | ||
67c8f8a1 A |
65 | # On OS X the dns_sd library functions are included in libSystem, which is implicitly linked with every executable |
66 | # If /usr/lib/libSystem.dylib exists, then we're on OS X, so we don't need also to link the "dns_sd" shared library | |
67 | ifneq "$(wildcard /usr/lib/libSystem.dylib)" "" | |
68 | TARGETS = build/dns-sd build/dns-sd64 | |
c9d2d929 | 69 | LIBS = |
67c8f8a1 A |
70 | else |
71 | TARGETS = build/dns-sd | |
72 | LIBS = -L../mDNSPosix/build/prod/ -ldns_sd | |
8e92c31c A |
73 | endif |
74 | ||
67c8f8a1 | 75 | all: $(TARGETS) |
8e92c31c A |
76 | |
77 | clean: | |
78 | rm -rf build | |
79 | ||
80 | build: | |
81 | mkdir build | |
82 | ||
32bb7e43 | 83 | build/dns-sd: build dns-sd.c ClientCommon.c |
67c8f8a1 A |
84 | cc $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@ |
85 | ||
32bb7e43 | 86 | build/dns-sd64: build dns-sd.c ClientCommon.c |
67c8f8a1 A |
87 | cc $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@ -m64 |
88 | ||
89 | # Note, we can make a 'fat' version of dns-sd using 'lipo', as shown below, but we | |
90 | # don't, because we don't want or need a 'fat' version of dns-sd, because it will | |
91 | # never need to access more than 4GB of data. We build the 64-bit version purely so | |
92 | # we have a test tool for making sure that the APIs work properly from 64-bit clients. | |
93 | # lipo -create dns-sd dns-sd64 -output dns-sd-fat |