I want to execute the following commands:
./a.out 1
./a.out 2
./a.out 3
./a.out 4
.
.
. and so on
How to write this thing as a loop in a
A simple, shell/platform-independent, pure macro solution is ...
# GNU make (`gmake`) compatible; ref:
define EOL
$()
endef
%sequence = $(if $(word ${1},${2}),$(wordlist 1,${1},${2}),$(call %sequence,${1},${2} $(words _ ${2})))
.PHONY: target
target:
$(foreach i,$(call %sequence,10),./a.out ${i}${EOL})