mirror of
https://github.com/onyx-and-iris/aoc2024.git
synced 2025-01-09 14:20:48 +00:00
upd scaffold and makefile
This commit is contained in:
parent
84312b157c
commit
c3fa7d0ff8
@ -16,10 +16,12 @@ vet: fmt
|
||||
$(GO) vet ./...
|
||||
|
||||
build: vet | $(BIN_DIR)
|
||||
$(GO) build -o $(EXE) .
|
||||
$(GO) build -o $(EXE) ./cmd/cli/
|
||||
|
||||
bench:
|
||||
$(GO) test . -test.count=10 -bench=. > benchmark
|
||||
$(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 $@
|
||||
|
@ -7,7 +7,8 @@ if [ -d day-"$name" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$name"/testdata
|
||||
mkdir -p "$name"/cmd/cli/testdata \
|
||||
"$name"/testdata "$name"/internal/one/testdata "$name"/internal/two/testdata
|
||||
touch "$name"/makefile
|
||||
|
||||
cat <<EOT >> "$name"/makefile
|
||||
@ -32,7 +33,9 @@ build: vet | \$(BIN_DIR)
|
||||
\$(GO) build -o \$(EXE) ./\$(SRC_DIR)
|
||||
|
||||
bench:
|
||||
\$(GO) test . -test.count=10 -bench=. > benchmark
|
||||
\$(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 \$@
|
||||
@ -41,7 +44,7 @@ clean:
|
||||
@rm -rv \$(BIN_DIR)
|
||||
EOT
|
||||
|
||||
cat <<EOT >> "$name"/solution.go
|
||||
cat <<EOT >> "$name"/cmd/cli/main.go
|
||||
/********************************************************************************
|
||||
Advent of Code 2024 - $name
|
||||
********************************************************************************/
|
||||
|
Loading…
Reference in New Issue
Block a user