FILE := list.txt
LIST := $(shell cat $(FILE))
TARGETS := $(addsuffix .run,$(LIST))
all: $(TARGETS)
%.run:
sh hoge.sh $*
#!/bin/sh
sleep 3
echo $@
aa
bb
cc
ajiyoshiさん
$ /usr/bin/time make -j 5
sh hoge.sh aa
sh hoge.sh bb
sh hoge.sh cc
aa
bb
cc
3.04 real 0.01 user 0.02 sys
さいないぷさん
FILE := list.txt
LIST := $(shell cat $(FILE))
TARGETS := $(addsuffix .run,$(LIST))
all: $(TARGETS)
%.run:
sh hoge.sh $* 2>&1 > $@.tmp
mv $@.tmp $@
しょーた
まずは1件づつ
FILE_PATH := test_dir
LIST := $(shell ls -R $(FILE_PATH))
.PHONY: echo
echo :
@echo $(LIST)
all: $(TARGETS)
$(shell ls -1R $(FILE_PATH) | xargs -I {} sh test.sh {})
完成した
FILE_PATH := target_dir
LIST := $(shell ls -FR $(FILE_PATH) | grep -v "/" | grep -v "FILE_PATH:" )
TARGETS := $(addsuffix .run,$(LIST))
echo :
@echo $(TARGETS)
all: $(TARGETS)
%.run:
sh hoge.sh $*
FILEのフルパスがほしいとき
BASE_PATH := target_dir
LIST := $(shell find $(BASE_PATH) -type f)
TARGETS := $(addsuffix .run,$(LIST))
echo :
@echo $(LIST)
all: $(TARGETS)
%.run:
sh zcat $* | hoge.sh