Makefile获取git comiit提交

#获取branch名

GIT_BRANCH=$(shell git branch | sed -n '/\* /s///p')
$(info GIT_REVISION = $(GIT_BRANCH))

#获取commit

GIT_REVISION = $(shell git show -s --pretty=format:%H)
$(info GIT_REVISION = $(GIT_REVISION))
# CFLAGS += -DQXWZ_SDK_BUILD_INFO="\"$(GIT_REVISION)"\"

posted @ 2021-11-24 15:32  我自逍遥笑  阅读(633)  评论(0编辑  收藏  举报