mirror of
https://github.com/onyx-and-iris/aoc2024.git
synced 2025-01-07 14:10:49 +00:00
31 lines
507 B
Makefile
31 lines
507 B
Makefile
program = day-18
|
|
|
|
GO = go
|
|
CLI_DIR := cmd/cli
|
|
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) ./$(CLI_DIR)
|
|
|
|
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)
|