]> git.saurik.com Git - apple/mdnsresponder.git/blob - Makefile
mDNSResponder-1310.80.1.tar.gz
[apple/mdnsresponder.git] / Makefile
1 #
2 # Copyright (c) 2003-2018 Apple Inc. All rights reserved.
3 #
4 # Top level makefile for Build & Integration (B&I).
5 #
6 # This file is used to facilitate checking the mDNSResponder project directly from git and submitting to B&I at Apple.
7 #
8 # The various platform directories contain makefiles or projects specific to that platform.
9 #
10 # B&I builds must respect the following target:
11 # install:
12 # installsrc:
13 # installhdrs:
14 # installapi:
15 # clean:
16 #
17
18 include $(MAKEFILEPATH)/pb_makefiles/platform.make
19
20 MVERS = "mDNSResponder-1310.80.1"
21
22 VER =
23 ifneq ($(strip $(GCC_VERSION)),)
24 VER = -- GCC_VERSION=$(GCC_VERSION)
25 endif
26 echo "VER = $(VER)"
27
28 projectdir := $(SRCROOT)/mDNSMacOSX
29 buildsettings := OBJROOT=$(OBJROOT) SYMROOT=$(SYMROOT) DSTROOT=$(DSTROOT) MVERS=$(MVERS) SDKROOT=$(SDKROOT)
30
31 .PHONY: install installSome installEmpty installExtras SystemLibraries installhdrs installapi installsrc java clean
32
33 # Sanitizer support
34 # Disable Sanitizer instrumentation in LibSystem contributors. See rdar://problem/29952210.
35 UNSUPPORTED_SANITIZER_PROJECTS := mDNSResponderSystemLibraries mDNSResponderSystemLibraries_Sim
36 PROJECT_SUPPORTS_SANITIZERS := 1
37 ifneq ($(words $(filter $(UNSUPPORTED_SANITIZER_PROJECTS), $(RC_ProjectName))), 0)
38 PROJECT_SUPPORTS_SANITIZERS := 0
39 endif
40 ifeq ($(RC_ENABLE_ADDRESS_SANITIZATION),1)
41 ifeq ($(PROJECT_SUPPORTS_SANITIZERS),1)
42 $(info Enabling Address Sanitizer)
43 buildsettings += -enableAddressSanitizer YES
44 else
45 $(warning WARNING: Address Sanitizer not supported for project $(RC_ProjectName))
46 endif
47 endif
48 ifeq ($(RC_ENABLE_THREAD_SANITIZATION),1)
49 ifeq ($(PROJECT_SUPPORTS_SANITIZERS),1)
50 $(info Enabling Thread Sanitizer)
51 buildsettings += -enableThreadSanitizer YES
52 else
53 $(warning WARNING: Thread Sanitizer not supported for project $(RC_ProjectName))
54 endif
55 endif
56 ifeq ($(RC_ENABLE_UNDEFINED_BEHAVIOR_SANITIZATION),1)
57 ifeq ($(PROJECT_SUPPORTS_SANITIZERS),1)
58 $(info Enabling Undefined Behavior Sanitizer)
59 buildsettings += -enableUndefinedBehaviorSanitizer YES
60 else
61 $(warning WARNING: Undefined Behavior Sanitizer not supported for project $(RC_ProjectName))
62 endif
63 endif
64
65 # B&I install build targets
66 #
67 # For the mDNSResponder build alias, the make target used by B&I depends on the platform:
68 #
69 # Platform Make Target
70 # -------- -----------
71 # osx install
72 # ios installSome
73 # atv installSome
74 # watch installSome
75 #
76 # For the mDNSResponderSystemLibraries and mDNSResponderSystemLibraries_sim build aliases, B&I uses the SystemLibraries
77 # target for all platforms.
78
79 install:
80 ifeq ($(RC_ProjectName), mDNSResponderServices)
81 ifeq ($(RC_PROJECT_COMPILATION_PLATFORM), osx)
82 cd '$(projectdir)'; xcodebuild install $(buildsettings) -target 'Build Services-macOS' $(VER)
83 else
84 cd '$(projectdir)'; xcodebuild install $(buildsettings) -target 'Build Services' $(VER)
85 endif
86 else ifeq ($(RC_ProjectName), mDNSResponderServices_Sim)
87 mkdir -p $(DSTROOT)/AppleInternal
88 else
89 cd '$(projectdir)'; xcodebuild install $(buildsettings) $(VER)
90 endif
91
92 installSome:
93 cd '$(projectdir)'; xcodebuild install $(buildsettings) $(VER)
94
95 installEmpty:
96 mkdir -p $(DSTROOT)/AppleInternal
97
98 installExtras:
99 ifeq ($(RC_PROJECT_COMPILATION_PLATFORM), osx)
100 cd '$(projectdir)'; xcodebuild install $(buildsettings) -target 'Build Extras-macOS' $(VER)
101 else ifeq ($(RC_PROJECT_COMPILATION_PLATFORM), ios)
102 cd '$(projectdir)'; xcodebuild install $(buildsettings) -target 'Build Extras-iOS' $(VER)
103 else ifeq ($(RC_PROJECT_COMPILATION_PLATFORM), atv)
104 cd '$(projectdir)'; xcodebuild install $(buildsettings) -target 'Build Extras-tvOS' $(VER)
105 else
106 cd '$(projectdir)'; xcodebuild install $(buildsettings) -target 'Build Extras' $(VER)
107 endif
108
109 SystemLibraries:
110 cd '$(projectdir)'; xcodebuild install $(buildsettings) -target SystemLibraries $(VER)
111
112 # B&I installhdrs build targets
113
114 installhdrs::
115 ifeq ($(RC_ProjectName), mDNSResponderServices)
116 ifeq ($(RC_PROJECT_COMPILATION_PLATFORM), osx)
117 cd '$(projectdir)'; xcodebuild installhdrs $(buildsettings) -target 'Build Services-macOS' $(VER)
118 else
119 cd '$(projectdir)'; xcodebuild installhdrs $(buildsettings) -target 'Build Services' $(VER)
120 endif
121 else ifeq ($(RC_ProjectName), mDNSResponderServices_Sim)
122 mkdir -p $(DSTROOT)/AppleInternal
123 else ifneq ($(findstring SystemLibraries,$(RC_ProjectName)),)
124 cd '$(projectdir)'; xcodebuild installhdrs $(buildsettings) -target SystemLibraries $(VER)
125 endif
126
127 # B&I installapi build targets
128
129 installapi:
130 ifeq ($(RC_ProjectName), mDNSResponderServices)
131 ifeq ($(RC_PROJECT_COMPILATION_PLATFORM), osx)
132 cd '$(projectdir)'; xcodebuild installapi $(buildsettings) -target 'Build Services-macOS' $(VER)
133 else
134 cd '$(projectdir)'; xcodebuild installapi $(buildsettings) -target 'Build Services' $(VER)
135 endif
136 else ifeq ($(RC_ProjectName), mDNSResponderServices_Sim)
137 mkdir -p $(DSTROOT)/AppleInternal
138 else ifneq ($(findstring SystemLibraries,$(RC_ProjectName)),)
139 cd '$(projectdir)'; xcodebuild installapi $(buildsettings) -target SystemLibrariesDynamic $(VER)
140 endif
141
142 # Misc. targets
143
144 installsrc:
145 ditto . '$(SRCROOT)'
146 rm -rf '$(SRCROOT)/mDNSWindows' '$(SRCROOT)/Clients/FirefoxExtension'
147
148 java:
149 cd '$(projectdir)'; xcodebuild install $(buildsettings) -target libjdns_sd.jnilib $(VER)
150
151 clean::
152 echo clean