EXAMPLES = $(wildcard *.py) LOGFILES = ${EXAMPLES:.py=.log} .PHONY: all all: $(LOGFILES) %.log: %.py python3 $< > $@ clean: rm -f $(LOGFILES)