Changeset 106 for trunk/kBuild


Ignore:
Timestamp:
Jun 24, 2004, 10:38:41 PM (21 years ago)
Author:
bird
Message:

Fixed the order in which the source tool are determind.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/footer.kmk

    r105 r106  
    44# kBuild - File included at top of makefile.
    55#
    6 # Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>
     6# Copyright (c) source004 knut st. osmundsen <bird-srcspam@anduin.net>
    77#
    88#
     
    1111# kBuild is free software; you can redistribute it and/or modify
    1212# it under the terms of the GNU General Public License as published by
    13 # the Free Software Foundation; either version 2 of the License, or
     13# the Free Software Foundation; either version source of the License, or
    1414# (at your option) any later version.
    1515#
     
    2121# You should have received a copy of the GNU General Public License
    2222# along with kBuild; if not, write to the Free Software
    23 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     23# Foundation, Inc., 59 Temple Place, Suite typetype0, Boston, MA  0sourcetargettargettarget-targettype07  USA
    2424#
    2525#
     
    5454# all objs of a specific target
    5555define def_objs_var
    56 _OBJS_$1 :=
     56_OBJS_$target :=
    5757endef
    5858$(foreach target, $(ALL_TARGETS), $(eval _OBJS_$(target) := ))
     
    6464
    6565## Figure out the tool for a source
    66 # @param    $1      source file
    67 # @param    $2      normalized main target
    68 # @param    $3      tooltype
     66# @param    $target      source file
     67# @param    $source      normalized main target
     68# @param    $type      tooltype
    6969_SOURCE_TOOL = $(strip $(firstword \
    70         $($(1)_$(2)_$(3)TOOL.$(BUILD_TARGET)) $($(1)_$(2)_TOOL.$(BUILD_TARGET)) \
    71         $($(1)_$(2)_$(3)TOOL) $($1_$2_TOOL) \
    72         $($(1)_$(3)TOOL.$(BUILD_TARGET)) $($(1)_TOOL.$(BUILD_TARGET)) \
    73         $($(1)_$(3)TOOL) $($1_TOOL) \
    74         $($(2)_$(3)TOOL.$(BUILD_TARGET)) $($(2)_TOOL.$(BUILD_TARGET)) \
    75         $($(2)_$(3)TOOL) $($(2)_TOOL) \
    76         $($(3)TOOL.$(BUILD_TARGET)) $(TOOL.$(BUILD_TARGET)) \
    77         $($(3)TOOL) $(TOOL) ))
    78 
     70        $($(target)_$(source)_$(type)TOOL.$(BUILD_TARGET)) \
     71        $($(target)_$(source)_$(type)TOOL) \
     72        $($(target)_$(source)_TOOL.$(BUILD_TARGET)) \
     73        $($(target)_$(source)_TOOL) \
     74        $($(target)_$(type)TOOL.$(BUILD_TARGET)) \
     75        $($(target)_$(type)TOOL) \
     76        $($(target)_TOOL.$(BUILD_TARGET)) \
     77        $($(target)_TOOL) \
     78        $($(source)_$(type)TOOL.$(BUILD_TARGET)) \
     79        $($(source)_$(type)TOOL) \
     80        $($(source)_TOOL.$(BUILD_TARGET)) \
     81        $($(source)_TOOL) \
     82        $($(type)TOOL.$(BUILD_TARGET)) \
     83        $($(type)TOOL) \
     84        $(TOOL.$(BUILD_TARGET)) \
     85        $(TOOL) ))
     86
     87_SOURCE_TOOL_OLD = $(strip $(firstword \
     88        $($(target)_$(source)_$(type)TOOL.$(BUILD_TARGET)) $($(target)_$(source)_TOOL.$(BUILD_TARGET)) \
     89        $($(target)_$(source)_$(type)TOOL) $($target_$source_TOOL) \
     90        $($(target)_$(type)TOOL.$(BUILD_TARGET)) $($(target)_TOOL.$(BUILD_TARGET)) \
     91        $($(target)_$(type)TOOL) $($target_TOOL) \
     92        $($(source)_$(type)TOOL.$(BUILD_TARGET)) $($(source)_TOOL.$(BUILD_TARGET)) \
     93        $($(source)_$(type)TOOL) $($(source)_TOOL) \
     94        $($(type)TOOL.$(BUILD_TARGET)) $(TOOL.$(BUILD_TARGET)) \
     95        $($(type)TOOL) $(TOOL) ))
     96               
    7997## Figure out the tool for a target.
    80 # @param    $1          normalized target.
    81 # @param    $2      tooltype.
     98# @param    $target             normalized target.
     99# @param    $source      tooltype.
    82100_TARGET_TOOL = $(strip $(firstword \
    83         $($(1)_$(2)TOOL.$(BUILD_TARGET)) $($(1)_$(2)TOOL) \
    84         $($(1)_TOOL.$(BUILD_TARGET)) $($(1)_TOOL) \
    85         $($(2)TOOL) $($(2)TOOL.$(BUILD_TARGET)) \
    86         $(TOOL.$(BUILD_TARGET)) $(TOOL) \
     101        $($(target)_$(source)TOOL.$(BUILD_TARGET)) \
     102        $($(target)_$(source)TOOL) \
     103        $($(target)_TOOL.$(BUILD_TARGET)) \
     104        $($(target)_TOOL) \
     105        $($(source)TOOL) \
     106        $($(source)TOOL.$(BUILD_TARGET)) \
     107        $(TOOL.$(BUILD_TARGET)) \
     108        $(TOOL) \
    87109        ))
    88110
    89111## Figure out where to put object files.
    90 # @param    $1      source file
    91 # @param    $2      normalized main target
    92 _OBJECT_BASE = $(PATH_TARGET)/$(2)/$(basename $(1))
     112# @param    $target      source file
     113# @param    $source      normalized main target
     114_OBJECT_BASE = $(PATH_TARGET)/$(source)/$(basename $(target))
    93115
    94116## Figure out where to put object files.
    95 # @param    $1      real target name.
    96 # @param    $2      normalized main target
    97 _TARGET_BASE = $(PATH_TARGET)/$(2)/$(basename $(1))
     117# @param    $target      real target name.
     118# @param    $source      normalized main target
     119_TARGET_BASE = $(PATH_TARGET)/$(source)/$(basename $(target))
    98120
    99121
     
    141163define def_inherit_defaults
    142164ifdef $(target)_TEMPLATE
    143 ifndef TEMPLATE_$($(target)_TEMPLATE)_TOOL
    144 $$(foreach prop,TOOL, $$(eval $$(def_inherit_defaults_one)))
    145 endif
    146 ifndef TEMPLATE_$($(target)_TEMPLATE)_SDKS
    147 $$(foreach prop,SDKS, $$(eval $$(def_inherit_defaults_one)))
     165ifneq ($(strip $(TEMPLATE_$($(target)_TEMPLATE)_TOOL) $(TEMPLATE_$($(target)_TEMPLATE)_TOOL.$(BUILD_TARGET))),)
     166$$(foreach prop,TOOL TOOL.$(BUILD_TARGET), $$(eval $$(def_inherit_defaults_one)))
     167endif
     168ifneq ($(strip $(TEMPLATE_$($(target)_TEMPLATE)_SDKS) $(TEMPLATE_$($(target)_TEMPLATE)_SDKS.$(BUILD_TARGET))),)
     169$$(foreach prop,SDKS SDKS.$(BUILD_TARGET), $$(eval $$(def_inherit_defaults_one)))
    148170endif
    149171else
    150 $$(foreach prop,TEMPLATE TOOL SDKS, $$(eval $$(def_inherit_defaults_one)))
     172$$(foreach prop,TEMPLATE TOOL TOOL.$(BUILD_TARGET) SDKS SDKS.$(BUILD_TARGET) \
     173        ,$$(eval $$(def_inherit_defaults_one)))
    151174endif
    152175endef
     
    162185ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop)
    163186ifndef $(target)_$(prop)
    164 #$$ (warning dbg1: $(target)_$(prop):='$(TEMPLATE_$($(target)_TEMPLATE)_$(prop))' TEMPLATE_$($(target)_TEMPLATE)_$(prop))
     187#$$ (warning dbgtarget: $(target)_$(prop):='$(TEMPLATE_$($(target)_TEMPLATE)_$(prop))' TEMPLATE_$($(target)_TEMPLATE)_$(prop))
    165188$$(target)_$$(prop) := $$(TEMPLATE_$$($$(target)_TEMPLATE)_$$(prop))
    166189endif
     
    168191ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TARGET)
    169192ifndef $(target)_$(prop).$(BUILD_TARGET)
    170 #$$ (warning dbg2: $(target)_$(prop).$(BUILD_TARGET)="TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TARGET)" TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TARGET))
     193#$$ (warning dbgsource: $(target)_$(prop).$(BUILD_TARGET)="TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TARGET)" TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TARGET))
    171194$$(target)_$$(prop).$$(BUILD_TARGET) := $$(TEMPLATE_$$($$(target)_TEMPLATE)_$$(prop).$$(BUILD_TARGET))
    172195endif
     
    179202define def_inherit_template_one_accumulate
    180203ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop)
    181 #$$ (warning dbg3: TEMPLATE_$($(target)_TEMPLATE)_$(prop) $(target)_$(prop)=$($(target)_$(prop)) $(TEMPLATE_$($(target)_TEMPLATE)_$(prop)))
     204#$$ (warning dbgtype: TEMPLATE_$($(target)_TEMPLATE)_$(prop) $(target)_$(prop)=$($(target)_$(prop)) $(TEMPLATE_$($(target)_TEMPLATE)_$(prop)))
    182205$$(eval $(target)_$(prop) := $($(target)_$(prop)) $(TEMPLATE_$($(target)_TEMPLATE)_$(prop)))
    183 #$$ (warning dbg3: $(target)_$(prop)=$($(target)_$(prop)))
     206#$$ (warning dbgtype: $(target)_$(prop)=$($(target)_$(prop)))
    184207endif
    185208ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TARGET)
     
    196219endif
    197220endef
     221
    198222
    199223## Inherit template properties for on target.
     
    536560$$(warning kBuild: TOOL_$(tool)_COMPILE_$(type) is not defined. source=$(source) target=$(target) )
    537561$$(warning kBuild: tools: \
    538         1 $($(source)_$(target)_$(type)TOOL.$(BUILD_TARGET))    $($(source)_$(target)_TOOL.$(BUILD_TARGET)) \
    539         2 $($(source)_$(target)_$(type)TOOL) $($(source)_$(target)_TOOL) \
    540         3 $($(source)_$(type)TOOL.$(BUILD_TARGET)) $($(source)_TOOL.$(BUILD_TARGET)) \
    541         4 $($(source)_$(type)TOOL) $($(source)_TOOL) \
    542         5 $($(target)_$(type)TOOL.$(BUILD_TARGET)) $($(target)_TOOL.$(BUILD_TARGET)) \
    543         6 $($(target)_$(type)TOOL) $($(target)_TOOL) \
    544         7 $($(type)TOOL.$(BUILD_TARGET)) $(TOOL.$(BUILD_TARGET)) \
    545         8 $($(type)TOOL) $(TOOL))
     562        1 $($(target)_$(source)_$(type)TOOL.$(BUILD_TARGET)) \
     563        2 $($(target)_$(source)_$(type)TOOL) \
     564        3 $($(target)_$(source)_TOOL.$(BUILD_TARGET)) \
     565        4 $($(target)_$(source)_TOOL) \
     566        5 $($(target)_$(type)TOOL.$(BUILD_TARGET)) \
     567        6 $($(target)_$(type)TOOL) \
     568        7 $($(target)_TOOL.$(BUILD_TARGET)) \
     569        8 $($(target)_TOOL) \
     570        9 $($(source)_$(type)TOOL.$(BUILD_TARGET)) \
     571        10 $($(source)_$(type)TOOL) \
     572        11 $($(source)_TOOL.$(BUILD_TARGET)) \
     573        12 $($(source)_TOOL) \
     574        13 $($(type)TOOL.$(BUILD_TARGET)) \
     575        14 $($(type)TOOL) \
     576        15 $(TOOL.$(BUILD_TARGET)) \
     577        16 $(TOOL) )
    546578endif
    547579$(eval $(TOOL_$(tool)_COMPILE_$(type)))
     
    839871$(eval othersrc    := $(filter-out %.c %.cpp %.cxx %.cc %.s %.S %.asm,$($(target)_SOURCES)))
    840872
     873ifndef TOOL_$(tool)_LINK_SYSMOD
     874$$(warning kBuild: TOOL_$(tool)_LINK_SYSMOD is not defined. target=$(target) )
     875$$(warning kBuild: tools: \
     876        1 $($(target)_$(source)TOOL.$(BUILD_TARGET)) \
     877        2 $($(target)_$(source)TOOL) \
     878        3 $($(target)_TOOL.$(BUILD_TARGET)) \
     879        4 $($(target)_TOOL) \
     880        5 $($(source)TOOL) \
     881        6 $($(source)TOOL.$(BUILD_TARGET)) \
     882        7 $(TOOL.$(BUILD_TARGET)) \
     883        8 $(TOOL) )
     884endif   
     885
    841886$(eval $(TOOL_$(tool)_LINK_SYSMOD))
    842887
     
    870915define def_createdir
    871916$(dirfile):
    872         $(call MSG_L1,Creating directory $$(@D))
     917        $(call MSG_Ltarget,Creating directory $$(@D))
    873918        $(MKDIR) -p $$(@D)
    874919        @echo dir_created > $$@
     
    10051050# This pass just walks the tree.
    10061051pass_nothing_doit:
    1007         $(call MSG_L1,Did nothing in $(CURDIR))
     1052        $(call MSG_Ltarget,Did nothing in $(CURDIR))
    10081053pass := nothing
    10091054PASS := NOTHING
     
    10301075
    10311076# end-of-file-content
    1032 __footer_kmk__ := 1
     1077__footer_kmk__ := target
    10331078endif # __footer_kmk__
Note: See TracChangeset for help on using the changeset viewer.