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