Changeset 3087 in kBuild for trunk/Config.kmk
- Timestamp:
- Oct 3, 2017 1:31:19 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Config.kmk
r3085 r3087 224 224 225 225 ifeq ($(KBUILD_TARGET),os2) 226 TEMPLATE_BIN_TOOL = GCC3OMF 227 TEMPLATE_BIN_CFLAGS = -g 228 TEMPLATE_BIN_CFLAGS.profile = -pg 229 TEMPLATE_BIN_CFLAGS.release = -O3 230 TEMPLATE_BIN_LDFLAGS = -Zhigh-mem -Zstack=1024 -g 231 endif 232 233 ifeq ($(KBUILD_TARGET),darwin) 234 ifndef KBUILD_MACOSX_VERSION 235 export KBUILD_MACOSX_VERSION := $(expr $(firstword $(subst ., ,$(shell uname -r))) - 4) 236 endif 237 #ifndef KBUILD_XCODE_VERSION 238 # export KBUILD_XCODE_VERSION := $(shell xcodebuild -version | kmk_sed -e '/Xcode/!d' -e 's/Xcode *//') 239 #endif 240 ifndef KBUILD_MACOSX_TARGET_VERSION 241 if $(KBUILD_TARGET_ARCH) == amd64 242 KBUILD_MACOSX_TARGET_VERSION = 6 243 else 244 KBUILD_MACOSX_TARGET_VERSION = 5 245 endif 246 endif 247 ifndef KBUILD_MACOSX_WHATEVER_MODE 248 if $(KBUILD_MACOSX_TARGET_VERSION) == 4 249 TOOL_GCC4MACHO_SUFFIX = -4.0 250 TOOL_GXX4MACHO_SUFFIX = -4.0 251 else if $(KBUILD_MACOSX_TARGET_VERSION) >= 5 252 TOOL_GCC4MACHO_SUFFIX = -4.2 253 TOOL_GXX4MACHO_SUFFIX = -4.2 254 endif 255 ifndef KBUILD_MACOSX_SDK 256 KBUILD_MACOSX_SDK := /Developer/SDKs/MacOSX10.$(KBUILD_MACOSX_TARGET_VERSION)$(if-expr $(KBUILD_MACOSX_TARGET_VERSION)==4,u,).sdk 257 ifeq ($(wildcard $(KBUILD_MACOSX_SDK)),) 258 KBUILD_MACOSX_SDK := /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform$(KBUILD_MACOSX_SDK) 259 endif 260 endif 261 ifeq ($(wildcard $(KBUILD_MACOSX_SDK)),) 262 $(error SDK not found ($(KBUILD_MACOSX_SDK)), please adjust KBUILD_MACOSX_TARGET_VERSION or/and KBUILD_MACOSX_SDK in LocalConfig.kmk or simply use KBUILD_MACOSX_WHATEVER_MODE=1.) 263 endif 264 endif # !KBUILD_MACOSX_WHATEVER_MODE 265 TEMPLATE_BIN_TOOL = GCC4MACHO 266 TEMPLATE_BIN_CFLAGS = -g -mmacosx-version-min=10.$(KBUILD_MACOSX_TARGET_VERSION) $(if $(KBUILD_MACOSX_WHATEVER_MODE),,-isysroot $(KBUILD_MACOSX_SDK)) 267 ifeq ($(USER),bird) 268 TEMPLATE_BIN_CFLAGS += -Wall $(GCC_Wextra) -pedantic -Wno-unused-parameter -Wno-long-long -Wshadow 269 TEMPLATE_BIN_DEFS += NO_ENUM_BITFIELDS 270 endif 271 TEMPLATE_BIN_CFLAGS.profile = -O3 -pg 226 TEMPLATE_BIN_TOOL = GCC3OMF 227 TEMPLATE_BIN_CFLAGS = -g 228 TEMPLATE_BIN_CFLAGS.profile = -pg 272 229 TEMPLATE_BIN_CFLAGS.release = -O3 273 TEMPLATE_BIN_LDFLAGS = -g -mmacosx-version-min=10.$(KBUILD_MACOSX_TARGET_VERSION) $(if $(KBUILD_MACOSX_WHATEVER_MODE),,-Wl,-syslibroot,$(KBUILD_MACOSX_SDK)) 274 if $(KBUILD_MACOSX_TARGET_VERSION) == 4 && $(KBUILD_MACOSX_VERSION) >= 5 275 TEMPLATE_BIN_LDFLAGS += -classic_ld 276 endif 277 TEMPLATE_BIN_LDFLAGS.profile = -pg 278 endif 279 280 ifeq ($(filter-out win nt,$(KBUILD_TARGET)),) 230 TEMPLATE_BIN_LDFLAGS = -Zhigh-mem -Zstack=1024 -g 231 232 else if1of ($(KBUILD_TARGET), win nt) 281 233 TEMPLATE_BIN_TOOL = VCC100 282 234 TEMPLATE_BIN_TOOL.x86 = VCC100X86 … … 320 272 endif 321 273 endif 322 endif 323 324 ifndef TEMPLATE_BIN_TOOL 325 # Use GCC3 when we're certain that the system is using GNU ld and ar. 326 ifeq ($(filter-out linux freebsd openbsd netbsd,$(KBUILD_TARGET)),) 327 TEMPLATE_BIN_TOOL = GCC3 328 else 329 TEMPLATE_BIN_TOOL = GCC3PLAIN 330 endif 331 TEMPLATE_BIN_CFLAGS = -g 332 ifeq ($(USER),bird) 333 TEMPLATE_BIN_CFLAGS += -Wall $(GCC_Wextra) -pedantic -Wno-unused-parameter -Wshadow 334 TEMPLATE_BIN_DEFS += NO_ENUM_BITFIELDS 335 endif 336 TEMPLATE_BIN_LDFLAGS = -g 337 TEMPLATE_BIN_LDFLAGS.profile = -pg -p 338 TEMPLATE_BIN_CFLAGS.release = -O3 339 TEMPLATE_BIN_CFLAGS.profile = -O3 -pg -p 340 ifeq ($(KBUILD_TARGET),freebsd) 341 TEMPLATE_BIN_INCS += $(PATH_GNUMAKE_SRC)/glob /usr/local/include 342 endif 343 ifeq ($(KBUILD_TARGET),linux) 344 TEMPLATE_BIN_LIBS += rt 345 endif 346 TEMPLATE_BIN_CFLAGS.x86 += -m32 347 TEMPLATE_BIN_CFLAGS.sparc32 += -m32 348 TEMPLATE_BIN_CFLAGS.amd64 += -m64 349 TEMPLATE_BIN_CFLAGS.sparc64 += -m64 350 TEMPLATE_BIN_CXXFLAGS.x86 += -m32 351 TEMPLATE_BIN_CXXFLAGS.sparc32+= -m32 352 TEMPLATE_BIN_CXXFLAGS.amd64 += -m64 353 TEMPLATE_BIN_CXXFLAGS.sparc64+= -m64 354 TEMPLATE_BIN_LDFLAGS.x86 += -m32 355 TEMPLATE_BIN_LDFLAGS.sparc32 += -m32 356 TEMPLATE_BIN_LDFLAGS.amd64 += -m64 357 TEMPLATE_BIN_LDFLAGS.sparc64 += -m64 274 275 else # !os2, !win, !nt 276 277 ifeq ($(KBUILD_TARGET),darwin) 278 ifndef KBUILD_MACOSX_VERSION 279 export KBUILD_MACOSX_VERSION := $(expr $(firstword $(subst ., ,$(shell uname -r))) - 4) 280 endif 281 #ifndef KBUILD_XCODE_VERSION 282 # export KBUILD_XCODE_VERSION := $(shell xcodebuild -version | kmk_sed -e '/Xcode/!d' -e 's/Xcode *//') 283 #endif 284 ifndef KBUILD_MACOSX_TARGET_VERSION 285 if $(KBUILD_TARGET_ARCH) == amd64 286 KBUILD_MACOSX_TARGET_VERSION = 6 287 else 288 KBUILD_MACOSX_TARGET_VERSION = 5 289 endif 290 endif 291 ifndef KBUILD_MACOSX_WHATEVER_MODE 292 if $(KBUILD_MACOSX_TARGET_VERSION) == 4 293 TOOL_GCC4MACHO_SUFFIX = -4.0 294 TOOL_GXX4MACHO_SUFFIX = -4.0 295 else if $(KBUILD_MACOSX_TARGET_VERSION) >= 5 296 TOOL_GCC4MACHO_SUFFIX = -4.2 297 TOOL_GXX4MACHO_SUFFIX = -4.2 298 endif 299 ifndef KBUILD_MACOSX_SDK 300 KBUILD_MACOSX_SDK := /Developer/SDKs/MacOSX10.$(KBUILD_MACOSX_TARGET_VERSION)$(if-expr $(KBUILD_MACOSX_TARGET_VERSION)==4,u,).sdk 301 ifeq ($(wildcard $(KBUILD_MACOSX_SDK)),) 302 KBUILD_MACOSX_SDK := /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform$(KBUILD_MACOSX_SDK) 303 endif 304 endif 305 ifeq ($(wildcard $(KBUILD_MACOSX_SDK)),) 306 $(error SDK not found ($(KBUILD_MACOSX_SDK)), please adjust KBUILD_MACOSX_TARGET_VERSION or/and KBUILD_MACOSX_SDK in LocalConfig.kmk or simply use KBUILD_MACOSX_WHATEVER_MODE=1.) 307 endif 308 endif # !KBUILD_MACOSX_WHATEVER_MODE 309 TEMPLATE_BIN_TOOL = GCC4MACHO 310 TEMPLATE_BIN_CFLAGS = -g -mmacosx-version-min=10.$(KBUILD_MACOSX_TARGET_VERSION) $(if $(KBUILD_MACOSX_WHATEVER_MODE),,-isysroot $(KBUILD_MACOSX_SDK)) 311 ifeq ($(USER),bird) 312 TEMPLATE_BIN_CFLAGS += -Wall $(GCC_Wextra) -pedantic -Wno-unused-parameter -Wno-long-long -Wshadow 313 TEMPLATE_BIN_DEFS += NO_ENUM_BITFIELDS 314 endif 315 TEMPLATE_BIN_CFLAGS.profile = -O3 -pg 316 TEMPLATE_BIN_CFLAGS.release = -O3 317 TEMPLATE_BIN_LDFLAGS = -g -mmacosx-version-min=10.$(KBUILD_MACOSX_TARGET_VERSION) $(if $(KBUILD_MACOSX_WHATEVER_MODE),,-Wl,-syslibroot,$(KBUILD_MACOSX_SDK)) 318 if $(KBUILD_MACOSX_TARGET_VERSION) == 4 && $(KBUILD_MACOSX_VERSION) >= 5 319 TEMPLATE_BIN_LDFLAGS += -classic_ld 320 endif 321 TEMPLATE_BIN_LDFLAGS.profile = -pg 322 323 else # !darwin 324 # Use GCC3 when we're certain that the system is using GNU ld and ar. 325 ifeq ($(filter-out linux freebsd openbsd netbsd,$(KBUILD_TARGET)),) 326 TEMPLATE_BIN_TOOL = GCC3 327 else 328 TEMPLATE_BIN_TOOL = GCC3PLAIN 329 endif 330 TEMPLATE_BIN_CFLAGS = -g 331 ifeq ($(USER),bird) 332 TEMPLATE_BIN_CFLAGS += -Wall $(GCC_Wextra) -pedantic -Wno-unused-parameter -Wshadow 333 TEMPLATE_BIN_DEFS += NO_ENUM_BITFIELDS 334 endif 335 TEMPLATE_BIN_LDFLAGS = -g 336 TEMPLATE_BIN_LDFLAGS.profile = -pg -p 337 TEMPLATE_BIN_CFLAGS.release = -O3 338 TEMPLATE_BIN_CFLAGS.profile = -O3 -pg -p 339 ifeq ($(KBUILD_TARGET),freebsd) 340 TEMPLATE_BIN_INCS += $(PATH_GNUMAKE_SRC)/glob /usr/local/include 341 endif 342 ifeq ($(KBUILD_TARGET),linux) 343 TEMPLATE_BIN_LIBS += rt 344 endif 345 endif 346 347 # Make sure we get the right bit count in the output. 348 TEMPLATE_BIN_CFLAGS.x86 += -m32 349 TEMPLATE_BIN_CFLAGS.sparc32 += -m32 350 TEMPLATE_BIN_CFLAGS.amd64 += -m64 351 TEMPLATE_BIN_CFLAGS.sparc64 += -m64 352 TEMPLATE_BIN_CXXFLAGS.x86 += -m32 353 TEMPLATE_BIN_CXXFLAGS.sparc32 += -m32 354 TEMPLATE_BIN_CXXFLAGS.amd64 += -m64 355 TEMPLATE_BIN_CXXFLAGS.sparc64 += -m64 356 TEMPLATE_BIN_LDFLAGS.x86 += -m32 357 TEMPLATE_BIN_LDFLAGS.sparc32 += -m32 358 TEMPLATE_BIN_LDFLAGS.amd64 += -m64 359 TEMPLATE_BIN_LDFLAGS.sparc64 += -m64 358 360 ifeq ($(KBUILD_TARGET),solaris) 359 361 TEMPLATE_BIN_LIBS += rt dl … … 366 368 endif 367 369 endif 370 371 # On systems where it's possible, do split out the debug info from the binaries. 368 372 if1of ($(KBUILD_TARGET), darwin win) 369 373 TEMPLATE_BIN_LD_DEBUG = split
Note:
See TracChangeset
for help on using the changeset viewer.