mirror of
https://github.com/onyx-and-iris/aoc2024.git
synced 2026-04-09 02:23:36 +00:00
remove scaffold.sh
add scaffold aoc template
This commit is contained in:
33
.scaffold/aoc/{{ .Project }}/makefile
Normal file
33
.scaffold/aoc/{{ .Project }}/makefile
Normal file
@@ -0,0 +1,33 @@
|
||||
program = {{ .Project }}
|
||||
|
||||
GO = go
|
||||
SRC_DIR := src
|
||||
BIN_DIR := bin
|
||||
|
||||
EXE := $(BIN_DIR)/$(program)
|
||||
|
||||
.DEFAULT_GOAL := build
|
||||
|
||||
.PHONY: fmt vet build test bench clean
|
||||
fmt:
|
||||
$(GO) fmt ./...
|
||||
|
||||
vet: fmt
|
||||
$(GO) vet ./...
|
||||
|
||||
build: vet | $(BIN_DIR)
|
||||
$(GO) build -o $(EXE) ./$(SRC_DIR)
|
||||
|
||||
test:
|
||||
$(GO) test ./...
|
||||
|
||||
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)
|
||||
Reference in New Issue
Block a user