aoc2024/day-01/makefile

29 lines
373 B
Makefile
Raw Normal View History

2024-12-01 17:50:02 +00:00
program = day-01
GO = go
SRC_DIR := src
BIN_DIR := bin
EXE := $(BIN_DIR)/$(program)
.DEFAULT_GOAL := build
2024-12-01 21:14:30 +00:00
.PHONY: fmt vet build bench clean
2024-12-01 17:50:02 +00:00
fmt:
$(GO) fmt ./...
vet: fmt
$(GO) vet ./...
build: vet | $(BIN_DIR)
$(GO) build -o $(EXE) .
2024-12-01 21:14:30 +00:00
bench:
$(GO) test . -test.count=10 -bench=. > benchmark
2024-12-01 17:50:02 +00:00
$(BIN_DIR):
@mkdir -p $@
clean:
@rm -rv $(BIN_DIR)