Lines Matching +full:on +full:- +full:the +full:- +full:fly
1 # $NetBSD: hanoi-include.mk,v 1.5 2023/10/19 18:24:33 rillig Exp $
3 # Implements the Towers of Hanoi puzzle, demonstrating a bunch of more or less
6 # * default assignment using the ?= assignment operator
7 # * including the same file recursively (rather unusual)
8 # * extracting the current value of a variable using the .for loop
9 # * using the :: dependency operator for adding commands to a target
10 # * on-the-fly variable assignment expressions using the ::= modifier
13 # env N=3 make -r -f hanoi-include.mk
15 # Specifying N in the command line instead of in the environment would produce
16 # an endless loop, since variables from the command line cannot be overridden
18 # make -r -f hanoi-include.mk N=3
25 # Since make has no built-in arithmetic functions, convert N to a list of
26 # words and use the built-in word counting instead.
34 @echo "Move the upper disk from stack ${from} to stack ${to}."
37 _:= ${N::=${N:[1..-2]}} ${TMP::=${VIA}} ${VIA::=${TO}} ${TO::=${TMP}}
43 @echo "Move the upper disk from stack ${from} to stack ${to}."
46 _:= ${N::=${N:[1..-2]}} ${TMP::=${VIA}} ${VIA::=${FROM}} ${FROM::=${TMP}}