OS := $(shell uname) NAME=$(shell pwd | sed "s/.*\///g") ifeq (${OS},Darwin) CC=clang++ FLAGS=-std=c++11 -stdlib=libc++ RUN=${NAME} else ifeq (${OS},Linux) CC=g++ FLAGS=-std=c++11 -pthread RUN=${NAME} FILES=$(shell find -name *.cpp) else CC=g++ FLAGS=-std=c++11 RUN=${NAME}.exe FILES=$(shell find -name *.cpp) endif all: clean build run images video play build: ${CC} ${FILES} ${FLAGS} -o bin/${RUN} run: bin/./${RUN} video: ffmpeg -i output/frames/image_%05d.png -c:v libx264 -vf fps=25 -pix_fmt yuv420p output/video.mp4 play: vlc -L output/video.mp4 images: mogrify -verbose -format png output/frames/*.ppm rm $(shell find output/frames -name "*.ppm") clean: rm -f -r bin/* rm -f -r output/frames/* rm -f output/video.mp4