Changeset 222 for trunk/kBuild


Ignore:
Timestamp:
Feb 8, 2005, 6:57:01 PM (20 years ago)
Author:
bird
Message:

Needed -> bldprogs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/footer.kmk

    r221 r222  
    5252# all of a type
    5353_OBJS     :=
     54_BLDPROGS :=
    5455_LIBS     :=
    5556_DLLS     :=
     
    7778# @param    $source      normalized main target
    7879# @param    $type      tooltype
     80# @param    bld_trg      build target.
    7981_SOURCE_TOOL = $(strip $(firstword \
    80         $($(target)_$(source)_$(type)TOOL.$(BUILD_TARGET)) \
     82        $($(target)_$(source)_$(type)TOOL.$(bld_trg)) \
    8183        $($(target)_$(source)_$(type)TOOL) \
    82         $($(target)_$(source)_TOOL.$(BUILD_TARGET)) \
     84        $($(target)_$(source)_TOOL.$(bld_trg)) \
    8385        $($(target)_$(source)_TOOL) \
    84         $($(target)_$(type)TOOL.$(BUILD_TARGET)) \
     86        $($(target)_$(type)TOOL.$(bld_trg)) \
    8587        $($(target)_$(type)TOOL) \
    86         $($(target)_TOOL.$(BUILD_TARGET)) \
     88        $($(target)_TOOL.$(bld_trg)) \
    8789        $($(target)_TOOL) \
    88         $($(source)_$(type)TOOL.$(BUILD_TARGET)) \
     90        $($(source)_$(type)TOOL.$(bld_trg)) \
    8991        $($(source)_$(type)TOOL) \
    90         $($(source)_TOOL.$(BUILD_TARGET)) \
     92        $($(source)_TOOL.$(bld_trg)) \
    9193        $($(source)_TOOL) \
    92         $($(type)TOOL.$(BUILD_TARGET)) \
     94        $($(type)TOOL.$(bld_trg)) \
    9395        $($(type)TOOL) \
    94         $(TOOL.$(BUILD_TARGET)) \
     96        $(TOOL.$(bld_trg)) \
    9597        $(TOOL) ))
    96 
    97 _SOURCE_TOOL_OLD = $(strip $(firstword \
    98         $($(target)_$(source)_$(type)TOOL.$(BUILD_TARGET)) $($(target)_$(source)_TOOL.$(BUILD_TARGET)) \
    99         $($(target)_$(source)_$(type)TOOL) $($target_$source_TOOL) \
    100         $($(target)_$(type)TOOL.$(BUILD_TARGET)) $($(target)_TOOL.$(BUILD_TARGET)) \
    101         $($(target)_$(type)TOOL) $($target_TOOL) \
    102         $($(source)_$(type)TOOL.$(BUILD_TARGET)) $($(source)_TOOL.$(BUILD_TARGET)) \
    103         $($(source)_$(type)TOOL) $($(source)_TOOL) \
    104         $($(type)TOOL.$(BUILD_TARGET)) $(TOOL.$(BUILD_TARGET)) \
    105         $($(type)TOOL) $(TOOL) ))
    10698
    10799## Figure out the tool for a target.
    108100# @param    $target             normalized target.
    109101# @param    $source      tooltype.
     102# @param    bld_trg      build target.
    110103_TARGET_TOOL = $(strip $(firstword \
    111         $($(target)_$(source)TOOL.$(BUILD_TARGET)) \
     104        $($(target)_$(source)TOOL.$(bld_trg)) \
    112105        $($(target)_$(source)TOOL) \
    113         $($(target)_TOOL.$(BUILD_TARGET)) \
     106        $($(target)_TOOL.$(bld_trg)) \
    114107        $($(target)_TOOL) \
    115108        $($(source)TOOL) \
    116         $($(source)TOOL.$(BUILD_TARGET)) \
    117         $(TOOL.$(BUILD_TARGET)) \
     109        $($(source)TOOL.$(bld_trg)) \
     110        $(TOOL.$(bld_trg)) \
    118111        $(TOOL) \
    119112        ))
     
    668661
    669662#
    670 # NEEDED
    671 #
    672 
    673 ## Needed (one).
     663# BLDPROGS
     664#
     665
     666## Build program (one).
    674667# @param    $(target)   Normalized target (program) name.
    675 define def_needed
     668define def_bldprog
    676669# basics
    677 $(eval tool        := $(call _TARGET_TOOL,$(target),LD))
    678 $(eval outbase     := $(call _TARGET_BASE,$(target),$(target)))
    679 $(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))))
    680670$(eval bld_type    := $(firstword $($(target)_BLD_TYPE)     $(BUILD_TYPE)))
    681671$(eval bld_trg     := $(firstword $($(target)_BLD_TRG)      $(BUILD_PLATFORM)))
    682672$(eval bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_PLATFORM_ARCH)))
    683673$(eval bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU)  $(BUILD_PLATFORM_CPU)))
     674$(eval tool        := $(call _TARGET_TOOL,$(target),LD))
     675$(eval outbase     := $(call _TARGET_BASE,$(target),$(target)))
     676$(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))))
    684677$(eval exesuff     := $(firstword $($(target)_EXESUFF) $($(target)_EXESUFF) $(TOOL_$(tool)_LDEXESUFF) $(HOSTSUFF_EXE)))
    685678$(eval exe         := $(outbase)$(exesuff))
     
    804797$(eval $(TOOL_$(tool)_LINK_PROGRAM))
    805798# publish rule (still need work)
    806 ifndef $(target)_INST
     799ifdef $(target)_INST
    807800$(eval pubexe := $(PATH_BIN)/$(notdir $(exe)))
    808801$(pubexe) : $(exe) $(dir $(pubexe)).dir_created
    809802        $(CP) $(exe) $(pubexe)
    810803
    811 _NEEDED    += $(pubexe)
     804_BLDPROGS   += $(pubexe)
    812805_OUT_FILES += $(exe) $(pubexe)
    813806else
    814 _NEEDED    += $(exe)
     807_BLDPROGS   += $(exe)
    815808_OUT_FILES += $(exe)
    816809endif
     
    818811endef
    819812
    820 # Process needed.
    821 $(foreach target, $(NEEDED) $(NEEDED.$(BUILD_TARGET)), $(eval $(def_needed)))
     813# Process build programs.
     814$(foreach target, $(BLDPROGS) $(BLDPROGS.$(BUILD_PLATFORM)), $(eval $(def_bldprog)))
    822815
    823816
     
    831824define def_lib
    832825# library basics
    833 $(eval tool        := $(call _TARGET_TOOL,$(target),AR))
    834 ifeq ($(tool),)
    835 $$(error kBuild: Library target $(target) doesn't have a tool defined!)
    836 endif
    837826## @todo prefix
    838 $(eval outbase     := $(call _TARGET_BASE,$(target),$(target)))
    839 $(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))))
    840827$(eval bld_type    := $(firstword $($(target)_BLD_TYPE)     $(BUILD_TYPE)))
    841828$(eval bld_trg     := $(firstword $($(target)_BLD_TRG)      $(BUILD_TARGET)))
    842829$(eval bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_TARGET_ARCH)))
    843830$(eval bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU)  $(BUILD_TARGET_CPU)))
     831$(eval tool        := $(call _TARGET_TOOL,$(target),AR))
     832ifeq ($(tool),)
     833$$(error kBuild: Library target $(target) doesn't have a tool defined!)
     834endif
     835$(eval outbase     := $(call _TARGET_BASE,$(target),$(target)))
     836$(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))))
    844837$(eval libsuff     := $(firstword\
    845838        $($(target)_LIBSUFF.$(bld_trg))\
     
    902895define def_dll
    903896# dllmod basics
    904 $(eval tool        := $(call _TARGET_TOOL,$(target),LD))
    905 $(eval outbase     := $(call _TARGET_BASE,$(target),$(target)))
    906 $(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))))
    907897$(eval bld_type    := $(firstword $($(target)_BLD_TYPE)     $(BUILD_TYPE)))
    908898$(eval bld_trg     := $(firstword $($(target)_BLD_TRG)      $(BUILD_TARGET)))
    909899$(eval bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_TARGET_ARCH)))
    910900$(eval bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU)  $(BUILD_TARGET_CPU)))
     901$(eval tool        := $(call _TARGET_TOOL,$(target),LD))
     902$(eval outbase     := $(call _TARGET_BASE,$(target),$(target)))
     903$(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))))
    911904$(eval dllsuff     := $(firstword $($(target)_DLLSUFF) $($(target)_DLLSUFF) $(TOOL_$(tool)_LDDLLSUFF) $(SUFF_DLL)))
    912905$(eval dll         := $(outbase)$(dllsuff))
     
    10881081define def_program
    10891082# basics
    1090 $(eval tool        := $(call _TARGET_TOOL,$(target),LD))
    1091 $(eval outbase     := $(call _TARGET_BASE,$(target),$(target)))
    1092 $(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))))
    10931083$(eval bld_type    := $(firstword $($(target)_BLD_TYPE)     $(BUILD_TYPE)))
    10941084$(eval bld_trg     := $(firstword $($(target)_BLD_TRG)      $(BUILD_TARGET)))
    10951085$(eval bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_TARGET_ARCH)))
    10961086$(eval bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU)  $(BUILD_TARGET_CPU)))
     1087$(eval tool        := $(call _TARGET_TOOL,$(target),LD))
     1088$(eval outbase     := $(call _TARGET_BASE,$(target),$(target)))
     1089$(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))))
    10971090$(eval exesuff     := $(firstword $($(target)_EXESUFF) $($(target)_EXESUFF) $(TOOL_$(tool)_LDEXESUFF) $(SUFF_EXE)))
    10981091$(eval exe         := $(outbase)$(exesuff))
     
    12441237define def_sysmod
    12451238# sysmod basics
    1246 $(eval tool        := $(call _TARGET_TOOL,$(target),LD))
    1247 $(eval outbase     := $(call _TARGET_BASE,$(target),$(target)))
    1248 $(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))))
    12491239$(eval bld_type    := $(firstword $($(target)_BLD_TYPE)     $(BUILD_TYPE)))
    12501240$(eval bld_trg     := $(firstword $($(target)_BLD_TRG)      $(BUILD_TARGET)))
    12511241$(eval bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_TARGET_ARCH)))
    12521242$(eval bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU)  $(BUILD_TARGET_CPU)))
     1243$(eval tool        := $(call _TARGET_TOOL,$(target),LD))
     1244$(eval outbase     := $(call _TARGET_BASE,$(target),$(target)))
     1245$(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))))
    12531246$(eval syssuff     := $(firstword $($(target)_SYSSUFF) $($(target)_SYSSUFF) $(TOOL_$(tool)_LDSYSSUFF) $(SUFF_SYS)))
    12541247$(eval sys         := $(outbase)$(syssuff))
     
    14441437# Do all the default passes if it's unspecified.
    14451438
    1446 #PASSES ?= needed libraries binaries others publish
    1447 PASSES ?= needed libraries dlls binaries others
     1439#PASSES ?= bldprogs libraries binaries others publish
     1440PASSES ?= bldprogs libraries dlls binaries others
    14481441
    14491442## @todo figure out a generic way of configuring how pass works!
     
    15031496
    15041497
    1505 ## PASS: needed
     1498## PASS: bldprogs
    15061499# This pass builds targets which are required for building the rest.
    1507 pass_needed_doit: $(_NEEDEDS)
    1508 pass := needed
    1509 PASS := NEEDED
     1500pass_bldprogs_doit: $(_BLDPROGS)
     1501pass := bldprogs
     1502PASS := BLDPROGS
    15101503$(eval $(def_pass))
    15111504
     
    16051598
    16061599# misc shortcuts.
    1607 target:    needed libraries binaries others
     1600target:    bldprogs libraries binaries others
    16081601objects:   $(_OBJS)
     1602bldprogs:  $(_BLDPROGS)
    16091603libraries: $(_LIBS) $(_IMPORT_LIBS) $(_OTHER_LIBRARIES)
    16101604dlls:      $(_DLLS)
Note: See TracChangeset for help on using the changeset viewer.