github.com/kaydxh/golang@v0.0.131/pkg/gocv/cgo/api/openapi-spec/Makefile (about) 1 MAKEFILE_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) 2 TARGET := $(shell basename ${MAKEFILE_DIR}) 3 PROJECT_ROOT_PATH := ${MAKEFILE_DIR}/../../ 4 $(info ${PROJECT_ROOT_PATH}) 5 6 .PHONY: generate 7 generate: 8 @echo " > starting generate protocol buffers for target ${TARGET} in golang" 9 @bash -c "go generate ../api/openapi-spec/proto.gen.go" 10 @echo " > compiling protocol buffers by cpp" 11 @if [[ -f "${PROJECT_ROOT_PATH}/build" ]]; then rm -Rv "${PROJECT_ROOT_PATH}/build"; fi 12 @mkdir -p ${PROJECT_ROOT_PATH}/build; cd ${PROJECT_ROOT_PATH}/build; cmake .. 13 @cmake --build ${PROJECT_ROOT_PATH}/build --target ${TARGET} -- -j `nproc`; 14 @echo " > install generated protocol buffers by cpp" 15 @cd ${PROJECT_ROOT_PATH}/build; cmake --install . 16 17 18