Changeset 2517 for trunk/kBuild/footer.kmk
- Timestamp:
- Jul 26, 2011, 1:34:10 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kBuild/footer.kmk
r2514 r2517 1320 1320 1321 1321 if1of ($(insttype), stage both) 1322 local stage := $( evalcall FIRST-DEFINED-VAR,\1322 local stage := $(strip $(firstdefined \ 1323 1323 $(target)_STAGE.$(bld_trg).$(bld_trg_arch).$(bld_type) \ 1324 1324 $(target)_INST.$(bld_trg).$(bld_trg_arch).$(bld_type) \ … … 1335 1335 $(target)_STAGE \ 1336 1336 $(target)_INST \ 1337 definst ) 1337 definst \ 1338 ,value)) 1338 1339 $(target)_1_STAGE := $(stage) 1339 1340 if "$(substr $(stage),-1,1)" == "/" # Multicast support requires addprefix/suffix. … … 1351 1352 1352 1353 if1of ($(insttype), both) 1353 local inst := $( evalcall FIRST-DEFINED-VAR,\1354 local inst := $(strip $(firstdefined \ 1354 1355 $(target)_INST.$(bld_trg).$(bld_trg_arch).$(bld_type) \ 1355 1356 $(target)_INST.$(bld_trg).$(bld_trg_arch) \ … … 1359 1360 $(target)_INST.$(bld_type) \ 1360 1361 $(target)_INST \ 1361 definst ) 1362 definst \ 1363 ,value)) 1362 1364 $(target)_1_INST := $(inst) 1363 1365 if "$(substr $(inst),-1,1)" == "/" # Multicast support requires addprefix/suffix. … … 1526 1528 # Determine the actual INST and STAGE sub-dirs to use for this target. 1527 1529 if1of ($(insttype), stage both) 1528 local stage := $( evalcall FIRST-DEFINED-VAR,\1530 local stage := $(strip $(firstdefined \ 1529 1531 $(target)_STAGE.$(bld_trg).$(bld_trg_arch).$(bld_type) \ 1530 1532 $(target)_INST.$(bld_trg).$(bld_trg_arch).$(bld_type) \ … … 1541 1543 $(target)_STAGE \ 1542 1544 $(target)_INST \ 1543 definst ) 1545 definst \ 1546 ,value)) 1544 1547 if $(words $(stage)) > 1 1545 1548 $(warning kBuild: The STAGE/INST property of install '$(target)' specifies multiple location, that is not supported.) … … 1552 1555 1553 1556 if1of ($(insttype), both) 1554 local inst := $( evalcall FIRST-DEFINED-VAR,\1557 local inst := $(strip $(firstdefined \ 1555 1558 $(target)_INST.$(bld_trg).$(bld_trg_arch).$(bld_type) \ 1556 1559 $(target)_INST.$(bld_trg).$(bld_trg_arch) \ … … 1560 1563 $(target)_INST.$(bld_type) \ 1561 1564 $(target)_INST \ 1562 definst ) 1565 definst \ 1566 ,value)) 1563 1567 if $(words $(inst)) > 1 1564 1568 $(warning kBuild: The INST property of install '$(target)' specifies multiple location, that is not supported.) 1565 1569 local inst := $(word 1, $(inst)) 1570 endif 1571 ifneq ($(root $(stage)),) 1572 $(error kBuild: The INST property should not start with a root specification) 1566 1573 endif 1567 1574 $(target)_1_INST := $(inst) … … 3033 3040 local srcdst := $(word $(words $(srcdst)),$(srcdst)) 3034 3041 3035 # Calc destinations.3042 # instfun, mode, uid and gid 3036 3043 ifdef $(srcsrc)_INSTFUN 3037 3044 local instfun := $(srcsrc)_INSTFUN … … 3039 3046 local instfun := $(top_instfun) 3040 3047 endif 3041 3042 local stage := $(firstword $($(srcsrc)_STAGE) $($(srcsrc)_INST) $($(target)_1_STAGE))3043 ifneq ($(substr $(stage),-1),/)3044 $(warning kBuild: File $(srcsrc) in install target $(target) has a STAGE property without a trailing slash.)3045 local stage := $(stage)/3046 endif3047 local stage := $(stage)$(dir $(srcdstdir))3048 local stagedst := $(call $(instfun),$(srcdst),$(target),$(stage),$(PATH_STAGE))3049 3050 ifeq ($(insttype),both)3051 local inst := $(firstword $($(srcsrc)_INST) $($(target)_1_INST))3052 ifneq ($(substr $(inst),-1),/)3053 $(warning kBuild: File $(srcsrc) in install target $(target) has a INST property without a trailing slash.)3054 local inst := $(inst)/3055 endif3056 local inst := $(inst)$(dir $(srcdstdir))3057 local instdst := $(call $(instfun),$(srcdst),$(target),$(inst),$(PATH_INS))3058 endif3059 3060 #$(warning instfun=$(instfun) srcdst=$(srcdst) target=$(target) inst=$(inst) => instdst=$(instdst); stage=$(stage) => stagedst=$(stagedst))3061 3062 # mode, uid and gid3063 3048 local mode := $(firstword \ 3064 3049 $($(target)_$(srcsrc)$(source_type_prefix)_MODE.$(bld_trg).$(bld_trg_arch)) \ … … 3145 3130 3146 3131 # Generate the staging rule (requires double evaluation). 3132 local stage := $(strip $(firstdefined $(srcsrc)_STAGE $(srcsrc)_INST $(target)_1_STAGE,value)) 3133 if "$(substr $(stage),-1)" != "/" && "$(stage)" != "" 3134 $(warning kBuild: File $(srcsrc) in install target $(target) has a STAGE/INST property without a trailing slash: '$(stage)') 3135 local stage := $(stage)/ 3136 endif 3137 local stage := $(stage)$(dir $(srcdstdir)) 3138 ifeq ($(root $(stage)),) 3139 local stagedst := $(call $(instfun),$(srcdst),$(target),$(stage),$(PATH_STAGE)) 3140 else 3141 local stage := $(abspath $(stage)) 3142 ifeq ($(pos $(PATH_OBJ),$(stage)),1) 3143 local stage := $(substr $(stage), 1, $(length-var PATH_OBJ)) 3144 local stagedst := $(call $(instfun),$(srcdst),$(target),$(stage),$(PATH_OBJ)) 3145 else 3146 $(error kBuild: File $(srcsrc) in install target $(target) has a STAGE/INST property with an absolute path outside PATH_OBJ: '$(stage)') 3147 endif 3148 endif 3147 3149 ifdef $(srcsrc)_INSTALLER 3148 3150 local stagecmd := $(call $(srcsrc)_INSTALLER,$(srcsrc),$(stagedst),$(target),$(flags),stage) … … 3162 3164 # Generate the install rule 3163 3165 ifeq ($(insttype),both) 3166 local inst := $(strip $(firstdefined $(srcsrc)_INST $(target)_1_INST,value)) 3167 if "$(substr $(inst),-1)" != "/" && "$(inst)" != "" 3168 $(warning kBuild: File $(srcsrc) in install target $(target) has a INST property without a trailing slash: '$(inst)') 3169 local inst := $(inst)/ 3170 endif 3171 local inst := $(inst)$(dir $(srcdstdir)) 3172 ifneq ($(root $(inst)),) 3173 $(error kBuild: File $(srcsrc) in install target $(target) has a INST property with an absolute path: '$(inst)') 3174 endif 3175 local instdst := $(call $(instfun),$(srcdst),$(target),$(inst),$(PATH_INS)) 3176 3164 3177 ifdef $(srcsrc)_INSTALLER 3165 local instcmd 3178 local instcmd := $(call $(srcsrc)_INSTALLER,$(srcsrc),$(instdst),$(target),$(flags),install) 3166 3179 else ifdef $(target)_INSTALLER 3167 local instcmd 3180 local instcmd := $(call $(target)_INSTALLER,$(srcsrc),$(instdst),$(target),$(flags),install) 3168 3181 else 3169 3182 local instcmd := $$(INSTALL)\ … … 3178 3191 endif 3179 3192 3193 #$(warning instfun=$(instfun) srcdst=$(srcdst) target=$(target) inst=$(inst) => instdst=$(instdst); stage=$(stage) => stagedst=$(stagedst)) 3180 3194 endef # def_install_src 3181 3195 $(eval-opt-var def_install_src) … … 3212 3226 local symdst := $(word $(words $(symdst)),$(symdst)) 3213 3227 3214 # Calc destinations3228 # Figure which install function to use below. 3215 3229 ifdef $(symlnk)_INSTFUN 3216 3230 local instfun := $(symlnk)_INSTFUN … … 3219 3233 endif 3220 3234 3221 local stage := $(firstword $($(symlnk)_STAGE) $($(symlnk)_INST) $($(target)_1_STAGE)) 3222 ifneq ($(substr $(stage),-1),/) 3223 $(warning kBuild: Symlink $(symlnk) in install target $(target) has a STAGE property without a trailing slash: '$(stage)') 3224 local stage := $(stage)/ 3225 endif 3226 local stage := $(stage)$(dir $(srcdstdir)) 3227 local stagedst := $(call $(instfun),$(symlnk),$(target),$(stage),$(PATH_STAGE)) 3228 3229 local inst := $(firstword $($(symlnk)_INST) $($(target)_1_INST)) 3230 ifneq ($(substr $(inst),-1),/) 3231 $(warning kBuild: Symlnk $(symlnk) in install target $(target) has a INST property without a trailing slash: '$(inst)') 3232 local inst := $(inst)/ 3233 endif 3234 local inst := $(inst)$(dir $(srcdstdir)) 3235 local instdst := $(call $(instfun),$(symlnk),$(target),$(inst),$(PATH_INS)) 3236 #$(warning symlnk=$(symlnk) symdst=$(symdst) instdst=$(instdst) stagedst=$(stagedst) instfun=$(instfun) inst=$(inst) stage='$(stage)') 3237 3238 # Generate the staging rule (requires double evaluation). 3235 # Calc stage destination and generate the rule (requires double evaluation). 3236 local stage := $(strip $(firstdefined $(symlnk)_STAGE $(symlnk)_INST $(target)_1_STAGE,value)) 3237 if "$(substr $(stage),-1)" != "/" && "$(stage)" != "" 3238 $(warning kBuild: Symlink $(symlnk) in install target $(target) has a STAGE/INST property without a trailing slash: '$(stage)') 3239 local stage := $(stage)/ 3240 endif 3241 local stage := $(stage)$(dir $(srcdstdir)) 3242 ifeq ($(root $(stage)),) 3243 local stagedst := $(call $(instfun),$(symlnk),$(target),$(stage),$(PATH_STAGE)) 3244 else 3245 local stage := $(abspath $(stage)) 3246 ifeq ($(pos $(PATH_OBJ),$(stage)),1) 3247 local stage := $(substr $(stage), 1, $(length-var PATH_OBJ)) 3248 local stagedst := $(call $(instfun),$(symlnk),$(target),$(stage),$(PATH_OBJ)) 3249 else 3250 $(error kBuild: Symlink $(symlnk) in install target $(target) has a STAGE/INST property with an absolute path outside PATH_OBJ: '$(stage)') 3251 endif 3252 endif 3253 3239 3254 $(eval $(def_install_symlink_rule_staging)) 3240 3255 $(target)_2_STAGE_TARGETS += $(stagedst) 3241 3256 3242 # Generate the install rule.3257 # Calcuate the install destiation and generate the rule (if necessary). 3243 3258 ifeq ($(instmode),both) 3259 local inst := $(strip $(firstdefined $(symlnk)_INST $(target)_1_INST,value)) 3260 if "$(substr $(inst),-1)" != "/" && "$(inst)" != "" 3261 $(warning kBuild: Symlink $(symlnk) in install target $(target) has a INST property without a trailing slash: '$(inst)') 3262 local inst := $(inst)/ 3263 endif 3264 ifneq ($(root $(inst)),) 3265 $(error kBuild: Symlink $(symlnk) in install target $(target) has a INST property with an absolute path: '$(inst)') 3266 endif 3267 local inst := $(inst)$(dir $(srcdstdir)) 3268 local instdst := $(call $(instfun),$(symlnk),$(target),$(inst),$(PATH_INS)) 3244 3269 $(eval $(def_install_symlink_rule_installing)) 3245 3270 $(target)_2_INST_TARGETS += $(instdst) 3246 3271 endif 3247 3272 3273 #$(warning symlnk=$(symlnk) symdst=$(symdst) instdst=$(instdst) stagedst=$(stagedst) instfun=$(instfun) inst=$(inst) stage='$(stage)') 3248 3274 endef # def_install_symlink 3249 3275 $(optmize def_install_symlink) … … 3275 3301 3276 3302 # gather common properties. 3277 ifdef $(directory)_INST3278 local inst := $($(directory)_INST)3279 else3280 local inst := $($(target)_1_INST)3281 endif3282 ifneq ($(substr $(inst),-1),/)3283 $(warning kBuild: Directory $(directory) in install target $(target) has a INST property without a trailing slash.)3284 local inst := $(inst)/3285 endif3286 ifdef $(directory)_STAGE3287 local stage := $($(directory)_STAGE)3288 else ifdef $(directory)_INST3289 local stage := $($(directory)_INST)3290 else3291 local stage := $($(target)_1_STAGE)3292 endif3293 ifneq ($(substr $(stage),-1),/)3294 $(warning kBuild: Directory $(directory) in install target $(target) has a INST property without a trailing slash.)3295 local stage := $(stage)/3296 endif3297 3298 3303 local mode := $(firstword \ 3299 3304 $($(target)_$(directory)_MODE.$(bld_trg).$(bld_trg_arch)) \ … … 3328 3333 $($(target)_$(directory)_IDFLAGS.$(bld_trg)) \ 3329 3334 $($(target)_$(directory)_IDFLAGS.$(bld_trg).$(bld_trg_arch)) \ 3330 #$(warning directory=$(directory) inst=$(inst) stage=$(stage) mode=$(mode) gid=$(gid) uid=$(uid))3331 3335 3332 3336 # The staging rule (requires double evaluation). 3333 local insdst := $(PATH_STAGE)/$(stage)$(directory)/ 3337 local stage := $(strip $(firstdefined $(directory)_STAGE $(directory)_INST $(target)_1_STAGE,value)) 3338 if "$(substr $(stage),-1)" != "/" && "$(stage)" != "" 3339 $(warning kBuild: Directory $(directory) in install target $(target) has a STAGE/INST property without a trailing slash: '$(stage)') 3340 local stage := $(stage)/ 3341 endif 3342 ifeq ($(root $(stage)),) 3343 local insdst := $(PATH_STAGE)/$(stage)$(directory)/ 3344 else 3345 local stage := $(abspath $(stage)) 3346 ifeq ($(pos $(PATH_OBJ),$(stage)),1) 3347 local insdst := $(stage)$(directory)/ 3348 else 3349 $(error kBuild: Directory $(directory) in install target $(target) has a STAGE/INST property with an absolute path outside PATH_OBJ: '$(stage)') 3350 endif 3351 endif 3352 3334 3353 $(target)_2_STAGE_DIR_TARGETS += $(insdst) 3335 3354 $(eval $(def_install_directory_rule)) … … 3337 3356 # The install rule. 3338 3357 ifeq ($(insttype),both) 3358 local inst := $(strip $(firstdefined $(directory)_INST $(target)_1_INST,value)) 3359 ifneq ($(substr $(inst),-1),/) 3360 $(warning kBuild: Directory $(directory) in install target $(target) has a INST property without a trailing slash: '$(inst)') 3361 local inst := $(inst)/ 3362 endif 3363 ifeq ($(root $(stage)),) 3364 $(error kBuild: Directory $(directory) in install target $(target) has a INST property with an absoluate path: '$(inst)') 3365 endif 3339 3366 local insdst := $(PATH_INS)/$(inst)$(directory)/ 3340 3367 $(target)_2_INST_DIR_TARGETS += $(insdst) … … 3342 3369 endif 3343 3370 3371 #$(warning directory=$(directory) inst=$(inst) stage=$(stage) mode=$(mode) gid=$(gid) uid=$(uid)) 3344 3372 endef # def_install_directory 3345 3373 $(eval-opt-var def_install_directory)
Note:
See TracChangeset
for help on using the changeset viewer.