add day-04 + benchmarks

This commit is contained in:
2024-12-05 01:31:44 +00:00
parent fca32422e4
commit e7aa98d637
19 changed files with 498 additions and 0 deletions

30
day-04/makefile Normal file
View File

@@ -0,0 +1,30 @@
program = day-04
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) ./$(SRC_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)