- #!/bin/ksh93
- #
- # make_numtree1.ksh93 - build makefile to generate number sequence
- # The resulting Makefile is intended to be used with $ make -j128 all #
- # as filesystem test
- #
- # Written by Roland Mainz <roland.mainz@nrubsig.org>
- #
- function make_number_seq
- {
- # set -o nounset
- nameref out_maketarget=$1
- integer start_i=$2
- integer stop_i=$3
- integer i
- typeset -a make_targets
- if (( (stop_i - start_i) > 100 ; then
- (( i=(stop_i - start_i)/2 ))
- make_number_seq make_targets[0] $start_i $(( start_i+i ))
- make_number_seq make_targets[1] $(( start_i+i+1 )) $stop_i
- else
- for ((i=start_i ; i < stop_i ; i++ )) ; do
- printf 'i_%d:\n' i
- printf '\tprintf "%d\\n" >"i_%d"\n' i i
- make_targets+=( "i_$i" )
- done
- fi
- out_maketarget="i_${start_i}_${stop_i}"
- printf 'i_%d_%d: %s\n' start_i stop_i "${make_targets[*]}"
- printf '\tcat '
- printf '%q ' "${make_targets[@]}"
- printf ' >"%s"\n' "$out_maketarget"
- return 0
- }
- typeset make_target
- make_number_seq make_target 0 100
- printf 'all: %s\n' "$make_target"
- # EOF.
make_numtree1.ksh93 - build makefile to generate number sequence
Posted by Anonymous on Fri 19th Jul 2024 00:01
raw | new post
view followups (newest first): make_numtree1.ksh93 - build makefile to generate number sequence by Anonymous
modification of post by Anonymous (view diff)
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.