github.com/joshprzybyszewski/masyu@v0.0.0-20230508015604-f31a025f6e7e/Makefile (about) 1 .PHONY: help 2 help: ## Prints out the options available in this makefile 3 @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' 4 5 .PHONY: profile 6 profile: ## Run the solver and grab a CPU/memory profile using pprof 7 go run main.go -profile -refresh=false -start=11 -finish=18 -numIterations=5 8 pprof -web cpu.pprof 9 pprof -web mem.pprof 10 11 12 .PHONY: compete 13 compete: ## Run the solver using the serial solver 14 go run main.go 15 16 .PHONY: test 17 test: ## Run unit tests 18 go test -timeout=30s -short ./... 19 20 .PHONY: bench 21 bench: ## Runs benchmarks TODO build these 22 go test -benchmem -run="^$$" -bench "^BenchmarkAll$$" ./... -short -count=1 23 24 .PHONY: lint 25 lint: ## Runs linters (via golangci-lint) on golang code 26 golangci-lint run -v ./... 27 28 .PHONY: build 29 build: ## Executes go build to see what escapes to heap 30 go build -gcflags='-m -m' ./solve/... 31 32 33 .PHONY: results 34 results: ## Runs the solver to update the reported results on the readme page 35 go run main.go -results 36 37 .PHONY: lambda 38 lambda: ## Builds the app so that we can serve it in a lambda 39 GOOS=linux CGO_ENABLED=0 go build -o masyu-lambda lambda/main.go 40 zip masyu-lambda.zip masyu-lambda 41 rm masyu-lambda