Changeset 2523 in kBuild
- Timestamp:
- Jul 31, 2011 11:45:20 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Config.kmk
r2506 r2523 327 327 endif 328 328 endif 329 if1of ($(KBUILD_TARGET), darwin win) 330 TEMPLATE_BIN_LD_DEBUG = split 331 endif 329 332 330 333 # -
trunk/kBuild/footer-misc.kmk
r2521 r2523 68 68 # DIRECTORIES 69 69 # 70 _DIR_ALL := $(sort $(addsuffix /,$(patsubst %/,%,$(_DIRS))) $(dir $(_OUT_FILES) $(_OBJS) $(_INSTALLS_FILES) $(_STAGE_FILES))) 71 $(foreach directory,$(_INSTALLS_DIRS) $(_STAGE_DIRS), $(eval _DIR_ALL := $(filter-out $(directory),$(_DIR_ALL)))) 70 _DIR_ALL := $(sort \ 71 $(addsuffix /,$(patsubst %/,%,$(_DIRS) )) \ 72 $(dir $(_OUT_FILES) $(_OBJS) $(_INSTALLS_FILES) $(_DEBUG_INSTALL_FILES) $(_STAGE_FILES) $(_DEBUG_STAGE_FILES) ) \ 73 $(foreach path, $(KBUILD_INST_PATHS), $(PATH_INS)/$(INST_$(path)) $(PATH_STAGE)/$(STAGE_$(path)) ) \ 74 $(dir $(patsubst %/,%, $(_INSTALLS_DIRS) $(_STAGE_DIRS) $(_DEBUG_INSTALL_DIRS) $(_DEBUG_STAGE_DIRS)) ) \ 75 ) 76 $(foreach directory, \ 77 $(_INSTALLS_DIRS) \ 78 $(_STAGE_DIRS) \ 79 $(_DEBUG_INSTALL_DIRS) \ 80 $(_DEBUG_STAGE_DIRS) \ 81 , $(eval _DIR_ALL := $(filter-out $(directory),$(_DIR_ALL))) ) 72 82 73 83 -
trunk/kBuild/footer-pass1.kmk
r2521 r2523 85 85 # Staging and install directory target variables. 86 86 local insttype := $(firstword \ 87 $($(target)_INSTTYPE) \ 88 $($(target)_INSTTYPE.$(bld_trg)) \ 87 $($(target)_INSTTYPE.$(bld_trg).$(bld_trg_arch).$(bld_type)) \ 89 88 $($(target)_INSTTYPE.$(bld_trg).$(bld_trg_arch)) \ 90 $($(target)_INSTTYPE.$(bld_trg).$(bld_t rg_arch).$(bld_type)) \89 $($(target)_INSTTYPE.$(bld_trg).$(bld_type)) \ 91 90 $($(target)_INSTTYPE.$(bld_trg_arch)) \ 92 91 $($(target)_INSTTYPE.$(bld_trg_cpu)) \ 92 $($(target)_INSTTYPE.$(bld_trg)) \ 93 93 $($(target)_INSTTYPE.$(bld_type)) \ 94 $($(target)_INSTTYPE) \ 94 95 ) 95 96 ifeq ($(insttype),) … … 113 114 114 115 if1of ($(insttype), stage both) 116 local inst := $(strip $(firstdefined \ 117 $(target)_INST.$(bld_trg).$(bld_trg_arch).$(bld_type) \ 118 $(target)_INST.$(bld_trg).$(bld_trg_arch) \ 119 $(target)_INST.$(bld_trg).$(bld_type) \ 120 $(target)_INST.$(bld_trg_arch) \ 121 $(target)_INST.$(bld_trg_cpu) \ 122 $(target)_INST.$(bld_trg) \ 123 $(target)_INST.$(bld_type) \ 124 $(target)_INST \ 125 definst \ 126 ,value)) 115 127 local stage := $(strip $(firstdefined \ 116 128 $(target)_STAGE.$(bld_trg).$(bld_trg_arch).$(bld_type) \ 117 $(target)_INST.$(bld_trg).$(bld_trg_arch).$(bld_type) \118 129 $(target)_STAGE.$(bld_trg).$(bld_trg_arch) \ 119 $(target)_INST.$(bld_trg).$(bld_trg_arch) \120 130 $(target)_STAGE.$(bld_trg).$(bld_type) \ 121 $(target)_INST.$(bld_trg).$(bld_type) \122 131 $(target)_STAGE.$(bld_trg_arch) \ 123 $(target)_ INST.$(bld_trg_arch) \132 $(target)_STAGE.$(bld_trg_cpu) \ 124 133 $(target)_STAGE.$(bld_trg) \ 125 $(target)_INST.$(bld_trg) \126 134 $(target)_STAGE.$(bld_type) \ 127 $(target)_INST.$(bld_type) \128 135 $(target)_STAGE \ 129 $(target)_INST \ 130 definst \ 136 inst \ 131 137 ,value)) 132 138 $(target)_1_STAGE := $(stage) … … 145 151 146 152 if1of ($(insttype), both) 147 local inst := $(strip $(firstdefined \148 $(target)_INST.$(bld_trg).$(bld_trg_arch).$(bld_type) \149 $(target)_INST.$(bld_trg).$(bld_trg_arch) \150 $(target)_INST.$(bld_trg).$(bld_type) \151 $(target)_INST.$(bld_trg_arch) \152 $(target)_INST.$(bld_trg) \153 $(target)_INST.$(bld_type) \154 $(target)_INST \155 definst \156 ,value))157 153 $(target)_1_INST := $(inst) 158 154 if "$(substr $(inst),-1,1)" == "/" # Multicast support requires addprefix/suffix. … … 167 163 $(target)_1_INST_TARGET := 168 164 endif 165 166 # Debug info related stuff. 167 local debug_insttype := $(firstword \ 168 $($(target)_DEBUG_INSTTYPE.$(bld_trg).$(bld_trg_arch).$(bld_type)) \ 169 $($(target)_DEBUG_INSTTYPE.$(bld_trg).$(bld_trg_arch)) \ 170 $($(target)_DEBUG_INSTTYPE.$(bld_trg).$(bld_type)) \ 171 $($(target)_DEBUG_INSTTYPE.$(bld_trg_arch)) \ 172 $($(target)_DEBUG_INSTTYPE.$(bld_trg_cpu)) \ 173 $($(target)_DEBUG_INSTTYPE.$(bld_trg)) \ 174 $($(target)_DEBUG_INSTTYPE.$(bld_type)) \ 175 $($(target)_DEBUG_INSTTYPE) \ 176 $(insttype) ) 177 ifn1of ($(debug_insttype), none both stage) 178 $(error kBuild: Unknown value '$(debug_insttype)' for '$(target)_DEBUG_INSTTYPE'. Valid values are 'none', 'both' and 'stage'.) 179 endif 180 $(target)_1_DEBUG_INSTTYPE := $(debug_insttype) 181 182 if1of ($(debug_insttype), stage both) 183 ifn1of ($(insttype), stage both) 184 $(error kBuild: DEBUG_INSTTYPE=$(debug_insttype) and INSTTYPE=$(insttype) for target '$(target)' are not compatible) 185 endif 186 local debug_stage := $(firstdefined \ 187 $(target)_DEBUG_STAGE.$(bld_trg).$(bld_trg_arch).$(bld_type) \ 188 $(target)_DEBUG_STAGE.$(bld_trg).$(bld_trg_arch) \ 189 $(target)_DEBUG_STAGE.$(bld_trg).$(bld_type) \ 190 $(target)_DEBUG_STAGE.$(bld_trg_arch) \ 191 $(target)_DEBUG_STAGE.$(bld_trg_cpu) \ 192 $(target)_DEBUG_STAGE.$(bld_trg) \ 193 $(target)_DEBUG_STAGE.$(bld_type) \ 194 $(target)_DEBUG_STAGE \ 195 $(target)_DEBUG_INST.$(bld_trg).$(bld_trg_arch).$(bld_type) \ 196 $(target)_DEBUG_INST.$(bld_trg).$(bld_trg_arch) \ 197 $(target)_DEBUG_INST.$(bld_trg).$(bld_type) \ 198 $(target)_DEBUG_INST.$(bld_trg_arch) \ 199 $(target)_DEBUG_INST.$(bld_trg_cpu) \ 200 $(target)_DEBUG_INST.$(bld_trg) \ 201 $(target)_DEBUG_INST.$(bld_type) \ 202 $(target)_DEBUG_INST) 203 ifneq ($(debug_stage),) 204 $(target)_1_DEBUG_STAGE := $($(debug_stage)) 205 else 206 $(target)_1_DEBUG_STAGE := $(addprefix $(STAGE_DEBUG),$(stage)) 207 endif 208 ifndef $(target)_1_DEBUG_STAGE 209 $(target)_1_DEBUG_STAGE := ./ 210 endif 211 else 212 $(target)_1_DEBUG_STAGE := 213 endif 214 215 if1of ($(debug_insttype), both) 216 ifn1of ($(insttype), both) 217 $(error kBuild: DEBUG_INSTTYPE=$(debug_insttype) and INSTTYPE=$(insttype) for target '$(target)' are not compatible) 218 endif 219 local debug_inst := $(firstdefined \ 220 $(target)_DEBUG_INST.$(bld_trg).$(bld_trg_arch).$(bld_type) \ 221 $(target)_DEBUG_INST.$(bld_trg).$(bld_trg_arch) \ 222 $(target)_DEBUG_INST.$(bld_trg).$(bld_type) \ 223 $(target)_DEBUG_INST.$(bld_trg_arch) \ 224 $(target)_DEBUG_INST.$(bld_trg_cpu) \ 225 $(target)_DEBUG_INST.$(bld_trg) \ 226 $(target)_DEBUG_INST.$(bld_type) \ 227 $(target)_DEBUG_INST) 228 ifneq ($(debug_inst),) 229 $(target)_1_DEBUG_INST := $($(debug_inst)) 230 else 231 $(target)_1_DEBUG_INST := $(addprefix $(INST_DEBUG),$(inst)) 232 endif 233 ifndef $(target)_1_DEBUG_INST 234 $(target)_1_DEBUG_INST := ./ 235 endif 236 else 237 $(target)_1_DEBUG_INST := 238 endif 239 #$(warning $(NLTAB)$(target)_1_DEBUG_INST=$($(target)_1_DEBUG_INST)$(NLTAB)$(target)_1_DEBUG_STAGE=$($(target)_1_DEBUG_STAGE)$(NLTAB)insttype=$(insttype)$(NLTAB)debug_insttype=$(debug_insttype)) 169 240 170 241 endef # def_pass1_link_common … … 292 363 # Determine and set 1_INSTTYPE. 293 364 local insttype := $(firstword \ 294 $($(target)_INSTTYPE) \ 295 $($(target)_INSTTYPE.$(bld_trg)) \ 365 $($(target)_INSTTYPE.$(bld_trg).$(bld_trg_arch).$(bld_type)) \ 296 366 $($(target)_INSTTYPE.$(bld_trg).$(bld_trg_arch)) \ 297 $($(target)_INSTTYPE.$(bld_trg).$(bld_t rg_arch).$(bld_type)) \367 $($(target)_INSTTYPE.$(bld_trg).$(bld_type)) \ 298 368 $($(target)_INSTTYPE.$(bld_trg_arch)) \ 299 369 $($(target)_INSTTYPE.$(bld_trg_cpu)) \ 370 $($(target)_INSTTYPE.$(bld_trg)) \ 300 371 $($(target)_INSTTYPE.$(bld_type)) \ 372 $($(target)_INSTTYPE) \ 301 373 ) 302 374 ifeq ($(insttype),) … … 323 395 local stage := $(strip $(firstdefined \ 324 396 $(target)_STAGE.$(bld_trg).$(bld_trg_arch).$(bld_type) \ 397 $(target)_STAGE.$(bld_trg).$(bld_trg_arch) \ 398 $(target)_STAGE.$(bld_trg).$(bld_type) \ 399 $(target)_STAGE.$(bld_trg_arch) \ 400 $(target)_STAGE.$(bld_trg_cpu) \ 401 $(target)_STAGE.$(bld_trg) \ 402 $(target)_STAGE.$(bld_type) \ 403 $(target)_STAGE \ 325 404 $(target)_INST.$(bld_trg).$(bld_trg_arch).$(bld_type) \ 326 $(target)_STAGE.$(bld_trg).$(bld_trg_arch) \327 405 $(target)_INST.$(bld_trg).$(bld_trg_arch) \ 328 $(target)_STAGE.$(bld_trg).$(bld_type) \329 406 $(target)_INST.$(bld_trg).$(bld_type) \ 330 $(target)_STAGE.$(bld_trg_arch) \331 407 $(target)_INST.$(bld_trg_arch) \ 332 $(target)_ STAGE.$(bld_trg) \408 $(target)_INST.$(bld_trg_cpu) \ 333 409 $(target)_INST.$(bld_trg) \ 334 $(target)_STAGE.$(bld_type) \335 410 $(target)_INST.$(bld_type) \ 336 $(target)_STAGE \337 411 $(target)_INST \ 338 412 definst \ … … 353 427 $(target)_INST.$(bld_trg).$(bld_type) \ 354 428 $(target)_INST.$(bld_trg_arch) \ 429 $(target)_INST.$(bld_trg_cpu) \ 355 430 $(target)_INST.$(bld_trg) \ 356 431 $(target)_INST.$(bld_type) \ -
trunk/kBuild/footer-pass2-compiling-targets.kmk
r2521 r2523 137 137 $(out): .MUST_MAKE = $$(comp-cmds-ex $$($(target)_CMDS_PREV_),$$(commands $$@),FORCE) 138 138 endif 139 $(out) + $($(target)_2_OUTPUT) +| $($(target)_2_OUTPUT_MAYBE) : \ 139 $(out) \ 140 + $($(target)_2_OUTPUT) \ 141 + $($(target)_2_OUTPUT_DEBUG_FILES) \ 142 + $($(target)_2_OUTPUT_DEBUG_DIRS) \ 143 +| $($(target)_2_OUTPUT_MAYBE) : \ 140 144 $$$$($(target)_2_DEPEND) \ 141 145 $(value _DEP_LINK_CMDS) \ … … 143 147 $$$$($(target)_2_DEPORD) 144 148 %$$(call MSG_LINK,$(target),$$@,$(tool_do)) 145 $$(QUIET)$$(RM) -f -- $(dep) $(out) $($(target)_2_OUTPUT) $($(target)_2_OUTPUT_MAYBE) 149 $$(QUIET)$$(RM) -f -- $(dep) $(out) $($(target)_2_OUTPUT) $($(target)_2_OUTPUT_MAYBE) $($(target)_2_OUTPUT_DEBUG_FILES) 150 ifdef $(target)_2_OUTPUT_DEBUG_DIRS 151 $$(QUIET)$$(RM) -Rf -- $($(target)_2_OUTPUT_DEBUG_DIRS) 152 endif 146 153 147 154 $(cmds) … … 281 288 # 282 289 # @param 1 The property name. 290 # @param 2 The default property name, empty if none. 291 # @param 3 What to return if all variables are empty. (optional) 283 292 # @note Implicit parameters: target, bld_trg, bld_trg_arch, bld_trg_cpu, bld_type. 284 293 # @returns Expanded property value. 285 294 # 286 ## @todo bld_trg_cpu is missing here.287 295 define def_fn_prop_get_first_defined 288 ifdef $(target)_$(1).$(bld_trg).$(bld_trg_arch).$(bld_type) 289 local .RETURN := $($(target)_$(1).$(bld_trg).$(bld_trg_arch).$(bld_type)) 290 else ifdef $(target)_$(1).$(bld_trg).$(bld_trg_arch) 291 local .RETURN := $($(target)_$(1).$(bld_trg).$(bld_trg_arch)) 292 else ifdef $(target)_$(1).$(bld_trg).$(bld_type) 293 local .RETURN := $($(target)_$(1).$(bld_trg).$(bld_type)) 294 else ifdef $(target)_$(1).$(bld_trg_arch) 295 local .RETURN := $($(target)_$(1).$(bld_trg_arch)) 296 else ifdef $(target)_$(1).$(bld_trg) 297 local .RETURN := $($(target)_$(1).$(bld_trg)) 298 else ifdef $(target)_$(1).$(bld_type) 299 local .RETURN := $($(target)_$(1).$(bld_type)) 300 else ifdef $(target)_$(1) 301 local .RETURN := $($(target)_$(1)) 302 else ifdef $(1).$(bld_trg).$(bld_trg_arch).$(bld_type) 303 local .RETURN := $($(1).$(bld_trg).$(bld_trg_arch).$(bld_type)) 304 else ifdef $(1).$(bld_trg).$(bld_trg_arch) 305 local .RETURN := $($(1).$(bld_trg).$(bld_trg_arch)) 306 else ifdef $(1).$(bld_trg).$(bld_type) 307 local .RETURN := $($(1).$(bld_trg).$(bld_type)) 308 else ifdef $(1).$(bld_trg_arch) 309 local .RETURN := $($(1).$(bld_trg_arch)) 310 else ifdef $(1).$(bld_trg) 311 local .RETURN := $($(1).$(bld_trg)) 312 else ifdef $(1).$(bld_type) 313 local .RETURN := $($(1).$(bld_type)) 296 local .RETURN := $(firstdefined \ 297 $(target)_$(1).$(bld_trg).$(bld_trg_arch).$(bld_type) \ 298 $(target)_$(1).$(bld_trg).$(bld_trg_arch) \ 299 $(target)_$(1).$(bld_trg).$(bld_type) \ 300 $(target)_$(1).$(bld_trg_cpu) \ 301 $(target)_$(1).$(bld_trg_arch) \ 302 $(target)_$(1).$(bld_trg) \ 303 $(target)_$(1).$(bld_type) \ 304 $(target)_$(1) \ 305 ) 306 ifeq ($(.RETURN),) 307 ifneq ($(2),) 308 local .RETURN := $(firstdefined \ 309 $(2).$(bld_trg).$(bld_trg_arch).$(bld_type) \ 310 $(2).$(bld_trg).$(bld_trg_arch) \ 311 $(2).$(bld_trg).$(bld_type) \ 312 $(2).$(bld_trg_cpu) \ 313 $(2).$(bld_trg_arch) \ 314 $(2).$(bld_trg) \ 315 $(2).$(bld_type) \ 316 $(2) \ 317 3 \ 318 ) 319 else 320 local .RETURN := $(firstdefined \ 321 kBuildGlobalDefaults_$(1).$(bld_trg).$(bld_trg_arch).$(bld_type) \ 322 kBuildGlobalDefaults_$(1).$(bld_trg).$(bld_trg_arch) \ 323 kBuildGlobalDefaults_$(1).$(bld_trg).$(bld_type) \ 324 kBuildGlobalDefaults_$(1).$(bld_trg_cpu) \ 325 kBuildGlobalDefaults_$(1).$(bld_trg_arch) \ 326 kBuildGlobalDefaults_$(1).$(bld_trg) \ 327 kBuildGlobalDefaults_$(1).$(bld_type) \ 328 kBuildGlobalDefaults_$(1) \ 329 3 \ 330 ) 331 endif 332 endif 333 local .RETURN := $(strip $($(.RETURN))) 334 endef # def_fn_prop_get_first_defined 335 336 ## 337 # Function for getting the first property value (ignoring empty defines). 338 # 339 # @param 1 The property name. 340 # @param 2 The default property name, empty if none. 341 # @param 3 What to return if all variables are empty. (optional) 342 # @note Implicit parameters: target, bld_trg, bld_trg_arch, bld_trg_cpu, bld_type. 343 # @returns First word. 344 # 345 define def_fn_prop_get_first_word 346 local .RETURN := $(firstword \ 347 $($(target)_$(1).$(bld_trg).$(bld_trg_arch).$(bld_type)) \ 348 $($(target)_$(1).$(bld_trg).$(bld_trg_arch)) \ 349 $($(target)_$(1).$(bld_trg).$(bld_type)) \ 350 $($(target)_$(1).$(bld_trg_cpu)) \ 351 $($(target)_$(1).$(bld_trg_arch)) \ 352 $($(target)_$(1).$(bld_trg)) \ 353 $($(target)_$(1).$(bld_type)) \ 354 $($(target)_$(1)) \ 355 ) 356 ifeq ($(.RETURN),) 357 ifneq ($(2),) 358 local .RETURN := $(firstword \ 359 $($(2).$(bld_trg).$(bld_trg_arch).$(bld_type)) \ 360 $($(2).$(bld_trg).$(bld_trg_arch)) \ 361 $($(2).$(bld_trg).$(bld_type)) \ 362 $($(2).$(bld_trg_cpu)) \ 363 $($(2).$(bld_trg_arch)) \ 364 $($(2).$(bld_trg)) \ 365 $($(2).$(bld_type)) \ 366 $($(2)) \ 367 $(3) \ 368 ) 369 else 370 local .RETURN := $(firstword \ 371 $(kBuildGlobalDefaults_$(1).$(bld_trg).$(bld_trg_arch).$(bld_type)) \ 372 $(kBuildGlobalDefaults_$(1).$(bld_trg).$(bld_trg_arch)) \ 373 $(kBuildGlobalDefaults_$(1).$(bld_trg).$(bld_type)) \ 374 $(kBuildGlobalDefaults_$(1).$(bld_trg_cpu)) \ 375 $(kBuildGlobalDefaults_$(1).$(bld_trg_arch)) \ 376 $(kBuildGlobalDefaults_$(1).$(bld_trg)) \ 377 $(kBuildGlobalDefaults_$(1).$(bld_type)) \ 378 $(kBuildGlobalDefaults_$(1)) \ 379 $(3) \ 380 ) 381 endif 382 endif 383 endef # def_fn_prop_get_first_word 384 385 ## 386 # Install a debug directory. 387 # @param debug_dir The directory name. 388 define def_link_install_debug_dir_rule 389 local dir := $(debug_inst_path)/$(debug_inst)$(debug_dir) 390 $$(dir): | $$$$(dir $$$$(patsubst %/,%,$$$$@)) 391 %$$(call MSG_INST_DIR,$$@) 392 $$(QUIET)$$(MKDIR) -p -- $$@ 393 $(target)_2_DEBUG_$(debug_var)_TARGET_DIRS += $$(dir) 394 endef # def_link_install_debug_dir_rule 395 396 ## 397 # Install a debug file. 398 # @param debug_file Src=>Dst file pair. 399 define def_link_install_debug_file_rule 400 local dst := $(debug_inst_path)/$(debug_inst)$(word 2, $(subst =>,$(SP),$(debug_file))) 401 $$(dst): $(word 1, $(subst =>,$(SP),$(debug_file))) | $$$$(dir $$$$@) 402 %$$(call MSG_INST_FILE,$$@,$$<) 403 $$(QUIET)$(debug_install_cmd) $(if $(mode),-m $(mode)) $(if $(uid),-o $(uid)) $(if $(gid),-g $(gid)) -- $$< $$@ 404 $(target)_2_DEBUG_$(debug_var)_TARGET_FILES += $$(dst) 405 endef # def_link_install_debug_file_rule 406 407 ## 408 # Install debug info to $(debug_inst), where debug_inst can be a directory or 409 # file (just like $(inst) and $(stage). Used for both staging and installing. 410 define def_target_install_only_debug 411 if "$(substr $(debug_inst),-1,1)" == "/" 412 if "$(debug_inst)" == "./" 413 local debug_inst := 414 endif 415 local debug_dirs := $(patsubst $($(target)_0_OUTDIR)/%,%,$($(target)_2_OUTPUT_DEBUG_DIRS)) 416 ifneq ($(strip $(root $(debug_dirs))),) 417 $(error kBuild: Bad tool? debug_dirs='$(debug_dirs)', expected all to be under '$(outbase)') 418 endif 419 local debug_files := $(foreach file, $(patsubst $($(target)_0_OUTDIR)/%,%,$($(target)_2_OUTPUT_DEBUG_FILES)) \ 420 ,$($(target)_0_OUTDIR)/$(file)=>$(file)) 314 421 else 315 local .RETURN := $($(1)) 316 endif 317 endef # def_fn_prop_get_first_defined 422 local debug_files := $(call TOOL_$(tool)_$(tool_do)_DEBUG_INSTALL_FN,$(out),$(outbase),$(debug_inst)) 423 local debug_dirs := $(filter %/,$(debug_files)) 424 local debug_files := $(filter-out %/,$(debug_files)) 425 endif 426 $(foreach debug_dir, $(debug_dirs), $(eval $(def_link_install_debug_dir_rule))) 427 $(foreach debug_file, $(debug_files), $(eval $(def_link_install_debug_file_rule))) 428 endef 318 429 319 430 … … 365 476 $(typevar) += $(out) 366 477 endif # INSTTYPE == none 478 479 # Install debug info. 480 $(target)_2_DEBUG_STAGE_TARGET_DIRS := 481 $(target)_2_DEBUG_STAGE_TARGET_FILES := 482 $(target)_2_DEBUG_INSTALL_TARGET_DIRS := 483 $(target)_2_DEBUG_INSTALL_TARGET_FILES := 484 485 if ( defined($(target)_2_OUTPUT_DEBUG_DIRS) \ 486 || defined($(target)_2_OUTPUT_DEBUG_FILES) ) \ 487 && "$($(target)_1_DEBUG_INSTTYPE)" != "none" 488 local mode := $(if $(mode),$(mode)$(COMMA)a-x,0644) 489 490 ifeq ($($(target)_1_DEBUG_INSTTYPE),both) 491 local debug_inst_path := $(PATH_INS) 492 local debug_install_cmd := $(INSTALL) 493 local debug_var := INSTALL 494 $(foreach debug_inst, $($(target)_1_DEBUG_INST), $(evalval def_target_install_only_debug)) 495 endif 496 497 local debug_inst_path := $(PATH_STAGE) 498 local debug_install_cmd := $(INSTALL_STAGING) 499 local debug_var := STAGE 500 if1of ($($(target)_1_DEBUG_INSTTYPE), stage both) 501 $(foreach debug_inst, $($(target)_1_DEBUG_STAGE), $(evalval def_target_install_only_debug)) 502 endif 503 if1of ($($(target)_1_INSTTYPE), stage both) 504 ifndef debug_nostage 505 $(foreach debug_inst,$($(target)_1_STAGE), $(evalval def_target_install_only_debug)) 506 endif 507 endif 508 509 _DEBUG_STAGE_DIRS += $($(target)_2_DEBUG_STAGE_TARGET_DIRS) 510 _DEBUG_STAGE_FILES += $($(target)_2_DEBUG_STAGE_TARGET_FILES) 511 _DEBUG_INSTALL_DIRS += $($(target)_2_DEBUG_INSTALL_TARGET_DIRS) 512 _DEBUG_INSTALL_FILES += $($(target)_2_DEBUG_INSTALL_TARGET_FILES) 513 514 $(basename $(notdir $(out))):: $($(target)_2_DEBUG_STAGE_TARGET_DIRS) $($(target)_2_DEBUG_STAGE_TARGET_FILES) 515 endif 367 516 368 517 endef # def_target_install_only … … 534 683 535 684 # call the tool 536 local cmds := $(TOOL_$(tool)_LINK_LIBRARY_CMDS)685 local cmds := $(TOOL_$(tool)_LINK_LIBRARY_CMDS) 537 686 ifneq ($(pre_cmds),) 538 687 local cmds := $(TAB)$(pre_cmds)$(NL)$(TAB)$(cmds) 539 688 endif 540 689 ifneq ($(post_cmds),) 541 local cmds 690 local cmds := $(cmds)$(NL)$(TAB)$(post_cmds) 542 691 endif 543 692 $(target)_2_OUTPUT := $(TOOL_$(tool)_LINK_LIBRARY_OUTPUT) … … 813 962 endif 814 963 964 # Debug info. 965 local ld_debug := $(evalcall def_fn_prop_get_first_defined,LD_DEBUG) 966 local debug_inst := $(evalcall def_fn_prop_get_first_defined,DEBUG_INST) 967 local debug_stage := $(evalcall def_fn_prop_get_first_defined,DEBUG_STAGE) 968 local debug_nostage := $(evalcall def_fn_prop_get_first_word,DEBUG_NOSTAGE) 969 815 970 # Custom pre/post-link actions. 816 local pre_cmds := $(evalcall def_fn_prop_get_first_defined,PRE_CMDS)817 local post_cmds := $(evalcall def_fn_prop_get_first_defined,POST_CMDS)971 local pre_cmds := $(evalcall def_fn_prop_get_first_defined,PRE_CMDS) 972 local post_cmds := $(evalcall def_fn_prop_get_first_defined,POST_CMDS) 818 973 819 974 # eliminate this guy? 820 975 local objs = $($(target)_2_OBJS) 821 822 # installation targets823 local target_type_mode :=824 $(evalval def_target_install_only)825 976 826 977 # dependency file … … 861 1012 local cmds := $(cmds)$(NL)$(TAB)$(post_cmds) 862 1013 endif 863 $(target)_2_OUTPUT := $(TOOL_$(tool)_$(tool_do)_OUTPUT) 864 $(target)_2_OUTPUT_MAYBE := $(TOOL_$(tool)_$(tool_do)_OUTPUT_MAYBE) 865 $(target)_2_DEPEND := $(TOOL_$(tool)_$(tool_do)_DEPEND) $(deps) $($(target)_2_OBJS) 866 $(target)_2_DEPORD := $(TOOL_$(tool)_$(tool_do)_DEPORD) $(dirdep) $(orderdeps) 1014 $(target)_2_OUTPUT := $(TOOL_$(tool)_$(tool_do)_OUTPUT) 1015 $(target)_2_OUTPUT_MAYBE := $(TOOL_$(tool)_$(tool_do)_OUTPUT_MAYBE) 1016 if1of ($(ld_debug), split) 1017 $(target)_2_OUTPUT_DEBUG_FILES := $(filter-out %/,$(TOOL_$(tool)_$(tool_do)_OUTPUT_DEBUG)) 1018 $(target)_2_OUTPUT_DEBUG_DIRS := $(filter %/,$(TOOL_$(tool)_$(tool_do)_OUTPUT_DEBUG)) 1019 else 1020 $(target)_2_OUTPUT_DEBUG_FILES := 1021 $(target)_2_OUTPUT_DEBUG_DIRS := 1022 endif 1023 $(target)_2_DEPEND := $(TOOL_$(tool)_$(tool_do)_DEPEND) $(deps) $($(target)_2_OBJS) 1024 $(target)_2_DEPORD := $(TOOL_$(tool)_$(tool_do)_DEPORD) $(dirdep) $(orderdeps) 867 1025 868 1026 # generate the link rule. 869 1027 $(eval $(def_link_rule)) 870 1028 1029 # installation targets 1030 local target_type_mode := 1031 $(evalval def_target_install_only) 871 1032 872 1033 # Update globals. -
trunk/kBuild/footer.kmk
r2522 r2523 126 126 _INSTALLS_FILES := 127 127 _INSTALLS_DIRS := 128 _DEBUG_STAGE_FILES := 129 _DEBUG_STAGE_DIRS := 130 _DEBUG_INSTALL_FILES := 131 _DEBUG_INSTALL_DIRS := 128 132 _OTHERS := 129 133 _PACKING := … … 242 246 installs: $$(_INSTALLS_DIRS) $$(_INSTALLS_FILES) 243 247 248 install-debug: $$(_DEBUG_INSTALL_DIRS) $$(_DEBUG_INSTALL_FILES) 249 244 250 245 251 -
trunk/kBuild/header.kmk
r2520 r2523 914 914 PROPS_SINGLE := $(PROPS_TOOLS) TEMPLATE INSTTYPE INST STAGE NOINST BLD_TYPE BLD_TRG BLD_TRG_ARCH BLD_TRG_CPU FETCHDIR \ 915 915 OBJSUFF COBJSUFF CXXOBJSUFF OBJCOBJSUFF OBJCXXOBJSUFF ASOBJSUFF RCOBJSUFF SYSSUFF BINSUFF EXESUFF DLLSUFF LIBSUFF ARLIBSUFF \ 916 MODE UID GID 916 MODE UID GID LD_DEBUG DEBUG_INSTTYPE DEBUG_INST DEBUG_STAGE 917 917 ## PROPS_SINGLE_LNK 918 918 # Subset of PROPS_SINGLE which applies to all linkable targets. … … 920 920 INST NOINST BLD_TYPE BLD_TRG BLD_TRG_ARCH BLD_TRG_CPU \ 921 921 OBJSUFF COBJSUFF CXXOBJSUFF OBJCOBJSUFF OBJCXXOBJSUFF ASOBJSUFF RCOBJSUFF \ 922 MODE UID GID 922 MODE UID GID LD_DEBUG DEBUG_INSTTYPE DEBUG_INST DEBUG_STAGE 923 923 924 924 ## PROPS_DEFERRED … … 1146 1146 PASS_STAGING := Staging 1147 1147 PASS_STAGING_trgs := 1148 PASS_STAGING_vars := _STAG ING_DIRS _INSTALLS _STAGING_FILES1148 PASS_STAGING_vars := _STAGE_DIRS _INSTALLS _STAGE_FILES _DEBUG_STAGE_DIRS _DEBUG_STAGE_FILES 1149 1149 PASS_STAGING_pass := staging 1150 1150 … … 1154 1154 PASS_INSTALLS := Install 1155 1155 PASS_INSTALLS_trgs := 1156 PASS_INSTALLS_vars := _INSTALLS_DIRS _INSTALLS_FILES 1156 PASS_INSTALLS_vars := _INSTALLS_DIRS _INSTALLS_FILES _DEBUG_INSTALL_DIRS _DEBUG_INSTALL_FILES 1157 1157 PASS_INSTALLS_pass := installs 1158 1158 -
trunk/kBuild/tools/GCC4MACHO.kmk
r2431 r2523 51 51 TOOL_GCC4MACHO_LDFLAGS.sysmod ?= -r 52 52 #TOOL_GCC4MACHO_LD_SONAME = -Wl,-dylib_install_name $(firstword $($(1)_SONAME.$(KBUILD_TARGET).$(KBUILD_TYPE)) $($(1)_SONAME.$(KBUILD_TARGET)) $($(1)_SONAME.$(KBUILD_TYPE)) $($(1)_SONAME) $(notdir $(2))) 53 TOOL_GCC4MACHO_DSYMUTIL ?= dsymutil 53 54 54 55 ifdef SLKRUNS … … 104 105 TOOL_GCC4MACHO_LDFLAGS.debug ?= -g 105 106 TOOL_GCC4MACHO_LDFLAGS.profile ?= -g 107 108 109 ## 110 # Calculate the files in the debug bundle. 111 # @param 1 The whole output filename. 112 # @param 2 The output filename sans suffix. 113 TOOL_GCC4MACHO_DEBUG_BUNDLE_FN = \ 114 $(1).dSYM/ \ 115 $(1).dSYM/Contents/ \ 116 $(1).dSYM/Contents/Resources/ \ 117 $(1).dSYM/Contents/Resources/DWARF/ \ 118 $(1).dSYM/Contents/Info.plist \ 119 $(1).dSYM/Contents/Resources/DWARF/$(notdir $(1)) 120 121 ## 122 # Calculate the files in the debug bundle. 123 # @param 1 The whole linker output filename. 124 # @param 2 The linker output filename sans suffix. 125 # @param 3 The desired install name (no dir slash). 126 TOOL_GCC4MACHO_DEBUG_INSTALL_FN= \ 127 $(3).dSYM/ \ 128 $(3).dSYM/Contents/ \ 129 $(3).dSYM/Contents/Resources/ \ 130 $(3).dSYM/Contents/Resources/DWARF/ \ 131 $(1).dSYM/Contents/Info.plist=>$(3).dSYM/Contents/Info.plist \ 132 $(1).dSYM/Contents/Resources/DWARF/$(notdir $(1))=>$(3).dSYM/Contents/Resources/DWARF/$(notdir $(1)) 106 133 107 134 … … 350 377 # @param $(outbase) Output basename (full). Use this for list files and such. 351 378 TOOL_GCC4MACHO_LINK_PROGRAM_OUTPUT = $(outbase).rsp 379 TOOL_GCC4MACHO_LINK_PROGRAM_OUTPUT_DEBUG = $(call TOOL_GCC4MACHO_DEBUG_BUNDLE_FN,$(out)) 380 TOOL_GCC4MACHO_LINK_PROGRAM_DEBUG_INSTALL_FN = $(TOOL_GCC4MACHO_DEBUG_INSTALL_FN) 352 381 TOOL_GCC4MACHO_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) 353 382 TOOL_GCC4MACHO_LINK_PROGRAM_DEPORD = … … 358 387 $(foreach p,$(libpath), -L$(p))\ 359 388 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) 360 endef 389 ifeq ($(ld_debug),split) 390 $(QUIET)$(TOOL_GCC4MACHO_DSYMUTIL) --verbose -o $(out).dSYM/ $(out) 391 endif 392 endef 393 361 394 362 395 … … 375 408 # @param $(outbase) Output basename (full). Use this for list files and such. 376 409 TOOL_GCC4MACHO_LINK_DLL_OUTPUT = $(outbase).rsp 410 TOOL_GCC4MACHO_LINK_DLL_OUTPUT_DEBUG = $(call TOOL_GCC4MACHO_DEBUG_BUNDLE_FN,$(out)) 411 TOOL_GCC4MACHO_LINK_DLL_DEBUG_INSTALL_FN = $(TOOL_GCC4MACHO_DEBUG_INSTALL_FN) 377 412 TOOL_GCC4MACHO_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) 378 413 TOOL_GCC4MACHO_LINK_DLL_DEPORD = … … 384 419 $(foreach p,$(libpath), -L$(p))\ 385 420 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) 421 ifeq ($(ld_debug),split) 422 $(QUIET)$(TOOL_GCC4MACHO_DSYMUTIL) --verbose -o $(out).dSYM/ $(out) 423 endif 386 424 endef 387 425 … … 401 439 # @param $(outbase) Output basename (full). Use this for list files and such. 402 440 TOOL_GCC4MACHO_LINK_SYSMOD_OUTPUT = $(outbase).rsp 441 TOOL_GCC4MACHO_LINK_SYSMOD_OUTPUT_DEBUG = $(call TOOL_GCC4MACHO_DEBUG_BUNDLE_FN,$(out)) 442 TOOL_GCC4MACHO_LINK_SYSMOD_DEBUG_INSTALL_FN = $(TOOL_GCC4MACHO_DEBUG_INSTALL_FN) 403 443 TOOL_GCC4MACHO_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) 404 444 TOOL_GCC4MACHO_LINK_SYSMOD_DEPORD = … … 409 449 $(foreach p,$(libpath), -L$(p))\ 410 450 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) 411 endef 412 451 ifeq ($(ld_debug),split) 452 $(QUIET)$(TOOL_GCC4MACHO_DSYMUTIL) --verbose -o $(out).dSYM/ $(out) 453 endif 454 endef 455 -
trunk/kBuild/tools/GXX4MACHO.kmk
r2431 r2523 51 51 TOOL_GXX4MACHO_LDFLAGS.sysmod ?= -r 52 52 #TOOL_GXX4MACHO_LD_SONAME = -Wl,-dylib_install_name $(firstword $($(1)_SONAME.$(KBUILD_TARGET).$(KBUILD_TYPE)) $($(1)_SONAME.$(KBUILD_TARGET)) $($(1)_SONAME.$(KBUILD_TYPE)) $($(1)_SONAME) $(notdir $(2))) 53 TOOL_GXX4MACHO_DSYMUTIL ?= dsymutil 53 54 54 55 ifdef SLKRUNS … … 192 193 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" 193 194 endef 194 endif # !K USE_OBJCACHE195 endif # !KBUILD_USE_KOBJCACHE 195 196 196 197 … … 236 237 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" 237 238 endef 238 endif # !K USE_OBJCACHE239 endif # !KBUILD_USE_KOBJCACHE 239 240 240 241 … … 280 281 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" 281 282 endef 282 endif # !K USE_OBJCACHE283 endif # !KBUILD_USE_KOBJCACHE 283 284 284 285 … … 350 351 # @param $(outbase) Output basename (full). Use this for list files and such. 351 352 TOOL_GXX4MACHO_LINK_PROGRAM_OUTPUT = $(outbase).rsp 353 TOOL_GXX4MACHO_LINK_PROGRAM_OUTPUT_DEBUG = $(out).dSYM/ 352 354 TOOL_GXX4MACHO_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) 353 355 TOOL_GXX4MACHO_LINK_PROGRAM_DEPORD = … … 358 360 $(foreach p,$(libpath), -L$(p))\ 359 361 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) 362 ifeq ($(ld_debug),split) 363 $(QUIET)$(TOOL_GXX4MACHO_DSYMUTIL) --verbose -o $(out).dSYM/ $(out) 364 endif 360 365 endef 361 366 … … 375 380 # @param $(outbase) Output basename (full). Use this for list files and such. 376 381 TOOL_GXX4MACHO_LINK_DLL_OUTPUT = $(outbase).rsp 382 TOOL_GXX4MACHO_LINK_DLL_OUTPUT_DEBUG = $(out).dSYM/ 377 383 TOOL_GXX4MACHO_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) 378 384 TOOL_GXX4MACHO_LINK_DLL_DEPORD = … … 384 390 $(foreach p,$(libpath), -L$(p))\ 385 391 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) 392 ifeq ($(ld_debug),split) 393 $(QUIET)$(TOOL_GXX4MACHO_DSYMUTIL) --verbose -o $(out).dSYM/ $(out) 394 endif 386 395 endef 387 396 … … 401 410 # @param $(outbase) Output basename (full). Use this for list files and such. 402 411 TOOL_GXX4MACHO_LINK_SYSMOD_OUTPUT = $(outbase).rsp 412 TOOL_GXX4MACHO_LINK_SYSMOD_OUTPUT_DEBUG = $(out).dSYM/ 403 413 TOOL_GXX4MACHO_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) 404 414 TOOL_GXX4MACHO_LINK_SYSMOD_DEPORD = … … 409 419 $(foreach p,$(libpath), -L$(p))\ 410 420 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) 411 endef 412 421 ifeq ($(ld_debug),split) 422 $(QUIET)$(TOOL_GXX4MACHO_DSYMUTIL) --verbose -o $(out).dSYM/ $(out) 423 endif 424 endef 425
Note:
See TracChangeset
for help on using the changeset viewer.