From time to time, I find myself writing scripts like this:
for file in *.mp3; do ffmpeg -i "$file" "${file%.mp3}.opus" & # run in paralleldoneThen I want more, controlling the number of processes or something.
However I realized I’m actually reinventing make at last.
So here is the makefile equal to the above script.
SRCS = $(wildcard *.mp3)
OBJS = $(SRCS:.mp3=.opus)
%.opus: %.mp3 ffmpeg -i $< $@
out: $(OBJS).PHONY: out