FRAMES = 00 01 02 03 04 05 FRAMES_SUFFIX = .png STAGE1_NAME = stage1- STAGE2_NAME = stage2- STAGE1_FILES := $(addprefix $(STAGE1_NAME),$(FRAMES)) STAGE1_FILES := $(addsuffix $(FRAMES_SUFFIX),$(STAGE1_FILES)) STAGE2_FILES := $(addprefix $(STAGE2_NAME),$(FRAMES)) STAGE2_FILES := $(addsuffix $(FRAMES_SUFFIX),$(STAGE2_FILES)) all: $(STAGE1_FILES) $(STAGE2_FILES) lain.mp4 lain-rainbow: lain-rainbow.c $(CC) -W -Wall -Werror -Wextra -std=c89 $^ -o $@ $(shell pkg-config --cflags --libs cairo cairo-svg) $(STAGE1_NAME)%.png: lain-rainbow ./lain-rainbow $* $(STAGE2_NAME)%.png: $(STAGE1_NAME)%.png composite lain.png $(STAGE1_NAME)$*.png $(STAGE2_NAME)$*.png lain.mp4: $(STAGE2_FILES) ffmpeg -re -stream_loop -1 -y -i "$(STAGE2_NAME)%02d.png" -vf 'zoompan=d=.5:s=3840x2160:fps=2,framerate=25:interp_start=0:interp_end=255:scene=100' -c:v mpeg4 -maxrate 5M -q:v 2 -t 0:0:3 $@ clean: $(RM) lain-rainbow $(STAGE1_FILES) $(STAGE2_FILES)