参考linux 内核创建kbuild系统

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即可运行例子程序

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值