upd scaffold and makefile

This commit is contained in:
onyx-and-iris 2024-12-02 02:06:35 +00:00
parent 84312b157c
commit c3fa7d0ff8
2 changed files with 10 additions and 5 deletions

View File

@ -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 $@

View File

@ -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
********************************************************************************/