generate:
	rm -rf proto
	mkdir -p proto

	protoc -I ./api \
      --go_out ./proto --go_opt paths=source_relative \
      --go-grpc_out ./proto --go-grpc_opt paths=source_relative \
      --grpc-gateway_out ./proto --grpc-gateway_opt paths=source_relative \
      --swagger_out=allow_merge=true,merge_file_name=main:./proto \
      ./api/main.proto

run:
	go run ./cmd/pinned_message/main.go

build-macos:
	rm -rf bin
	CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -o bin/pinned_message_macos_arm64 cmd/pinned_message/main.go

build-linux:
	rm -rf bin
	docker run --rm -v "$$PWD":/app -w /app golang:1.22-alpine sh -c \
  		"apk add --no-cache gcc musl-dev && \
		CGO_ENABLED=1 GOOS=linux GOARCH=arm64 go build -o bin/pinned_message_linux_arm64 cmd/pinned_message/main.go"
