-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
45 lines (35 loc) · 1.47 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
SHELL = /bin/bash -o nounset -o errexit -o pipefail
.DEFAULT_GOAL = build
BUILD_PATH := $(patsubst %/,%,$(abspath $(dir $(lastword $(MAKEFILE_LIST)))))
PARENT_PATH := $(patsubst %/,%,$(dir $(BUILD_PATH)))
UNITY_PROJ := ${PARENT_PATH}/amp-client-unity
UNITY_PATH := $(shell python3 ${UNITY_PROJ}/amp-utils.py UNITY_PATH "${UNITY_PROJ}")
AMP_UNITY_PATH = ${UNITY_PROJ}/Assets/AMP
## display this help message
help:
@echo -e "\033[32m"
@echo " "
@echo " PARENT_PATH: ${PARENT_PATH}"
@echo " BUILD_PATH: ${BUILD_PATH}"
@echo " UNITY_PROJ: ${UNITY_PROJ}"
@echo " UNITY_PATH: ${UNITY_PATH}"
@echo
@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
.PHONY: tools generate
## install protobufs tools needed to turn a .proto file into Go and C# files
tools-proto:
go install github.com/gogo/protobuf/protoc-gen-gogoslick
go get -d github.com/gogo/protobuf/proto
## generate .cs and .go from .proto files
generate:
# protoc: https://github.com/protocolbuffers/protobuf/releases
protoc \
--gogoslick_out=plugins:. --gogoslick_opt=paths=source_relative \
--csharp_out "${AMP_UNITY_PATH}/amp.runtime/" \
--proto_path=. \
amp/api.amp.proto
protoc \
--gogoslick_out=plugins:. --gogoslick_opt=paths=source_relative \
--csharp_out "${AMP_UNITY_PATH}/amp.runtime.crates/" \
--proto_path=. \
crates/api.amp.crates.proto