-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
34 lines (29 loc) · 1017 Bytes
/
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
.PHONY: all
all: # empty default
.PHONY: deploy deploy-checkvar
deploy-checkvar:
ifndef DEPLOYDIR
$(error DEPLOYDIR is undefined)
endif
deploy:
@echo "[INFO] deploying to $(DEPLOYDIR)"
if [ -e $(DEPLOYDIR) ]; then \
echo [ERROR] $(DEPLOYDIR) already exists ;\
exit 1; \
fi
mkdir -p "$(DEPLOYDIR)"
go build -o $(DEPLOYDIR)/backend github.com/hadiko-i6/zischr/backend
cp -r frontend $(DEPLOYDIR)/frontend
install -m755 scanner.py $(DEPLOYDIR)/scanner.py
@echo "[INFO] deployed to $(DEPLOYDIR)"
rm -rf build
.PHONY: codegen
codegen: codegen-grpc
make -C frontend codegen
@echo "[INFO] Remember to commit generated code to the repository!"
.PHONY: codegen-grpc
codegen-grpc: rpc/main.proto
@echo "[INFO] if code generation fails, try 'pip install grpcio-tools'"
protoc -I rpc/ rpc/main.proto --go_out=plugins=grpc:backend/rpc/
protoc -I rpc/ rpc/main.proto --go_out=plugins=grpc:backend/rpc/
python -m grpc_tools.protoc -Irpc/ --python_out=frontend/ --grpc_python_out=frontend/ rpc/main.proto