2024-12-10 21:42:26 +00:00
|
|
|
program = day-09
|
|
|
|
|
|
|
|
GO = go
|
2024-12-28 01:50:52 +00:00
|
|
|
CLI_DIR := cmd/cli
|
2024-12-10 21:42:26 +00:00
|
|
|
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)
|
2024-12-28 01:50:52 +00:00
|
|
|
$(GO) build -o $(EXE) ./$(CLI_DIR)
|
2024-12-10 21:42:26 +00:00
|
|
|
|
|
|
|
bench:
|
|
|
|
$(GO) test ./internal/one/ -bench=. > internal/one/benchmark
|
|
|
|
$(GO) test ./internal/two/ -bench=. > internal/two/benchmark
|
|
|
|
$(GO) test . -count=10 -bench=. > benchmark
|
|
|
|
|
|
|
|
$(BIN_DIR):
|
|
|
|
@mkdir -p $@
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@rm -rv $(BIN_DIR)
|