Changeset 729 for trunk/kBuild


Ignore:
Timestamp:
Dec 17, 2006, 3:12:07 AM (19 years ago)
Author:
bird
Message:

The target _PATH property should be working now.

Location:
trunk/kBuild
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/footer.kmk

    r726 r729  
    123123# Basic macros
    124124#
    125 
    126 ## Figure out the tool for a source
    127 # @param    target       source file
    128 # @param    source       normalized main target
    129 # @param    type         tooltype
    130 # @param    bld_trg      build target.
    131 # @param    bld_trg_arch build target architecture.
    132 # @remark       Obsoleted by kBuild helpers in kmk. Only required for gmake compatbility.
    133 _SOURCE_TOOL = $(strip $(firstword \
    134         $($(target)_$(source)_$(type)TOOL.$(bld_trg).$(bld_trg_arch)) \
    135         $($(target)_$(source)_$(type)TOOL.$(bld_trg)) \
    136         $($(target)_$(source)_$(type)TOOL) \
    137         $($(target)_$(source)_TOOL.$(bld_trg).$(bld_trg_arch)) \
    138         $($(target)_$(source)_TOOL.$(bld_trg)) \
    139         $($(target)_$(source)_TOOL) \
    140         $($(source)_$(type)TOOL.$(bld_trg).$(bld_trg_arch)) \
    141         $($(source)_$(type)TOOL.$(bld_trg)) \
    142         $($(source)_$(type)TOOL) \
    143         $($(source)_TOOL.$(bld_trg).$(bld_trg_arch)) \
    144         $($(source)_TOOL.$(bld_trg)) \
    145         $($(source)_TOOL) \
    146         $($(target)_$(type)TOOL.$(bld_trg).$(bld_trg_arch)) \
    147         $($(target)_$(type)TOOL.$(bld_trg)) \
    148         $($(target)_$(type)TOOL) \
    149         $($(target)_TOOL.$(bld_trg).$(bld_trg_arch)) \
    150         $($(target)_TOOL.$(bld_trg)) \
    151         $($(target)_TOOL) \
    152         $($(type)TOOL.$(bld_trg).$(bld_trg_arch)) \
    153         $($(type)TOOL.$(bld_trg)) \
    154         $($(type)TOOL) \
    155         $(TOOL.$(bld_trg).$(bld_trg_arch)) \
    156         $(TOOL.$(bld_trg)) \
    157         $(TOOL) ))
    158125
    159126## Figure out the tool for a target.
     
    193160,$(if $(subst :$(call no-root-slash,$(call no-drive,$(_fix_path))):,,:$(_fix_path):),$(_fix_path),$(abspath $2/$(_fix_path))))
    194161endif
    195 
    196 ## Figure out where to put object files.
    197 # @param    $1      source file
    198 # @param    $2      normalized main target
    199 # @remark There are two major hacks here:
    200 #           1. Source files in the output directory are translated into a gen/ subdir.
    201 #               2. Catch anyone specifying $(PATH_SUB_CURRENT)/sourcefile.c.
    202 # @remark       obsoleted by kBuild helpers in kmk. Only required for gmake compatbility.
    203 _OBJECT_BASE = $(PATH_TARGET)/$(2)/$(call no-root-slash,$(call no-drive,$(basename \
    204         $(patsubst $(PATH_ROOT)/%,%,$(patsubst $(PATH_SUB_CURRENT)/%,%,$(patsubst $(PATH_TARGET)/$(2)/%,gen/%,$(1)))))))
    205162
    206163## Figure out where to put object files.
     
    930887$(out): $(comp-vars _TARGET_$(target)_DIGEST_PREV,_TARGET_$(target)_DIGEST,FORCE) | $(call DIRDEP,$(inst))
    931888        $$(QUIET)$$(RM) -f $$@
    932         $$(call MSG_L1,$$(if $$(_TARGET_$(target)_DIGEST),$$(if $$(wildcard $(out).lst),Re-fetching,Fetching),Removing) $(target)...)
     889        $$(call MSG_L1,$$(if $$(wildcard $(out).lst),$$(if $$(_TARGET_$(target)_DIGEST),Re-fetching,Removing),Fetching) $(target)...)
    933890        $$(QUIET)$$(if $$(wildcard $(out).lst      ),$$(MAKE) -f $(MAKEFILE) --no-print-directory $(out)_unfetched)
    934891        $$(QUIET)$$(if  $$(_TARGET_$(target)_DIGEST),$$(MAKE) -f $(MAKEFILE) --no-print-directory $(out).lst,$$(RMDIR) -p --ignore-fail-on-non-empty --ignore-fail-on-not-exist $$(dir $$@))
     
    11271084# @param    bld_trg_arch  Build target arch.
    11281085# @param    bld_trg_cpu   Build target cpu.
    1129 def_target_source_c_cpp_asm_rc_new = $(kb-src-one x)
     1086def_target_source_c_cpp_asm_rc_new = $(kb-src-one )
    11301087ifneq ($(filter kb-src-one,$(KMK_FEATURES)),)
    11311088 def_target_source_c_cpp_asm_rc_var = def_target_source_c_cpp_asm_rc_new
     
    11391096# @param    much-more...
    11401097define def_target_sources
    1141 
    1142 # Apply any default path on the sources first.
    1143 ifneq ($(defpath),)
    1144  ifdef $(target)_SOURCES
    1145   $(target)_SOURCES := $(call abspathex,$($(target)_SOURCES),$(defpath))
    1146  endif
    1147  ifdef $(target)_SOURCES.$(bld_trg)
    1148   $(target)_SOURCES.$(bld_trg) := $(call abspathex,$($(target)_SOURCES.$(bld_trg)),$(defpath))
    1149  endif
    1150  ifdef $(target)_SOURCES.$(bld_trg).$(bld_trg_arch)
    1151   $(target)_SOURCES.$(bld_trg).$(bld_trg_arch) := $(call abspathex,$($(target)_SOURCES.$(bld_trg).$(bld_trg_arch)),$(defpath))
    1152  endif
    1153  ifdef $(target)_SOURCES.$(bld_trg_arch)
    1154   $(target)_SOURCES.$(bld_trg_arch) := $(call abspathex,$($(target)_SOURCES.$(bld_trg_arch)),$(defpath))
    1155  endif
    1156  ifdef $(target)_SOURCES.$(bld_trg_cpu)
    1157   $(target)_SOURCES.$(bld_trg_cpu) := $(call abspathex,$($(target)_SOURCES.$(bld_trg_cpu)),$(defpath))
    1158  endif
    1159  ifdef $(target)_SOURCES.$(bld_type)
    1160   $(target)_SOURCES.$(bld_type) := $(call abspathex,$($(target)_SOURCES.$(bld_type)),$(defpath))
    1161  endif
    1162 endif
    1163 
    11641098#$ (warning def_target_sources)
    11651099# C sources
     
    11941128# @param        $(definst)  The default _INST value.
    11951129# @param        $(typevar)  The name of the variable with all the root targets of its type.
    1196 # @obsolete Only library uses this now.
     1130# @remark  Only library uses this now.
    11971131define def_target_install_pluss
    11981132ifndef $(target)_NOINST
  • trunk/kBuild/gnumake-footer.kmk

    r723 r729  
    2424#
    2525#
     26
     27## Figure out the tool for a source
     28# @param    target       source file
     29# @param    source       normalized main target
     30# @param    type         tooltype
     31# @param    bld_trg      build target.
     32# @param    bld_trg_arch build target architecture.
     33# @remark       Obsoleted by kBuild helpers in kmk. Only required for gmake compatbility.
     34_SOURCE_TOOL = $(strip $(firstword \
     35        $($(target)_$(source)_$(type)TOOL.$(bld_trg).$(bld_trg_arch)) \
     36        $($(target)_$(source)_$(type)TOOL.$(bld_trg)) \
     37        $($(target)_$(source)_$(type)TOOL) \
     38        $($(target)_$(source)_TOOL.$(bld_trg).$(bld_trg_arch)) \
     39        $($(target)_$(source)_TOOL.$(bld_trg)) \
     40        $($(target)_$(source)_TOOL) \
     41        $($(source)_$(type)TOOL.$(bld_trg).$(bld_trg_arch)) \
     42        $($(source)_$(type)TOOL.$(bld_trg)) \
     43        $($(source)_$(type)TOOL) \
     44        $($(source)_TOOL.$(bld_trg).$(bld_trg_arch)) \
     45        $($(source)_TOOL.$(bld_trg)) \
     46        $($(source)_TOOL) \
     47        $($(target)_$(type)TOOL.$(bld_trg).$(bld_trg_arch)) \
     48        $($(target)_$(type)TOOL.$(bld_trg)) \
     49        $($(target)_$(type)TOOL) \
     50        $($(target)_TOOL.$(bld_trg).$(bld_trg_arch)) \
     51        $($(target)_TOOL.$(bld_trg)) \
     52        $($(target)_TOOL) \
     53        $($(type)TOOL.$(bld_trg).$(bld_trg_arch)) \
     54        $($(type)TOOL.$(bld_trg)) \
     55        $($(type)TOOL) \
     56        $(TOOL.$(bld_trg).$(bld_trg_arch)) \
     57        $(TOOL.$(bld_trg)) \
     58        $(TOOL) ))
     59
     60## Figure out where to put object files.
     61# @param    $1      source file
     62# @param    $2      normalized main target
     63# @remark There are two major hacks here:
     64#           1. Source files in the output directory are translated into a gen/ subdir.
     65#               2. Catch anyone specifying $(PATH_SUB_CURRENT)/sourcefile.c.
     66# @remark       obsoleted by kBuild helpers in kmk. Only required for gmake compatbility.
     67_OBJECT_BASE = $(PATH_TARGET)/$(2)/$(call no-root-slash,$(call no-drive,$(basename \
     68        $(patsubst $(PATH_ROOT)/%,%,$(patsubst $(PATH_SUB_CURRENT)/%,%,$(patsubst $(PATH_TARGET)/$(2)/%,gen/%,$(1)))))))
    2669
    2770
  • trunk/kBuild/subfooter.kmk

    r725 r729  
    5757#
    5858MAKEFILE_CURRENT := $(call stack-pop,_SUB_MAKEFILE_STACK)
    59 PATH_SUB_CURRENT := $(abspath $(patsubst %/,%,$(dir $(MAKEFILE_CURRENT))))
     59PATH_SUB_CURRENT := $(abspath $(dir $(MAKEFILE_CURRENT)))
    6060
    6161#
     
    6666endif
    6767
     68
  • trunk/kBuild/subheader.kmk

    r725 r729  
    2525#
    2626
    27 ifndef _SUB_MAKEFILE_STACK
     27ifndef _SUB_MAKEFILE_NOT_FIRST
     28
    2829 #
    2930 # The first time we just take the makefile context set by header.kmk.
    3031 #
     32 _SUB_MAKEFILE_NOT_FIRST := 1
    3133 include $(PATH_KBUILD)/header.kmk
    32 
     34 
    3335else
    3436
     
    6365 # Switch context.
    6466 #
     67
     68 # push the current old makefile onto the stack.
     69 $(call stack-push,_SUB_MAKEFILE_STACK,$(MAKEFILE_CURRENT))
     70
     71 # the current makefile is the 2nd from the end of the MAKEFILE_LIST (we're the last one).
    6572 __tmp := $(MAKEFILE_LIST)
    6673 $(call stack-popv,__tmp)
    6774 MAKEFILE_CURRENT := $(call stack-top,__tmp)
    68  PATH_SUB_CURRENT := $(abspath $(patsubst %/,%,$(dir $(MAKEFILE_CURRENT))))
     75 PATH_SUB_CURRENT := $(abspath $(dir $(MAKEFILE_CURRENT)))
    6976endif
    7077
    71 $(call stack-push,_SUB_MAKEFILE_STACK,$(MAKEFILE_CURRENT))
    72 
Note: See TracChangeset for help on using the changeset viewer.