-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (33 loc) · 1.39 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
plugin := $(or $(plugin), '')
.ONESHELL:
.PHONY: help
.DEFAULT_GOAL := help
help:
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: clean
clean: ## Cleans generated core files
ifneq (,$(wildcard ./Debug))
@rm -r ./Debug
@echo "Debug directory has been successfully deleted"
else
@echo "Debug directory does not exist"
endif
ifneq (,$(wildcard ./Core/Src/main.c))
@find ./Core/Src -name "*.cpp" | xargs -I {} rm {}
@cd ./Core/Src && \
for file in *; do \
mv "$$file" "`echo $$file | sed 's/\.c$$/.cpp/'`"; \
done
@echo "*.c files rename operation was performed successfully"
else
@echo "*.c files intented to be renamed don't exist"
endif
.PHONY: generate
generate: ## Generate ProtocolBuffers files(used mainly for development)
ifeq ($(plugin), '')
@echo "Plugin is not set!"
@exit 1
endif
@protoc -I./Resources/Proto/Container --pyi_out=./Scripts/cli/src/proto Content/data.proto Content/info.proto Content/settings.proto request.proto response.proto
@protoc -I./Resources/Proto/Container --python_out=./Scripts/cli/src/proto Content/data.proto Content/info.proto Content/settings.proto request.proto response.proto
@protoc --plugin=$(plugin) -I./Resources/Proto/Container --eams_out=./Core/External/Proto/Generated Content/data.proto Content/info.proto Content/settings.proto request.proto response.proto