summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorn1c00o <n@nc0.fr>2023-02-06 21:55:34 +0100
committerNicolas <34602094+n1c00o@users.noreply.github.com>2023-02-06 22:35:54 +0100
commit56d459c02009a72e381687697e4af19fa4990900 (patch)
tree102a2d9d27e5efea433c297823beb75310730e90
parent38db6a4a74ce289744073de909124b49dc625100 (diff)
Add Makefile
-rw-r--r--.gitignore1
-rw-r--r--Makefile24
2 files changed, 25 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index d0038b5..881c1ae 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
/.idea/
/.vscode/
+/bin/ \ No newline at end of file
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..4307c8b
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,24 @@
+clean:
+ rm -rf bin
+
+GENERATOR_DEPS:=$(shell find cmd/generator -type f -name '*.go')
+
+generator: $(GENERATOR_DEPS)
+ go build -o=bin/generator -mod=vendor -race $(GENERATOR_DEPS)
+
+TESTCLIENT_DEPS:=$(shell find cmd/testclient -type f -name '*.go')
+
+testclient: $(TESTCLIENT_DEPS)
+ go build -o=bin/testclient -mod=vendor -race $(TESTCLIENT_DEPS)
+
+API_DEPS:=$(shell find api -type f -name '*.proto')
+
+api: $(API_DEPS)
+ protoc --proto_path=./ \
+ --proto_path=third_party/googleapis \
+ --proto_path=third_party/grpc-proto \
+ --go_out=. \
+ --go_opt=paths=source_relative \
+ --go-grpc_out=. \
+ --go-grpc_opt=paths=source_relative \
+ $(API_DEPS)