Renamed the 'it' target to 'build' for better clarity and conventional naming. Updated all target dependencies (run, profile, explain) to reference the new build target.
28 lines
712 B
Makefile
28 lines
712 B
Makefile
BINARY_NAME=lambda.exe
|
|
|
|
.PHONY: build run profile explain graph docs
|
|
|
|
build:
|
|
@ go build -o ${BINARY_NAME} ./cmd/lambda
|
|
@ chmod +x ${BINARY_NAME}
|
|
|
|
TEST=simple
|
|
|
|
run: build
|
|
@ ./lambda.exe - < ./samples/$(TEST).txt > program.out
|
|
|
|
profile: build
|
|
@ ./lambda.exe -p profile/cpu.prof - < ./samples/$(TEST).txt > program.out
|
|
|
|
explain: build
|
|
@ ./lambda.exe -x -p profile/cpu.prof - < ./samples/$(TEST).txt > program.out
|
|
|
|
graph:
|
|
@ go tool pprof -raw -output=profile/cpu.raw profile/cpu.prof
|
|
@ go tool pprof -svg profile/cpu.prof > profile/cpu.svg
|
|
@ open profile/cpu.svg
|
|
|
|
docs:
|
|
@ echo ">>> View at 'http://localhost:6060/pkg/git.maximhutz.com/max/lambda/'"
|
|
@ go run golang.org/x/tools/cmd/godoc@latest -http=:6060
|