BINARY_NAME=main
MAIN_PACKAGE_PATH = ./cmd/main.go

.PHONY: tidy
tidy:
	go mod tidy -v
	go fmt ./...

.PHONY: build
build: 
	CGO_ENABLED=0 go build -o ${BINARY_NAME} ${MAIN_PACKAGE_PATH}
	# GOARCH=arm64 GOOS=darwin go build -o bin/${BINARY_NAME} ${MAIN_PACKAGE_PATH}

.PHONY: run
run: build
	./${BINARY_NAME}

.PHONY: gen
gen:
	protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative proto/hello.proto