How can I create a variable on-the-fly from makefile, the value of which would be the entire contents of another data file.
相关问题
- CMakeList file to generate LLVM bitcode file from
- Makefile to compile lists of source files
- Have make fail if unit tests fail
- C++ - Compiling multiple files
- Undefined symbols for architecture x86_64: (Mac OS
相关文章
- How to arrange a Makefile to compile a kernel modu
- Makefile and use of $$
- Makefile: all vs default targets
- Automake Variables to tidy up Makefile.am
- How do I check the exit status of a Makefile shell
- Marking a makefile dependency as optional or other
- How to instruct Makefile to use different compiler
- Why does this makefile execute a target on 'ma
Much simpler since
$(file op filename)
was added:Manual page here: https://www.gnu.org/software/make/manual/html_node/File-Function.html#index-file_002c-reading-from
As the platform has not been specified, this is the way how it works on Solaris:
cat
doesn't exist on Windows. Solution that works for Linux and Windows:Explanation: Seems like On Windows there is always
OS
environment variable defined to be equal to 'Windows_NT'. This way, for Windowstype
command is used, for non-Windowscat
is used.GNU make version 4.2 supports file reading operation, so with respect to Maxim Egorushkin's great answer there is an optional way to solve this problem now:
If you are using GNU make, another way to get this effect is to use a make "include" of another makefile:
From Makefile:
Create a file "MyFile.mak" with content:
Assuming GNU make: