CPP := g++ CPP_ARGS := -Wall -g -I. LD_ARGS := BINARIES := $(patsubst %.cpp, build/%, $(wildcard *.cpp)) .PHONY: all all: $(BINARIES) .PHONY: clean clean: - rm $(BINARIES) build/%: %.cpp - mkdir -p build - $(CPP) $(CPP_ARGS) $< -o $@ $(LD_ARGS)