program = day-01 GO = go SRC_DIR := src BIN_DIR := bin EXE := $(BIN_DIR)/$(program) .DEFAULT_GOAL := build .PHONY: fmt vet build bench clean fmt: $(GO) fmt ./... vet: fmt $(GO) vet ./... build: vet | $(BIN_DIR) $(GO) build -o $(EXE) . bench: $(GO) test . -test.count=10 -bench=. > benchmark $(BIN_DIR): @mkdir -p $@ clean: @rm -rv $(BIN_DIR)