Changeset 2537
- Timestamp:
- Aug 2, 2011, 9:44:43 PM (14 years ago)
- Location:
- trunk/kBuild
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kBuild/footer-pass2-compiling-targets.kmk
r2535 r2537 286 286 $(eval-opt-var def_target_sources) 287 287 288 289 ##290 # Function for getting the first defined propert value.291 #292 # @param 1 The property name.293 # @param 2 The default property name, empty if none.294 # @param 3 What to return if all variables are empty. (optional)295 # @note Implicit parameters: target, bld_trg, bld_trg_arch, bld_trg_cpu, bld_type.296 # @returns Expanded property value.297 #298 define def_fn_prop_get_first_defined299 local .RETURN := $(firstdefined \300 $(target)_$(1).$(bld_trg).$(bld_trg_arch).$(bld_type) \301 $(target)_$(1).$(bld_trg).$(bld_trg_arch) \302 $(target)_$(1).$(bld_trg).$(bld_type) \303 $(target)_$(1).$(bld_trg_cpu) \304 $(target)_$(1).$(bld_trg_arch) \305 $(target)_$(1).$(bld_trg) \306 $(target)_$(1).$(bld_type) \307 $(target)_$(1) \308 )309 ifeq ($(.RETURN),)310 ifneq ($(2),)311 local .RETURN := $(firstdefined \312 $(2).$(bld_trg).$(bld_trg_arch).$(bld_type) \313 $(2).$(bld_trg).$(bld_trg_arch) \314 $(2).$(bld_trg).$(bld_type) \315 $(2).$(bld_trg_cpu) \316 $(2).$(bld_trg_arch) \317 $(2).$(bld_trg) \318 $(2).$(bld_type) \319 $(2) \320 3 \321 )322 else323 local .RETURN := $(firstdefined \324 kBuildGlobalDefaults_$(1).$(bld_trg).$(bld_trg_arch).$(bld_type) \325 kBuildGlobalDefaults_$(1).$(bld_trg).$(bld_trg_arch) \326 kBuildGlobalDefaults_$(1).$(bld_trg).$(bld_type) \327 kBuildGlobalDefaults_$(1).$(bld_trg_cpu) \328 kBuildGlobalDefaults_$(1).$(bld_trg_arch) \329 kBuildGlobalDefaults_$(1).$(bld_trg) \330 kBuildGlobalDefaults_$(1).$(bld_type) \331 kBuildGlobalDefaults_$(1) \332 3 \333 )334 endif335 endif336 local .RETURN := $(strip $($(.RETURN)))337 endef # def_fn_prop_get_first_defined338 339 ##340 # Function for getting the first property value (ignoring empty defines).341 #342 # @param 1 The property name.343 # @param 2 The default property name, empty if none.344 # @param 3 What to return if all variables are empty. (optional)345 # @note Implicit parameters: target, bld_trg, bld_trg_arch, bld_trg_cpu, bld_type.346 # @returns First word.347 #348 define def_fn_prop_get_first_word349 local .RETURN := $(firstword \350 $($(target)_$(1).$(bld_trg).$(bld_trg_arch).$(bld_type)) \351 $($(target)_$(1).$(bld_trg).$(bld_trg_arch)) \352 $($(target)_$(1).$(bld_trg).$(bld_type)) \353 $($(target)_$(1).$(bld_trg_cpu)) \354 $($(target)_$(1).$(bld_trg_arch)) \355 $($(target)_$(1).$(bld_trg)) \356 $($(target)_$(1).$(bld_type)) \357 $($(target)_$(1)) \358 )359 ifeq ($(.RETURN),)360 ifneq ($(2),)361 local .RETURN := $(firstword \362 $($(2).$(bld_trg).$(bld_trg_arch).$(bld_type)) \363 $($(2).$(bld_trg).$(bld_trg_arch)) \364 $($(2).$(bld_trg).$(bld_type)) \365 $($(2).$(bld_trg_cpu)) \366 $($(2).$(bld_trg_arch)) \367 $($(2).$(bld_trg)) \368 $($(2).$(bld_type)) \369 $($(2)) \370 $(3) \371 )372 else373 local .RETURN := $(firstword \374 $(kBuildGlobalDefaults_$(1).$(bld_trg).$(bld_trg_arch).$(bld_type)) \375 $(kBuildGlobalDefaults_$(1).$(bld_trg).$(bld_trg_arch)) \376 $(kBuildGlobalDefaults_$(1).$(bld_trg).$(bld_type)) \377 $(kBuildGlobalDefaults_$(1).$(bld_trg_cpu)) \378 $(kBuildGlobalDefaults_$(1).$(bld_trg_arch)) \379 $(kBuildGlobalDefaults_$(1).$(bld_trg)) \380 $(kBuildGlobalDefaults_$(1).$(bld_type)) \381 $(kBuildGlobalDefaults_$(1)) \382 $(3) \383 )384 endif385 endif386 endef # def_fn_prop_get_first_word387 288 388 289 ## -
trunk/kBuild/footer-pass2-installs.kmk
r2531 r2537 45 45 $(stagedst) : $(srcsrc) | $(dir $(stagedst)) 46 46 %$$(call MSG_INST_FILE,$(srcsrc),$(stagedst)) 47 $(top_pre_file_cmds) 47 48 $$(QUIET)$(stagecmd) 49 $(top_post_file_cmds) 48 50 endef 49 51 $(eval-opt-var def_install_src_rule_staging) … … 54 56 $(instdst) : $(srcsrc) | $(dir $(instdst)) 55 57 %$$(call MSG_INST_FILE,$(srcsrc),$(instdst)) 58 $(top_pre_file_cmds) 56 59 $$(QUIET)$(instcmd) 60 $(top_post_file_cmds) 57 61 endef 58 62 $(eval-opt-var def_install_src_rule_installing) … … 245 249 %$$(call MSG_INST_SYM,$(stagedst),$(symdst)) 246 250 $$(QUIET)$$(RM) -f -- $$@ 251 $(top_pre_sym_cmds) 247 252 $$(QUIET)$$(LN_SYMLINK) $(symdst) $(stagedst) 253 $(top_post_sym_cmds) 248 254 endef 249 255 $(eval-opt-var def_install_symlink_rule_staging) … … 254 260 %$$(call MSG_INST_SYM,$(instdst),$(symdst)) 255 261 $$(QUIET)$$(RM) -f -- $$@ 262 $(top_pre_sym_cmds) 256 263 $$(QUIET)$$(LN_SYMLINK) $(symdst) $(instdst) 264 $(top_post_sym_cmds) 257 265 endef 258 266 $(eval-opt-var def_install_symlink_rule_installing) … … 331 339 $(insdst): 332 340 %$$(call MSG_INST_DIR,$(insdst)) 341 $(top_pre_dir_cmds) 333 342 $$(QUIET)$$(INSTALL) -d \ 334 343 $(if $(uid),-o $(uid))\ … … 337 346 $(flags) -- \ 338 347 $(insdst) 348 $(top_post_dir_cmds) 339 349 340 350 .NOTPARALLEL: $(insdst) … … 452 462 453 463 ifneq ($(insttype),none) 454 # cache top level target properties.464 # Cache top level target properties. 455 465 local top_mode := $(firstword \ 456 466 $($(target)_MODE.$(bld_trg).$(bld_trg_arch)) \ … … 482 492 local top_instfun := _INSTALL_FILE 483 493 endif 494 # The user have to use double expansion and can only use the above locals. Not 100% optimal... 495 local top_pre_file_cmds := $(evalcall def_fn_prop_get_first_defined,PRE_XFILE_CMDS) 496 local top_post_file_cmds := $(evalcall def_fn_prop_get_first_defined,POST_XFILE_CMDS) 497 local top_pre_sym_cmds := $(evalcall def_fn_prop_get_first_defined,PRE_SYMLINK_CMDS) 498 local top_post_sym_cmds := $(evalcall def_fn_prop_get_first_defined,POST_SYMLINK_CMDS) 499 local top_pre_dir_cmds := $(evalcall def_fn_prop_get_first_defined,PRE_DIRECTORY_CMDS) 500 local top_post_dir_cmds := $(evalcall def_fn_prop_get_first_defined,POST_DIRECTORY_CMDS) 484 501 485 502 $(foreach directory, \ -
trunk/kBuild/footer.kmk
r2523 r2537 209 209 210 210 211 211 ## 212 # Function for getting the first defined propert value. 213 # 214 # @param 1 The property name. 215 # @param 2 The default property name, empty if none. 216 # @param 3 What to return if all variables are empty. (optional) 217 # @note Implicit parameters: target, bld_trg, bld_trg_arch, bld_trg_cpu, bld_type. 218 # @returns Expanded property value. 219 # 220 define def_fn_prop_get_first_defined 221 local .RETURN := $(firstdefined \ 222 $(target)_$(1).$(bld_trg).$(bld_trg_arch).$(bld_type) \ 223 $(target)_$(1).$(bld_trg).$(bld_trg_arch) \ 224 $(target)_$(1).$(bld_trg).$(bld_type) \ 225 $(target)_$(1).$(bld_trg_cpu) \ 226 $(target)_$(1).$(bld_trg_arch) \ 227 $(target)_$(1).$(bld_trg) \ 228 $(target)_$(1).$(bld_type) \ 229 $(target)_$(1) \ 230 ) 231 ifeq ($(.RETURN),) 232 ifneq ($(2),) 233 local .RETURN := $(firstdefined \ 234 $(2).$(bld_trg).$(bld_trg_arch).$(bld_type) \ 235 $(2).$(bld_trg).$(bld_trg_arch) \ 236 $(2).$(bld_trg).$(bld_type) \ 237 $(2).$(bld_trg_cpu) \ 238 $(2).$(bld_trg_arch) \ 239 $(2).$(bld_trg) \ 240 $(2).$(bld_type) \ 241 $(2) \ 242 3 \ 243 ) 244 else 245 local .RETURN := $(firstdefined \ 246 kBuildGlobalDefaults_$(1).$(bld_trg).$(bld_trg_arch).$(bld_type) \ 247 kBuildGlobalDefaults_$(1).$(bld_trg).$(bld_trg_arch) \ 248 kBuildGlobalDefaults_$(1).$(bld_trg).$(bld_type) \ 249 kBuildGlobalDefaults_$(1).$(bld_trg_cpu) \ 250 kBuildGlobalDefaults_$(1).$(bld_trg_arch) \ 251 kBuildGlobalDefaults_$(1).$(bld_trg) \ 252 kBuildGlobalDefaults_$(1).$(bld_type) \ 253 kBuildGlobalDefaults_$(1) \ 254 3 \ 255 ) 256 endif 257 endif 258 local .RETURN := $(strip $($(.RETURN))) 259 endef # def_fn_prop_get_first_defined 260 261 ## 262 # Function for getting the first property value (ignoring empty defines). 263 # 264 # @param 1 The property name. 265 # @param 2 The default property name, empty if none. 266 # @param 3 What to return if all variables are empty. (optional) 267 # @note Implicit parameters: target, bld_trg, bld_trg_arch, bld_trg_cpu, bld_type. 268 # @returns First word. 269 # 270 define def_fn_prop_get_first_word 271 local .RETURN := $(firstword \ 272 $($(target)_$(1).$(bld_trg).$(bld_trg_arch).$(bld_type)) \ 273 $($(target)_$(1).$(bld_trg).$(bld_trg_arch)) \ 274 $($(target)_$(1).$(bld_trg).$(bld_type)) \ 275 $($(target)_$(1).$(bld_trg_cpu)) \ 276 $($(target)_$(1).$(bld_trg_arch)) \ 277 $($(target)_$(1).$(bld_trg)) \ 278 $($(target)_$(1).$(bld_type)) \ 279 $($(target)_$(1)) \ 280 ) 281 ifeq ($(.RETURN),) 282 ifneq ($(2),) 283 local .RETURN := $(firstword \ 284 $($(2).$(bld_trg).$(bld_trg_arch).$(bld_type)) \ 285 $($(2).$(bld_trg).$(bld_trg_arch)) \ 286 $($(2).$(bld_trg).$(bld_type)) \ 287 $($(2).$(bld_trg_cpu)) \ 288 $($(2).$(bld_trg_arch)) \ 289 $($(2).$(bld_trg)) \ 290 $($(2).$(bld_type)) \ 291 $($(2)) \ 292 $(3) \ 293 ) 294 else 295 local .RETURN := $(firstword \ 296 $(kBuildGlobalDefaults_$(1).$(bld_trg).$(bld_trg_arch).$(bld_type)) \ 297 $(kBuildGlobalDefaults_$(1).$(bld_trg).$(bld_trg_arch)) \ 298 $(kBuildGlobalDefaults_$(1).$(bld_trg).$(bld_type)) \ 299 $(kBuildGlobalDefaults_$(1).$(bld_trg_cpu)) \ 300 $(kBuildGlobalDefaults_$(1).$(bld_trg_arch)) \ 301 $(kBuildGlobalDefaults_$(1).$(bld_trg)) \ 302 $(kBuildGlobalDefaults_$(1).$(bld_type)) \ 303 $(kBuildGlobalDefaults_$(1)) \ 304 $(3) \ 305 ) 306 endif 307 endif 308 endef # def_fn_prop_get_first_word 309 310 311 # 312 # The main body. 313 # 212 314 include $(KBUILD_PATH)/footer-inherit-uses-tools.kmk 213 315 include $(KBUILD_PATH)/footer-pass1.kmk … … 218 320 include $(KBUILD_PATH)/footer-misc.kmk 219 321 include $(KBUILD_PATH)/footer-passes.kmk 322 220 323 221 324 # -
trunk/kBuild/header.kmk
r2536 r2537 970 970 # This list of non-accumulative target properties which are or may be 971 971 # functions, and thus should not be expanded until the very last moment. 972 PROPS_DEFERRED := INSTFUN INSTALLER PRE_CMDS POST_CMDS PRE_INST_CMDS POST_INST_CMDS NAME SONAME 972 PROPS_DEFERRED := INSTFUN INSTALLER PRE_CMDS POST_CMDS PRE_INST_CMDS POST_INST_CMDS \ 973 PRE_FILE_CMDS POST_FILE_CMDS PRE_SYMLINK_CMDS POST_SYMLINK_CMDS PRE_DIRECTORY_CMDS POST_DIRECTORY_CMDS \ 974 NAME SONAME 973 975 974 976 ## PROPS_ACCUMULATE_R … … 1065 1067 ## @{ 1066 1068 PROPS_INSTALLS_SINGLE := TOOL TEMPLATE INST NOINST BLD_TYPE BLD_TRG BLD_TRG_ARCH BLD_TRG_CPU MODE UID GID 1067 PROPS_INSTALLS_DEFERRED := INSTFUN INSTALLER 1069 PROPS_INSTALLS_DEFERRED := INSTFUN INSTALLER PRE_FILE_CMDS POST_FILE_CMDS PRE_SYMLINK_CMDS POST_SYMLINK_CMDS \ 1070 PRE_DIRECTORY_CMDS POST_DIRECTORY_CMDS 1068 1071 PROPS_INSTALLS_ACCUMULATE_R := DEPS ORDERDEPS GOALS INST_ONLY_GOALS STAGE_ONLY_GOALS IFFLAGS EXEC_IFFLAGS 1069 1072 PROPS_INSTALLS_ACCUMULATE_L := SOURCES EXEC_SOURCES DIRS CLEAN
Note:
See TracChangeset
for help on using the changeset viewer.