Ignore:
Timestamp:
Dec 15, 2006, 3:54:52 AM (19 years ago)
Author:
bird
Message:

Kicked the gnumake compatibility crap into separate files to speed things up. Added a slow stack implementation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/header.kmk

    r710 r723  
    217217 endif
    218218else
    219  # Vanilla GNU Make. Only supported for kBuild bootstrapping. Disable some features to make it work.
    220  NO_COMPILE_CMDS_DEPS:= 1
    221  NO_LINK_CMDS_DEPS   := 1
    222  sinclude $(PATH_KBUILD)/StampOutPredefines.kmk
    223  ifndef IS_BOOTSTRAPPING_KBUILD_NOW
    224   $(warning kBuild: Using vanilla GNU make isn't safe for anything but kBuild bootstrapping!)
    225  endif
     219 include $(PATH_KBUILD)/gnumake-header.kmk
    226220endif
    227221
     
    461455endif
    462456
     457
     458ifneq ($(filter stack,$(KMK_FEATURES)),stack) ## @todo retire this to gnumake-header.kmk when all the programs have been recompiled.
     459##
     460# Pushes an item onto a 'stack' variable.
     461# @param    $1   The stack variable name
     462# @param    $2   What to push.
     463stack-push = $(eval $1 +=$2)
     464
     465##
     466# Removes the top element from a 'stack' variable.
     467# @returns  The popped element
     468# @param    $1   The stack variable name
     469stack-pop  = $(call stack-top,$1)$(call stack-popv,$1)
     470
     471##
     472# Removes the top element from a 'stack' variable.
     473# This does *NOT* return the top element, use
     474# @param    $1   The stack variable name
     475# @remark This ain't very fast (that's why it's implemented in functions.c in kmk).
     476define def_stack-popv_sub
     477$1 :=$(__tmp)
     478__tmp+=$(item)
     479endef
     480define def_stack-popv
     481__tmp:=
     482$(foreach item,$($1),$(eval $(value def_stack-popv_sub)))
     483endef
     484stack-popv = $(eval $(value def_stack-popv))
     485
     486##
     487# Retrieves the top element from the 'stack' variable.
     488# @param    $1   The stack variable name
     489stack-top  = $(lastword $($1))
     490endif
     491
     492
    463493#
    464494# Initialize some of the globals which the Config.kmk and
     
    649679# The passes that should be defined. This must include
    650680# all passes mentioned by DEFAULT_PASSES.
    651 PASSES := FETCHES PATCHES $(DEFAULT_PASSES) PACKING NOTHING CLEAN
     681PASSES := FETCHES PATCHES $(DEFAULT_PASSES) NOTHING CLEAN
    652682
    653683
Note: See TracChangeset for help on using the changeset viewer.