-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
31 lines (27 loc) · 880 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
year := $(shell date +'%Y')
day := $(shell date +'%-d')
part := 1
.PHONY: test
test:
@echo "Testing year=$(year) day=$(day) part=$(part)"
@if [ $(day) -lt 10 ]; then \
go test ./day0$(day) -v -run=solvePart$(part) ; \
else \
go test ./day$(day) -v -run=solvePart$(part) ; \
fi
.PHONY: gen
gen:
@echo "Generating year=$(year) day=$(day)"
@go run ./cli/main.go input -d $(day) -y $(year)
@go run ./templates/generate_aoc.go day=$(day)
.PHONY: submit
submit:
@echo "Submitting year=$(year) day=$(day) part=$(part)"
@if [ $(day) -lt 10 ]; then \
_SUBMIT=1 go test ./day0$(day) -v -run=solvePart$(part) | go run ./cli/main.go submit -d $(day) -y $(year) -p $(part) ; \
else \
_SUBMIT=1 go test ./day$(day) -v -run=solvePart$(part) | go run ./cli/main.go submit -d $(day) -y $(year) -p $(part) ; \
fi
.PHONY: benchmark
benchmark:
@go run ./cli/main.go benchmark