2 # Copyright (c) 2003-2018 Apple Inc. All rights reserved.
4 # Top level makefile for Build & Integration (B&I).
6 # This file is used to facilitate checking the mDNSResponder project directly from git and submitting to B&I at Apple.
8 # The various platform directories contain makefiles or projects specific to that platform.
10 # B&I builds must respect the following target:
18 include $(MAKEFILEPATH)/pb_makefiles/platform.make
20 MVERS = "mDNSResponder-1310.80.1"
23 ifneq ($(strip $(GCC_VERSION)),)
24 VER = -- GCC_VERSION=$(GCC_VERSION)
28 projectdir := $(SRCROOT)/mDNSMacOSX
29 buildsettings := OBJROOT=$(OBJROOT) SYMROOT=$(SYMROOT) DSTROOT=$(DSTROOT) MVERS=$(MVERS) SDKROOT=$(SDKROOT)
31 .PHONY: install installSome installEmpty installExtras SystemLibraries installhdrs installapi installsrc java clean
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
40 ifeq ($(RC_ENABLE_ADDRESS_SANITIZATION),1)
41 ifeq ($(PROJECT_SUPPORTS_SANITIZERS),1)
42 $(info Enabling Address Sanitizer)
43 buildsettings += -enableAddressSanitizer YES
45 $(warning WARNING: Address Sanitizer not supported for project $(RC_ProjectName))
48 ifeq ($(RC_ENABLE_THREAD_SANITIZATION),1)
49 ifeq ($(PROJECT_SUPPORTS_SANITIZERS),1)
50 $(info Enabling Thread Sanitizer)
51 buildsettings += -enableThreadSanitizer YES
53 $(warning WARNING: Thread Sanitizer not supported for project $(RC_ProjectName))
56 ifeq ($(RC_ENABLE_UNDEFINED_BEHAVIOR_SANITIZATION),1)
57 ifeq ($(PROJECT_SUPPORTS_SANITIZERS),1)
58 $(info Enabling Undefined Behavior Sanitizer)
59 buildsettings += -enableUndefinedBehaviorSanitizer YES
61 $(warning WARNING: Undefined Behavior Sanitizer not supported for project $(RC_ProjectName))
65 # B&I install build targets
67 # For the mDNSResponder build alias, the make target used by B&I depends on the platform:
69 # Platform Make Target
70 # -------- -----------
76 # For the mDNSResponderSystemLibraries and mDNSResponderSystemLibraries_sim build aliases, B&I uses the SystemLibraries
77 # target for all platforms.
80 ifeq ($(RC_ProjectName), mDNSResponderServices)
81 ifeq ($(RC_PROJECT_COMPILATION_PLATFORM), osx)
82 cd '$(projectdir)'; xcodebuild install $(buildsettings) -target 'Build Services-macOS' $(VER)
84 cd '$(projectdir)'; xcodebuild install $(buildsettings) -target 'Build Services' $(VER)
86 else ifeq ($(RC_ProjectName), mDNSResponderServices_Sim)
87 mkdir -p $(DSTROOT)/AppleInternal
89 cd '$(projectdir)'; xcodebuild install $(buildsettings) $(VER)
93 cd '$(projectdir)'; xcodebuild install $(buildsettings) $(VER)
96 mkdir -p $(DSTROOT)/AppleInternal
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)
106 cd '$(projectdir)'; xcodebuild install $(buildsettings) -target 'Build Extras' $(VER)
110 cd '$(projectdir)'; xcodebuild install $(buildsettings) -target SystemLibraries $(VER)
112 # B&I installhdrs build targets
115 ifeq ($(RC_ProjectName), mDNSResponderServices)
116 ifeq ($(RC_PROJECT_COMPILATION_PLATFORM), osx)
117 cd '$(projectdir)'; xcodebuild installhdrs $(buildsettings) -target 'Build Services-macOS' $(VER)
119 cd '$(projectdir)'; xcodebuild installhdrs $(buildsettings) -target 'Build Services' $(VER)
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)
127 # B&I installapi build targets
130 ifeq ($(RC_ProjectName), mDNSResponderServices)
131 ifeq ($(RC_PROJECT_COMPILATION_PLATFORM), osx)
132 cd '$(projectdir)'; xcodebuild installapi $(buildsettings) -target 'Build Services-macOS' $(VER)
134 cd '$(projectdir)'; xcodebuild installapi $(buildsettings) -target 'Build Services' $(VER)
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)
146 rm -rf '$(SRCROOT)/mDNSWindows' '$(SRCROOT)/Clients/FirefoxExtension'
149 cd '$(projectdir)'; xcodebuild install $(buildsettings) -target libjdns_sd.jnilib $(VER)