Hier ist mein Makefile und der Ausgang, wie der Bereich wie [1-5, 7, 9-10]
zu drucken?Wie berechnet man den Bereich in Makefile
$ ls /tmp/foo
foo10.txt foo1.txt foo2.txt foo3.txt foo4.txt foo5.txt foo7.txt foo9.txt
$ cat Makefile
DIR1 := /tmp/foo/
COMMA :=,
EMPTY :=
SPACE := $(EMPTY) $(EMPTY)
VERSIONS := $(subst $(SPACE),$(COMMA),$(patsubst foo%,%,$(basename $(notdir $(wildcard $(DIR1)/foo*.txt)))))
all:
$(info versions is [${VERSIONS}])
$ make
versions is [10,1,2,3,4,5,7,9]
-I-Format-Shell-Befehle aufrufen können, wenn das helfen geht. – rodee
Suchen Sie nur nach einer Makefile-Lösung oder akzeptieren Sie auch ein Bash-Skript? – anubhava
Bash ist auch in Ordnung, ich kann eine Shell-Befehle von meinem Makefile aufrufen. – rodee