赞
踩
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;
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。