如何通过makefile包含头文件

pyt*_*nic 5 c linux gcc makefile

我知道有一个标志可以在makefile中使用,在所有正在编译的文件中包含一个头文件,就像有一个-D标志包含一个define.包含头文件的确切标志.我不记得了.

Lin*_*ios 8

在编译命令中,您可以使用以下-include选项:

gcc -o main -include hello.h main.cpp 
Run Code Online (Sandbox Code Playgroud)