0
点赞
收藏
分享

微信扫一扫

扫雷小游戏纯后端版

互联网码农 2024-07-27 阅读 41
c语言linux

code

makefile

# specify version id
GIT_BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
GIT_COMMIT_ID = $(shell git rev-parse --short HEAD)
VERSION_ID = $(GIT_BRANCH)-$(GIT_COMMIT_ID)

MARCOS = -DVERSION_INFO=\"$(VERSION_ID)\"

main.c

#include <stdio.h>

int main(int argc, char** argv)
{
#ifdef VERSION_INFO
    printf("VERSION_INFO defined,VERSION_INFO:%s\n", VERSION_INFO);
#else
    printf("VERSION_INFO not define\n");
#endif
    return 0;
}

performance

举报

相关推荐

0 条评论