github.com/amp-space/amp-sdk-go@v0.7.6/Makefile (about) 1 SHELL = /bin/bash -o nounset -o errexit -o pipefail 2 .DEFAULT_GOAL = build 3 BUILD_PATH := $(patsubst %/,%,$(abspath $(dir $(lastword $(MAKEFILE_LIST))))) 4 PARENT_PATH := $(patsubst %/,%,$(dir $(BUILD_PATH))) 5 UNITY_PROJ := ${PARENT_PATH}/amp-client-unity 6 UNITY_PATH := $(shell python3 ${UNITY_PROJ}/amp-utils.py UNITY_PATH "${UNITY_PROJ}") 7 AMP_UNITY_PATH = ${UNITY_PROJ}/Assets/AMP 8 9 10 ## display this help message 11 help: 12 @echo -e "\033[32m" 13 @echo " " 14 @echo " PARENT_PATH: ${PARENT_PATH}" 15 @echo " BUILD_PATH: ${BUILD_PATH}" 16 @echo " UNITY_PROJ: ${UNITY_PROJ}" 17 @echo " UNITY_PATH: ${UNITY_PATH}" 18 @echo 19 @awk '/^##.*$$/,/[a-zA-Z_-]+:/' $(MAKEFILE_LIST) | awk '!(NR%2){print $$0p}{p=$$0}' | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m %-32s\033[0m %s\n", $$1, $$2}' | sort 20 21 22 .PHONY: tools generate 23 24 25 ## install protobufs tools needed to turn a .proto file into Go and C# files 26 tools-proto: 27 go install github.com/gogo/protobuf/protoc-gen-gogoslick 28 go get -d github.com/gogo/protobuf/proto 29 30 31 ## generate .cs and .go from .proto files 32 generate: 33 # protoc: https://github.com/protocolbuffers/protobuf/releases 34 protoc \ 35 --gogoslick_out=plugins:. --gogoslick_opt=paths=source_relative \ 36 --csharp_out "${AMP_UNITY_PATH}/amp.runtime/" \ 37 --proto_path=. \ 38 amp/amp.proto 39 40 protoc \ 41 --gogoslick_out=plugins:. --gogoslick_opt=paths=source_relative \ 42 --csharp_out "${AMP_UNITY_PATH}/amp.runtime.crates/" \ 43 --proto_path=. \ 44 crates/crates.proto 45