c - Can makefile variables be assigned with values read from source files? -


Suppose that there is a program that its version is stored in the global char * in the main Does. C. The build system (gnu make) can somehow remove the value of this variable at build time, so that the exact version of the executable version that appears in the program can be?

What I want to achieve is this source:

  char g_version [] = "Superprogram 1.32 build 1142";  

Build system is a superprogram 1.32 build 1142.exe

Allows you to call external applications such as sed , which can be used to parse the source for necessary information.


Comments