[英]How to build a user level program in parallel with building Linux kernel
I have a set of kernel source files in ~linux/fs/wrapfs/. 我在〜linux / fs / wrapfs /中有一组内核源文件。 Besides, there is also a source file present for a user level program.
此外,还有用于用户级程序的源文件。 I want to build that user level program while the kernel gets compiled by running "make" in ~/linux folder ie in the top level kernel directory.
我想通过在〜/ linux文件夹(即顶层内核目录)中运行“ make”来编译内核时构建该用户级程序。
So, I tried adding following in ~/linux/fs/wrapfs/Makefile: 因此,我尝试在〜/ linux / fs / wrapfs / Makefile中添加以下内容:
EXTRA_CFLAGS += prog
prog:
gcc -Wall -Werror prog.c -o prog -lssl -lcrypto
But, then everytime I do "make" in ~/linux, I get following error: 但是,每次我在〜/ linux中进行“ make”操作时,都会出现以下错误:
gcc: prog: No such file or directory
I then tried changing it to following but nothing helped: 然后,我尝试将其更改为以下内容,但没有任何帮助:
EXTRA_CFLAGS += prog
all:
gcc -Wall -Werror prog.c -o prog -lssl -lcrypto
EXTRA_CFLAGS += prog
prog:
gcc -Wall -Werror ./fs/wrapfs/prog.c -o ./fs/wrapfs/prog -lssl -lcrypto
Please suggest how can this be solved. 请提出如何解决。
您不应该尝试在CFLAGS中传递prog
,无论是其他方式还是其他方式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.