Makefile 文件:
TARGET=hello
2
3 LDFLAGS= -I./include/generated -I.
4 BUILD_INCLUDE := KaTeX parse error: Expected 'EOF', got '#' at position 81: …:= hello.c 7 #̲include ./inclu…(CONFIG_MYPRINT) += myprint.c
9
10 all:$(TARGET)
11 $(TARGET): prepare $(obj-y) FORCE
12 gcc $(LDFLAGS) -o $@ $(obj-y)
13 echo $@
14 echo $(obj-y)
15
16 defconfig:
17 ./scripts/conf Kconfig
18 ./scripts/conf -s --silentoldconfig Kconfig
19 menuconfig:
20 ./scripts/mconf Kconfig
21 ./scripts/conf -s --silentoldconfig Kconfig
22
23 silentoldconfig: ./scripts/conf
24 @mkdir -p include/config include/generated
25 #test -e include/generated/autoksyms.h || touch include/generated/autoksyms.h
26
<
−
s
−
−
< -s --
<−s−−@ Kconfig
27
28 prepare: silentoldconfig
29 #include ./include/config/auto.conf
本例程运行环境:ubuntu18.04
整个代码工程请看,附件kbuild1.tar,下载解压($: tar -xvf kbuild1.tar),使用make即可运行例子程序
参考linux 内核创建kbuild系统
最新推荐文章于 2022-11-27 15:33:56 发布