Makefile万能写法(gcc程序以及arm-linux-gcc程序)-转

本文介绍了在Linux环境下使用GCC进行C程序编译时的Makefile编写技巧,包括通用写法及针对ARM交叉编译的特殊配置。详细解释了Makefile的规则、赋值方式、常用函数的使用,并提供了实例代码。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://7071976.blog.51cto.com/7061976/1322211

在linux下使用gcc 编译时,Makefile的万能写法 ,每次只需更改要生成的目标文件名称(test)尽可:

 

1

2

3

4

5

6

7

objs := $(patsubst %c, %o, $(shell ls *.c))

test.all:$(objs)

gcc -o $@ $^

%.o:%.c

gcc -c -o $@ $<

clean:

rm -f  *.all *.o

在arm交叉编译时的makefile的万能写法,只需更改int.bin,以及int_elf,int.dis名称即可

1

2

3

4

5

6

7

8

9

10

11

objs := $(addsuffix .o, $(basename $(shell ls -U *.S *.c)))

int.bin: $(objs)

arm-linux-ld -Ttext 0x00000000 -o int_elf $^

arm-linux-objcopy -O binary -S int_elf $@

arm-linux-objdump -D -m arm int_elf > int.dis

%.o:%.c

arm-linux-gcc -Wall -O2 -c -o $@ $<

%.o:%.S

arm-linux-gcc -Wall -O2 -c -o $@ $<

clean:

rm -f *.bin *_elf *.dis *.o

更多Makefile学习可百度:GUN MAKE 手册


Makefile的规则 

1

2

3

4

Makefile的规则:

目标文件:依赖文件

target ... : prerequisites ..

command

  target要求  

    1、要生成的可执行文件或obj文件;

    2、也可以是一个执行的动作名称:clean

  Makefile执行规则:  

    1、执行make时,仅当hell.c文件比hello.o文件更新,才会执行命令:arm-linux-gcc -o hello.o hello.c;

    2、如果没有hello.o文件也会执行

    3、运行 make clean 时,由于clean 没有依赖,它的命令也会被强制执行

 

makefile赋值:

 

 

Makefile中的"="":="、"?="和"+="区别是:
    "="是直接给变量赋值。
    ":="是将":="右边中包含的变量直接展开给左边的变量赋值。
    "?="是在该变量没有被赋值 的情况下为其赋值。
    "+="是给该变量追加值。
  例:
    a = 1
    b = 2
    c := $(a) 3
    d = 4
    d ?= 5
    b += 6
  结果:
    a=1
    c=1 3
    d=4
    b=2 6

 

使用makefile 编译c程序:

  1、一些make函数的巧用

    1、$(patsubst pattern, replacement,text) 

      原理:用replacement替换text中符合格式"pattern" 的字

      如:$(patsubst %.c, %.o, b.a.c hello.c helloworld.c)

        结果为字符串:b.a.o hello.o helloworld.o

    2、$(shell command arguments) 

 

    3、$(basename names.....)

    原理:抽取除"names...."中每一个文件名中除后缀外的一切字符

    比如:

    $(basename head.S hello.c helloworld.c)

    结果为:head hello helloworld

    4、$(addsuffix suffix,names...) 

      如:$(addsuffix .c, head hello helloworld)

      结果为:head.o hello.o hello.o helloworld.o

 

在linux中编译c程序时写make文件就有一些技巧了

 

 

 

 

在 arm 嵌入式交叉编译时,就可以这样编写Makefile。相应的程序名称相应修改

 

1

2

3

4

5

6

7

8

9

10

11

objs := $(addsuffix .o, $(basename $(shell ls *.S *.c)))

int.bin: $(objs)

arm-linux-ld -Ttext 0x00000000 -o int_elf $^

arm-linux-objcopy -O binary -S int_elf $@

arm-linux-objdump -D -m arm int_elf > int.dis

%.o:%.c

arm-linux-gcc -Wall -O2 -c -o $@ $<

%.o:%.S

arm-linux-gcc -Wall -O2 -c -o $@ $<

clean:

rm -f *.bin *_elf *.dis *.o


作者:胡彦 2013-5-21 本文档可能有更新,更新版本请留意http://blog.youkuaiyun.com/huyansoft/article/details/8924624 一 目的:编写一个实际可用的makefile,能自动编译当前目录下所有.c源文件,并且任何.c、.h或依赖的源文件被修改后,能自动重编那些改动了的源文件,未改动的不编译。 二 要达到这个目的,用到的技术有: 1-使用wildcard函数来获得当前目录下所有.c文件的列表。 2-make的多目标规则。 3-make的模式规则。 4-gcc -MM命令得到一个.c文件include了哪些文件。 5-用sed命令对gcc -MM命令的结果作修改。 6-用include命令包含依赖描述文件.d。 三 准备知识 (一)多目标 对makefile里下面2行,可看出多目标特征,执行make bigoutput或make littleoutput可看到结果: bigoutput littleoutput: defs.h pub.h @echo $@ $(subst output,OUTPUT,$@) $^ # $@指这个规则里所有目标的集合,$^指这个规则里所有依赖的集合。该行是把目标(bigoutput或littleoutput)里所有子串output替换大写的OUTPUT (二)隐含规则 对makefile里下面4行,可看出make的隐含规则,执行foo可看到结果: 第3、4行表示由.c得到.o,第1、2行表示由.o得到可执行文件。 如果把第3、4行注释的话,效果一样。 即不写.o来自.c的规则,它会自动执行gcc -c -o foo.o foo.c这条命令,由.c编译出.o(其中-c表示只编译不链接),然后自动执行gcc -o foo foo.o链接为可执行文件。 foo:foo.o gcc -o foo foo.o; ./foo foo.o:foo.c #注释该行看效果 gcc -c foo.c -o foo.o #注释该行看效果 (三)定义模式规则 下面定义了一个模式规则,即如何由.c文件生.d文件的规则。 foobar: foo.d bar.d @echo complete generate foo.d and bar.d %.d: %.c #make会对当前目录下每个.c文件,依次做一次里面的命令,从而由每个.c文件生对应.d文件。 @echo from $< to $@ g++ -MM $ $@ 假定当前目录下有2个.c文件:foo.c和bar.c(文件内容随意)。 验证方法有2种,都可: 1-运行make foo.d(或make bar.d),表示想要生foo.d这个目标。 根据规则%.d: %.c,这时%匹配foo,这样%.c等于foo.c,即foo.d这个目标依赖于foo.c。 此时会自动执行该规则里的命令gcc -MM foo.c > foo.d,来生foo.d这个目标。 2-运行make foobar,因为foobar依赖于foo.d和bar.d这2个文件,即会一次性生这2个文件。 四 下面详述如何自动生依赖性,从而实现本例的makefile。 (一) 本例使用了makefile的模式规则,目的是对当前目录下每个.c文件,生其对应的.d文件,例如由main.c生的.d文件内容为: main.o : main.c command.h 这里指示了main.o目标依赖于哪几个源文件,我们只要把这一行的内容,通过make的include指令包含到makefile文件里,即可在其任意一个依赖文件被修改后,重新编译目标main.o。 下面详解如何生这个.d文件。 (二) gcc/g++编译器有一个-MM选项,可以对某个.c/.cpp文件,分析其依赖的源文件,例如假定main.c的内容为: #include //标准头文件(以方式包含的),被-MM选项忽略,被-M选项收集 #include "stdlib.h"//标准头文件(以""方式包含的),被-MM选项忽略,被-M选项收集 #include "command.h" int main() { printf("##### Hello Makefile #####\n"); return 0; } 则执行gcc -MM main.c后,屏幕输出: main.o: main.c command.h 执行gcc -M main.c后,屏幕输出: main.o: main.c /usr/include/stdio.h /usr/include/features.h \ /usr/include/bits/predefs.h /usr/include/sys/cdefs.h \ /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ /usr/include/gnu/stubs-64.h \ /usr/lib/gcc/x86_64-linux-gnu/4.4.3/include/stddef.h \ /usr/include/bits/types.h /usr/include/bits/typesizes.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ /usr/lib/gcc/x86_64-linux-gnu/4.4.3/include/stdarg.h \ /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \ /usr/include/endian.h /usr/include/bits/endian.h \ /usr/include/bits/byteswap.h /usr/include/sys/select.h \ /usr/include/bits/select.h /usr/include/bits/sigset.h \ /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ /usr/include/bits/pthreadtypes.h /usr/include/alloca.h command.h (三) 可见,只要把这些行挪到makefile里,就能自动定义main.c的依赖是哪些文件了,做法是把命令的输出重定向到.d文件里:gcc -MM main.c > main.d,再把这个.d文件include到makefile里。 如何include当前目录每个.c生的.d文件: sources:=$(wildcard *.c) #使用$(wildcard *.cpp)来获取工作目录下的所有.c文件的列表。 dependence=$(sources:.c=.d) #这里,dependence是所有.d文件的列表.即把串sources串里的.c换.d。 include $(dependence) #include后面可以跟若干个文件名,用空格分开,支持通配符,例如include foo.make *.mk。这里是把所有.d文件一次性全部include进来。注意该句要放在终极目标all的规则之后,否则.d文件里的规则会被误当作终极规则了。 (四) 现在main.c command.h这几个文件,任何一个改了都会重编main.o。但是这里还有一个问题,如果修改了command.h,在command.h中加入#include "pub.h",这时: 1-再make,由于command.h改了,这时会重编main.o,并且会使用新加的pub.h,看起来是正常的。 2-这时打开main.d查看,发现main.d中未加入pub.h,因为根据模式规则%.d: %.c中的定义,只有依赖的.c文件变了,才会重新生.d,而刚才改的是command.h,不会重新生main.d、及在main.d中加入对pub.h的依赖关系,这会导致问题。 3-修改新加的pub.h的内容,再make,果然问题出现了,make报告up to date,没有像期望那样重编译main.o。 现在问题在于,main.d里的某个.h文件改了,没有重新生main.d。进一步说,main.d里给出的每个依赖文件,任何一个改了,都要重新生这个main.d。 所以main.d也要作为一个目标来生,它的依赖应该是main.d里的每个依赖文件,也就是说make里要有这样的定义: main.d: main.c command.h 这时我们发现,main.d与main.o的依赖是完全相同的,可以利用make的多目标规则,把main.d与main.o这两个目标的定义合并为一句: main.o main.d: main.c command.h 现在,main.o: main.c command.h这一句我们已经有了,如何进一步得到main.o main.d: main.c command.h呢? (五) 解决方法是行内字符串替换,对main.o,取出其中的子串main,加上.d后缀得到main.d,再插入到main.o后面。能实现这种替换功能的命令是sed。 实现的时候,先用gcc -MM命令生临时文件main.d.temp,再用sed命令从该临时文件中读出内容(用输出到最终文件main.d。 命令可以这么写: g++ -MM main.c > main.d.temp sed 's,\(main\)\.o[ :]*,\1.o main.d : ,g' main.d 其中: sed 's,\(main\)\.o[ :]*,\1.o main.d : ,g',是sed命令。 main.d,把行内替换结果输出到最终文件main.d。 (六) 这条sed命令的结构是s/match/replace/g。有时为了清晰,可以把每个/写逗号,即这里的格式s,match,replace,g。 该命令表示把源串内的match都替换replace,s指示match可以是正则表达式。 g表示把每行内所有match都替换,如果去掉g,则只有每行的第1处match被替换(实际上不需要g,因为一个.d文件中,只会在开头有一个main.o:)。 这里match是正则式\(main\)\.o[ :]*,它分3段: 第1段是\(main\),在sed命令里把main用\(和\)括起来,使接下来的replace中可以用\1引用main。 第2段是\.o,表示匹配main.o,(这里\不知何意,去掉也是可以的)。 第3段是正则式[ :]*,表示若干个空格或冒号,(其实一个.d里只会有一个冒号,如果这里写[ ]*:,即匹配若干个空格后跟一个冒号,也是可以的)。 总体来说match用来匹配'main.o :'这样的串。 这里的replace是\1.o main.d :,其中\1会被替换为前面第1个\(和\)括起的内容,即main,这样replace值为main.o main.d : 这样该sed命令就实现了把main.o :替换为main.o main.d :的目的。 这两行实现了把临时文件main.d.temp的内容main.o : main.c command.h改为main.o main.d : main.c command.h,并存入main.d文件的功能。 (七) 进一步修改,采用自动化变量。使得当前目录下有多个.c文件时,make会依次对每个.c文件执行这段规则,生对应的.d: gcc -MM $ $@.temp; sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' $@; (八) 现在来看上面2行的执行流程: 第一次make,假定这时从来没有make过,所有.d文件不存在,这时键入make: 1-include所有.d文件的命令无效果。 2-首次编译所有.c文件。每个.c文件中若#include了其它头文件,会由编译器自动读取。由于这次是完整编译,不存在什么依赖文件改了不会重编的问题。 3-对每个.c文件,会根据依赖规则%.d: %.c,生其对应的.d文件,例如main.c生的main.d文件为: main.o main.d: main.c command.h 第二次make,假定改了command.h、在command.h中加入#include "pub.h",这时再make: 1-include所有.d文件,例如include了main.d后,得到依赖规则: main.o main.d: main.c command.h 注意所有include命令是首先执行的,make会先把所有include进来,再生依赖规则关系。 2-此时,根据依赖规则,由于command.h的文件戳改了,要重新生main.o和main.d文件。 3-先调用gcc -c main.c -o main.o生main.o, 再调用gcc -MM main.c > main.d重新生main.d。 此时main.d的依赖文件里增加了pub.h: main.o main.d: main.c command.h pub.h 4-对其它依赖文件没改的.c(由其.d文件得到),不会重新编译.o和生其.d。 5-最后会执行gcc $(objects) -o main生最终可执行文件。 第三次make,假定改了pub.h,再make。由于第二遍中,已把pub.h加入了main.d的依赖,此时会重编main.c,重新生main.o和main.d。 这样便实现了当前目录下任一源文件改了,自动编译涉及它的.c。 (九) 进一步修改,得到目前大家普遍使用的版本: set -e; rm -f $@; \ $(CC) -MM $(CPPFLAGS) $ $@.$$$$; \ sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' $@; \ rm -f $@.$$$$ 第一行,set -e表示,如果某个命令的返回参数非0,那么整个程序立刻退出。 rm -f用来删除上一次make时生的.d文件,因为现在要重新生这个.d,老的可以删除了(不删也可以)。 第二行:前面临时文件是用固定的.d.temp作为后缀,为了防止重名覆盖掉有用的文件,这里把temp换一个随机数,该数可用$$得到,$$的值是当前进程号。 由于$是makefile特殊符号,一个$要用$$来义,所以2个$要写$$$$(你可以在makefile里用echo $$$$来显示进程号的值)。 第三行:sed命令的输入也改该临时文件.$$。 每个shell命令的进程号通常是不同的,为了每次调用$$时得到的进程号相同,必须把这4行放在一条命令中,这里用分号把它们连接一条命令(在书写时为了易读,用\拆了多行),这样每次.$$便是同一个文件了。 你可以在makefile里用下面命令来比较: echo $$$$ echo $$$$; echo $$$$ 第四行:当make完后,每个临时文件.d.$$,已经不需要了,删除之。 但每个.d文件要在下一次make时被include进来,要保留。 (十) 综合前面的分析,得到我们的makefile文件: #使用$(wildcard *.c)来获取工作目录下的所有.c文件的列表 sources:=$(wildcard *.c) objects:=$(sources:.c=.o) #这里,dependence是所有.d文件的列表.即把串sources串里的.c换.d dependence:=$(sources:.c=.d) #所用的编译工具 CC=gcc #当$(objects)列表里所有文件都生后,便可调用这里的 $(CC) $^ -o $@ 命令生最终目标all了 #把all定义第1个规则,使得可以把make all命令简写make all: $(objects) $(CC) $^ -o $@ #这段是make的模式规则,指示如何由.c文件生.o,即对每个.c文件,调用gcc -c XX.c -o XX.o命令生对应的.o文件。 #如果不写这段也可以,因为make的隐含规则可以起到同样的效果 %.o: %.c $(CC) -c $< -o $@ include $(dependence) #注意该句要放在终极目标all的规则之后,否则.d文件里的规则会被误当作终极规则了 %.d: %.c set -e; rm -f $@; \ $(CC) -MM $(CPPFLAGS) $ $@.$$$$; \ sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' $@; \ rm -f $@.$$$$ .PHONY: clean #之所以把clean定义伪目标,是因为这个目标并不对应实际的文件 clean: rm -f all $(objects) $(dependence) #清除所有临时文件:所有.o和.d。.$$已在每次使用后立即删除。-f参数表示被删文件不存在时不报错 (十一) 上面这个makefile已经能正常工作了(编译C程序),但如果要用它编译C++,变量CC值要改g++,每个.c都要改.cpp,有点繁琐。 现在我们继续完善它,使其同时支持C和C++,并支持二者的混合编译。 #一个实用的makefile,能自动编译当前目录下所有.c/.cpp源文件,支持二者混合编译 #并且当某个.c/.cpp、.h或依赖的源文件被修改后,仅重编涉及到的源文件,未涉及的不编译 #详解文档:http://blog.youkuaiyun.com/huyansoft/article/details/8924624 #author:胡彦 2013-5-21 #---------------------------------------------------------- #编译工具用g++,以同时支持C和C++程序,以及二者的混合编译 CC=g++ #使用$(winldcard *.c)来获取工作目录下的所有.c文件的列表 #sources:=main.cpp command.c #变量sources得到当前目录下待编译的.c/.cpp文件的列表,两次调用winldcard、结果连在一起即可 sources:=$(wildcard *.c) $(wildcard *.cpp) #变量objects得到待生的.o文件的列表,把sources中每个文件的扩展名换.o即可。这里两次调用patsubst函数,第1次把sources中所有.cpp换.o,第2次把第1次结果里所有.c换.o objects:=$(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(sources))) #变量dependence得到待生的.d文件的列表,把objects中每个扩展名.o换.d即可。也可写$(patsubst %.o,%.d,$(objects)) dependence:=$(objects:.o=.d) #---------------------------------------------------------- #当$(objects)列表里所有文件都生后,便可调用这里的 $(CC) $^ -o $@ 命令生最终目标all了 #把all定义第1个规则,使得可以把make all命令简写make all: $(objects) $(CC) $(CPPFLAGS) $^ -o $@ @./$@ #编译后立即执行 #这段使用make的模式规则,指示如何由.c文件生.o,即对每个.c文件,调用gcc -c XX.c -o XX.o命令生对应的.o文件 #如果不写这段也可以,因为make的隐含规则可以起到同样的效果 %.o: %.c $(CC) $(CPPFLAGS) -c $< -o $@ #同上,指示如何由.cpp生.o,可省略 %.o: %.cpp $(CC) $(CPPFLAGS) -c $< -o $@ #---------------------------------------------------------- include $(dependence) #注意该句要放在终极目标all的规则之后,否则.d文件里的规则会被误当作终极规则了 #因为这4行命令要多次凋用,定义命令包以简化书写 define gen_dep set -e; rm -f $@; \ $(CC) -MM $(CPPFLAGS) $ $@.$$$$; \ sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' $@; \ rm -f $@.$$$$ endef #指示如何由.c生其依赖规则文件.d #这段使用make的模式规则,指示对每个.c文件,如何生其依赖规则文件.d,调用上面的命令包即可 %.d: %.c $(gen_dep) #同上,指示对每个.cpp,如何生其依赖规则文件.d %.d: %.cpp $(gen_dep) #---------------------------------------------------------- #清除所有临时文件(所有.o和.d)。之所以把clean定义伪目标,是因为这个目标并不对应实际的文件 .PHONY: clean clean: #.$$已在每次使用后立即删除。-f参数表示被删文件不存在时不报错 rm -f all $(objects) $(dependence) echo: #调试时显示一些变量的值 @echo sources=$(sources) @echo objects=$(objects) @echo dependence=$(dependence) @echo CPPFLAGS=$(CPPFLAGS) #提醒:当混合编译.c/.cpp时,为了能够在C++程序里调用C函数,必须把每一个要调用的C函数,其声明都包括在extern "C"{}块里面,这样C++链接时才能功链接它们。 五 makefile学习体会: 刚学过C语言的读者,可能会觉得makefile有点难,因为makefile不像C语言那样,一招一式都那么清晰明了。 在makefile里到处是“潜规则”,都是一些隐晦的东西,要弄明白只有搞清楚这些“潜规则”。 基本的规则无非是“一个依赖改了,去更新哪些目标”。 正因为隐晦动作较多,写一个makefile才不需要那么多篇幅,毕竟项目代码才是主体。只要知道makefile的框架,往它的套路里填就行了。 较好的学习资料是《跟我一起写Makefile.pdf》这篇文档(下载包里已经附带了),比较详细,适合初学者。 我们学习的目的是,能够编写一个像本文这样的makefile,以满足简单项目的基本需求,这要求理解前面makefile几个关键点: 1-多目标 2-隐含规则 3-定义模式规则 4-自动生依赖性 可惜的是,这篇文档虽然比较全面,却没有以一个完整的例子为引导,对几处要点没有突出指明,尤其是“定义模式规则”在最后不显眼的位置(第十一部分第五点),导致看了“自动生依赖性”一节后还比较模糊。 所以,看了《跟我一起写Makefile.pdf》后,再结合本文针对性的讲解,会有更实际的收获。 另一个学习资料是《GNU make v3.80中文手册v1.5.pdf》,这个手册更详细,但较枯燥,不适合完整学习,通常是遇到问题再去查阅。 其它文章和代码请留意我的blog: http://blog.youkuaiyun.com/huyansoft [END]
huaxi@ubuntu:~/openwrt/openwrt-15.05.1$ make package/shared_memory/{clean,compile,install} V=s make[1]: Entering directory '/home/huaxi/openwrt/openwrt-15.05.1' make[2]: Entering directory '/home/huaxi/openwrt/openwrt-15.05.1/package/shared_memory' rm -f /home/huaxi/openwrt/openwrt-15.05.1/bin/realview/packages/base/shared_memory_* rm -f /home/huaxi/openwrt/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/stamp/._installed rm -f /home/huaxi/openwrt/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/packages/.list /home/huaxi/openwrt/openwrt-15.05.1/staging_dir/host/packages/.list rm -rf /home/huaxi/openwrt/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/shared_memory-1.0 make[2]: Leaving directory '/home/huaxi/openwrt/openwrt-15.05.1/package/shared_memory' make[1]: Leaving directory '/home/huaxi/openwrt/openwrt-15.05.1' make[1]: Entering directory '/home/huaxi/openwrt/openwrt-15.05.1' make[2]: Entering directory '/home/huaxi/openwrt/openwrt-15.05.1/package/libs/toolchain' if [ -f /home/huaxi/openwrt/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install.clean ]; then rm -f /home/huaxi/openwrt/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install /home/huaxi/openwrt/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install.clean; fi; echo "libc" >> /home/huaxi/openwrt/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install if [ -f /home/huaxi/openwrt/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install.clean ]; then rm -f /home/huaxi/openwrt/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install /home/huaxi/openwrt/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install.clean; fi; echo "libgcc" >> /home/huaxi/openwrt/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install if [ -f /home/huaxi/openwrt/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install.clean ]; then rm -f /home/huaxi/openwrt/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install /home/huaxi/openwrt/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install.clean; fi; echo "libpthread" >> /home/huaxi/openwrt/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/pkginfo/toolchain.default.install make[2]: Leaving directory '/home/huaxi/openwrt/openwrt-15.05.1/package/libs/toolchain' make[2]: Entering directory '/home/huaxi/openwrt/openwrt-15.05.1/package/shared_memory' mkdir -p /home/huaxi/openwrt/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/shared_memory-1.0 cp -fpR -u ./src/* /home/huaxi/openwrt/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/shared_memory-1.0/ touch /home/huaxi/openwrt/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/shared_memory-1.0/.prepared_d1b905142a8095dca803c611f8f12ccc rm -f /home/huaxi/openwrt/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/stamp/._installed (cd /home/huaxi/openwrt/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/shared_memory-1.0/./; if [ -x ./configure ]; then find /home/huaxi/openwrt/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/shared_memory-1.0/ -name config.guess | xargs -r chmod u+w; find /home/huaxi/openwrt/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/shared_memory-1.0/ -name config.guess | xargs -r -n1 cp --remove-destination /home/huaxi/openwrt/openwrt-15.05.1/scripts/config.guess; find /home/huaxi/openwrt/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/shared_memory-1.0/ -name config.sub | xargs -r chmod u+w; find /home/huaxi/openwrt/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/shared_memory-1.0/ -name config.sub | xargs -r -n1 cp --remove-destination /home/huaxi/openwrt/openwrt-15.05.1/scripts/config.sub; AR="arm-openwrt-linux-uclibcgnueabi-gcc-ar" AS="arm-openwrt-linux-uclibcgnueabi-gcc -c -Os -pipe -march=armv6k -mtune=mpcore -mfpu=vfp -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard" LD=arm-openwrt-linux-uclibcgnueabi-ld NM="arm-openwrt-linux-uclibcgnueabi-gcc-nm" CC="arm-openwrt-linux-uclibcgnueabi-gcc" GCC="arm-openwrt-linux-uclibcgnueabi-gcc" CXX="arm-openwrt-linux-uclibcgnueabi-g++" RANLIB="arm-openwrt-linux-uclibcgnueabi-gcc-ranlib" STRIP=arm-openwrt-linux-uclibcgnueabi-strip OBJCOPY=arm-openwrt-linux-uclibcgnueabi-objcopy OBJDUMP=arm-openwrt-linux-uclibcgnueabi-objdump SIZE=arm-openwrt-linux-uclibcgnueabi-size CFLAGS="-Os -pipe -march=armv6k -mtune=mpcore -mfpu=vfp -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard " CXXFLAGS="-Os -pipe -march=armv6k -mtune=mpcore -mfpu=vfp -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard " CPPFLAGS="-I/home/huaxi/openwrt/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/usr/include -I/home/huaxi/openwrt/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/include -I/home/huaxi/openwrt/openwrt-15.05.1/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/usr/include -I/home/huaxi/openwrt/openwrt-15.05.1/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/include " LDFLAGS="-L/home/huaxi/openwrt/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/usr/lib -L/home/huaxi/openwrt/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/lib -L/home/huaxi/openwrt/openwrt-15.05.1/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/usr/lib -L/home/huaxi/openwrt/openwrt-15.05.1/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/lib " ./configure --target=arm-openwrt-linux --host=arm-openwrt-linux --build=x86_64-linux-gnu --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls ; fi; ) rm -f /home/huaxi/openwrt/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/shared_memory-1.0/.configured_* touch /home/huaxi/openwrt/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/shared_memory-1.0/.configured_yyy CFLAGS="-Os -pipe -march=armv6k -mtune=mpcore -mfpu=vfp -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -I/home/huaxi/openwrt/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/usr/include -I/home/huaxi/openwrt/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/include -I/home/huaxi/openwrt/openwrt-15.05.1/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/usr/include -I/home/huaxi/openwrt/openwrt-15.05.1/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/include " CXXFLAGS="-Os -pipe -march=armv6k -mtune=mpcore -mfpu=vfp -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -I/home/huaxi/openwrt/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/usr/include -I/home/huaxi/openwrt/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/include -I/home/huaxi/openwrt/openwrt-15.05.1/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/usr/include -I/home/huaxi/openwrt/openwrt-15.05.1/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/include " LDFLAGS="-L/home/huaxi/openwrt/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/usr/lib -L/home/huaxi/openwrt/openwrt-15.05.1/staging_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/lib -L/home/huaxi/openwrt/openwrt-15.05.1/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/usr/lib -L/home/huaxi/openwrt/openwrt-15.05.1/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/lib " make -j1 -C /home/huaxi/openwrt/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/shared_memory-1.0/. AR="arm-openwrt-linux-uclibcgnueabi-gcc-ar" AS="arm-openwrt-linux-uclibcgnueabi-gcc -c -Os -pipe -march=armv6k -mtune=mpcore -mfpu=vfp -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard" LD=arm-openwrt-linux-uclibcgnueabi-ld NM="arm-openwrt-linux-uclibcgnueabi-gcc-nm" CC="arm-openwrt-linux-uclibcgnueabi-gcc" GCC="arm-openwrt-linux-uclibcgnueabi-gcc" CXX="arm-openwrt-linux-uclibcgnueabi-g++" RANLIB="arm-openwrt-linux-uclibcgnueabi-gcc-ranlib" STRIP=arm-openwrt-linux-uclibcgnueabi-strip OBJCOPY=arm-openwrt-linux-uclibcgnueabi-objcopy OBJDUMP=arm-openwrt-linux-uclibcgnueabi-objdump SIZE=arm-openwrt-linux-uclibcgnueabi-size CROSS="arm-openwrt-linux-uclibcgnueabi-" ARCH="arm" ; make[3]: Entering directory '/home/huaxi/openwrt/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/shared_memory-1.0' arm-openwrt-linux-uclibcgnueabi-gcc -Wall A.c -o sender cc1: note: someone does not honour COPTS correctly, passed 0 times In file included from A.c:17:0: shm_comm.h: In function 'calculate_checksum': shm_comm.h:74:5: error: 'for' loop initial declarations are only allowed in C99 mode for (int i = 0; i < len; i++) { ^ shm_comm.h:74:5: note: use option -std=c99 or -std=gnu99 to compile your code Makefile:10: recipe for target 'sender' failed make[3]: *** [sender] Error 1 make[3]: Leaving directory '/home/huaxi/openwrt/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi/shared_memory-1.0' Makefile:31: recipe for target '/home/huaxi/openwrt/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi//.built' failed make[2]: *** [/home/huaxi/openwrt/openwrt-15.05.1/build_dir/target-arm_mpcore+vfp_uClibc-0.9.33.2_eabi//.built] Error 2 make[2]: Leaving directory '/home/huaxi/openwrt/openwrt-15.05.1/package/shared_memory' package/Makefile:191: recipe for target 'package/shared_memory/compile' failed make[1]: *** [package/shared_memory/compile] Error 2 make[1]: Leaving directory '/home/huaxi/openwrt/openwrt-15.05.1' /home/huaxi/openwrt/openwrt-15.05.1/include/toplevel.mk:181: recipe for target 'package/shared_memory/compile' failed make: *** [package/shared_memory/compile] Error 2
最新发布
08-19
# 从当前用户主目录查找目录的函数 # 参数1: 要查找的目录名 define find_in_home $(shell \ found_dir=$$(find "$$HOME" -type d -name "$(1)" -print -quit 2>/dev/null); \ if [ -n "$$found_dir" ]; then \ echo "$$found_dir"; \ else \ echo "DIRECTORY_NOT_FOUND"; \ fi \ ) endef # 使用示例(查找用户主目录下的 Documents 目录) TARGET_DIR := lite-user-runtime-env ENV_DIR := $(call find_in_home,$(TARGET_DIR)) ifeq ($(ENV_DIR),DIRECTORY_NOT_FOUND) $(error Directory "$(TARGET_DIR)" not found!!) else $(info ENV_DIR = $(ENV_DIR)) endif # Kconfig 配置系统相关 KCONFIG_CONFIG ?= $(CURDIR)/.config KCONFIG_AUTOHEADER ?= $(CURDIR)/autoconf.h KCONFIG_AUTOCONF ?= $(CURDIR)/autoconf.h # 检查 Kconfig 工具是否存在 ifeq ($(shell command -v kconfig-mconf 2>/dev/null),) $(error "kconfig-frontends not found, please install it first (sudo apt install kconfig-frontends)") endif KCONFIG_TOOL := $(shell command -v kconfig-conf 2>/dev/null) ifndef KCONFIG_TOOL $(error "kconfig-conf not found! Please install kconfig-frontends (sudo apt install kconfig-frontends)") endif CROSS = $(ENV_DIR)/toolschain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/arm-none-eabi- CREAT_TOOL = $(ENV_DIR)/bin/create-sp-img CC = gcc INC = -I . -I ./include -I ../posix/include INC += -I $(ENV_DIR)/toolschain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/lib/gcc/arm-none-eabi/13.2.1/include #cflag = -g ${cflags} -Wall -fPIC -fno-asynchronous-unwind-tables -fno-builtin-function -mcpu=cortex-m3 -mthumb -nostdinc #inc += -I $(SPBASEDIR)/vsoc/$(os_type)/include/ -I . #inc += -I $(SPBASEDIR)/toolschain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/lib/gcc/arm-none-eabi/13.2.1/include # CFLAG = -g -Wall -fPIC -fno-asynchronous-unwind-tables -mcpu=cortex-a5 -mtune=generic-armv7-a -mthumb -mfloat-abi=soft -Os # CFLAG = -g -Os -Wall -fPIC -fno-asynchronous-unwind-tables -mcpu=cortex-a5 -mtune=generic-armv7-a -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard #-ffreestanding 独立环境 CFLAG += -include $(KCONFIG_AUTOHEADER) CFLAG += -Os -fno-asynchronous-unwind-tables -mcpu=cortex-m3 -mthumb -nostdinc -nostdlib -ffreestanding -ffunction-sections -fdata-sections CFLAG += -fPIE -Wall -fno-builtin-function -Werror=implicit -flto #lflag = -g -pie -T n58.ld.lds -Os --no-warn-rwx-segments --start-group $(ENV_DIR)/toolschain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/lib/gcc/arm-none-eabi/13.2.1/thumb/v7-m/nofp/libgcc.a ../posix/lib/libposix.a --end-group #lflag = ../src/raw.o ../src/dns_server.o ../src/exit.o ../src/memset.o ../src/network.o ../src/strncasecmp.o ../src/timerfd.o ../src/vfs_device.o ../src/vfs.o lflag += -g -pie -T n58.ld.lds -Os -Wl,--no-warn-rwx-segments -flto -mcpu=cortex-m3 -mthumb -nostartfiles -nostdlib lflag += -Wl,--start-group,../posix/lib/libposix.a,$(ENV_DIR)/toolschain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/lib/gcc/arm-none-eabi/13.2.1/thumb/v7-m/nofp/libgcc.a,--end-group lflag += -Wl,-Bsymbolic,-gc-sections LD = gcc objs = main.o websocket_client.o websocket_client_posix.o uart_audio.o crc32_new.o hdlc_byte.o var_buffer_fifo.o tiny_json.o gpio.o led.o pwrkey.o adc.o rtc.o target = test image = $(target).spimg # Kconfig 配置目标:打开图形化配置界面 menuconfig: Kconfig @echo "Starting Kconfig menuconfig..." kconfig-mconf $< --output $(KCONFIG_CONFIG) @# 配置后立即生头文件 $(MAKE) generate_header generate_header: $(KCONFIG_CONFIG) @echo "Generating autoconf.h from .config..." $(KCONFIG_TOOL) --silentoldconfig $(CURDIR)/Kconfig $(KCONFIG_CONFIG) --header=$(KCONFIG_AUTOHEADER) @test -f $(KCONFIG_AUTOHEADER) || (echo "Error: Failed to generate autoconf.h"; exit 1) @echo "Successfully generated $(KCONFIG_AUTOHEADER)" $(KCONFIG_AUTOHEADER): $(KCONFIG_CONFIG) @if [ ! -f "$(KCONFIG_CONFIG)" ]; then \ $(MAKE) menuconfig; \ else \ $(MAKE) generate_header; \ fi .c.o: $(CROSS)$(CC) -c $< $(INC) $(CFLAG) all:$(KCONFIG_AUTOHEADER) $(target) $(image) @echo "Build completed successfully" $(target):$(objs) $(CROSS)$(LD) -o $@ $^ $(lflag) $(image):$(target) $(CREAT_TOOL) $(target) host armm3 > /dev/null clean: -rm -fv $(target) -rm -fv *.o -rm -fv *.spimg spvsoc@spvsoc-vm:~/4G_8006/vsoc_posix_env$ make clean ;make make clean -C src make[1]: 进入目录“/home/spvsoc/4G_8006/vsoc_posix_env/src” ENV_DIR = /home/spvsoc/lite-user-runtime-env rm -f *.o libposix.a rm -f .depend make[1]: 离开目录“/home/spvsoc/4G_8006/vsoc_posix_env/src” make clean -C test make[1]: 进入目录“/home/spvsoc/4G_8006/vsoc_posix_env/test” ENV_DIR = /home/spvsoc/lite-user-runtime-env rm -fv test rm -fv *.o rm -fv *.spimg make[1]: 离开目录“/home/spvsoc/4G_8006/vsoc_posix_env/test” rm posix -rf make install -C src make[1]: 进入目录“/home/spvsoc/4G_8006/vsoc_posix_env/src” ENV_DIR = /home/spvsoc/lite-user-runtime-env /home/spvsoc/lite-user-runtime-env/toolschain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-gcc -g -Wall -Os -fno-asynchronous-unwind-tables -mcpu=cortex-m3 -mthumb -nostdinc -nostdlib -ffreestanding -ffunction-sections -fdata-sections -fPIE -fno-builtin-function -Werror=implicit -flto -I ./ -I include/ -I /home/spvsoc/lite-user-runtime-env/toolschain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/lib/gcc/arm-none-eabi/13.2.1/include -c dns_server.c /home/spvsoc/lite-user-runtime-env/toolschain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-gcc -g -Wall -Os -fno-asynchronous-unwind-tables -mcpu=cortex-m3 -mthumb -nostdinc -nostdlib -ffreestanding -ffunction-sections -fdata-sections -fPIE -fno-builtin-function -Werror=implicit -flto -I ./ -I include/ -I /home/spvsoc/lite-user-runtime-env/toolschain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/lib/gcc/arm-none-eabi/13.2.1/include -c exit.c /home/spvsoc/lite-user-runtime-env/toolschain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-gcc -g -Wall -Os -fno-asynchronous-unwind-tables -mcpu=cortex-m3 -mthumb -nostdinc -nostdlib -ffreestanding -ffunction-sections -fdata-sections -fPIE -fno-builtin-function -Werror=implicit -flto -I ./ -I include/ -I /home/spvsoc/lite-user-runtime-env/toolschain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/lib/gcc/arm-none-eabi/13.2.1/include -c memset.c /home/spvsoc/lite-user-runtime-env/toolschain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-gcc -g -Wall -Os -fno-asynchronous-unwind-tables -mcpu=cortex-m3 -mthumb -nostdinc -nostdlib -ffreestanding -ffunction-sections -fdata-sections -fPIE -fno-builtin-function -Werror=implicit -flto -I ./ -I include/ -I /home/spvsoc/lite-user-runtime-env/toolschain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/lib/gcc/arm-none-eabi/13.2.1/include -c network.c /home/spvsoc/lite-user-runtime-env/toolschain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-gcc -g -Wall -Os -fno-asynchronous-unwind-tables -mcpu=cortex-m3 -mthumb -nostdinc -nostdlib -ffreestanding -ffunction-sections -fdata-sections -fPIE -fno-builtin-function -Werror=implicit -flto -I ./ -I include/ -I /home/spvsoc/lite-user-runtime-env/toolschain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/lib/gcc/arm-none-eabi/13.2.1/include -c raw.c /home/spvsoc/lite-user-runtime-env/toolschain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-gcc -g -Wall -Os -fno-asynchronous-unwind-tables -mcpu=cortex-m3 -mthumb -nostdinc -nostdlib -ffreestanding -ffunction-sections -fdata-sections -fPIE -fno-builtin-function -Werror=implicit -flto -I ./ -I include/ -I /home/spvsoc/lite-user-runtime-env/toolschain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/lib/gcc/arm-none-eabi/13.2.1/include -c strncasecmp.c /home/spvsoc/lite-user-runtime-env/toolschain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-gcc -g -Wall -Os -fno-asynchronous-unwind-tables -mcpu=cortex-m3 -mthumb -nostdinc -nostdlib -ffreestanding -ffunction-sections -fdata-sections -fPIE -fno-builtin-function -Werror=implicit -flto -I ./ -I include/ -I /home/spvsoc/lite-user-runtime-env/toolschain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/lib/gcc/arm-none-eabi/13.2.1/include -c timerfd.c /home/spvsoc/lite-user-runtime-env/toolschain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-gcc -g -Wall -Os -fno-asynchronous-unwind-tables -mcpu=cortex-m3 -mthumb -nostdinc -nostdlib -ffreestanding -ffunction-sections -fdata-sections -fPIE -fno-builtin-function -Werror=implicit -flto -I ./ -I include/ -I /home/spvsoc/lite-user-runtime-env/toolschain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/lib/gcc/arm-none-eabi/13.2.1/include -c vfs.c /home/spvsoc/lite-user-runtime-env/toolschain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-gcc -g -Wall -Os -fno-asynchronous-unwind-tables -mcpu=cortex-m3 -mthumb -nostdinc -nostdlib -ffreestanding -ffunction-sections -fdata-sections -fPIE -fno-builtin-function -Werror=implicit -flto -I ./ -I include/ -I /home/spvsoc/lite-user-runtime-env/toolschain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/lib/gcc/arm-none-eabi/13.2.1/include -c vfs_device.c /home/spvsoc/lite-user-runtime-env/toolschain/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-gcc-ar rcs libposix.a dns_server.o exit.o memset.o network.o raw.o strncasecmp.o timerfd.o vfs.o vfs_device.o rm ../posix -rf mkdir ../posix cp include ../posix -rf mkdir ../posix/lib cp libposix.a ../posix/lib make[1]: 离开目录“/home/spvsoc/4G_8006/vsoc_posix_env/src” make -C test make[1]: 进入目录“/home/spvsoc/4G_8006/vsoc_posix_env/test” ENV_DIR = /home/spvsoc/lite-user-runtime-env Starting Kconfig menuconfig... kconfig-mconf Kconfig --output /home/spvsoc/4G_8006/vsoc_posix_env/test/.config *** End of the configuration. *** Execute 'make' to start the build or try 'make help'. make generate_header make[2]: 进入目录“/home/spvsoc/4G_8006/vsoc_posix_env/test” ENV_DIR = /home/spvsoc/lite-user-runtime-env Generating autoconf.h from .config... /usr/bin/kconfig-conf --silentoldconfig /home/spvsoc/4G_8006/vsoc_posix_env/test/Kconfig /home/spvsoc/4G_8006/vsoc_posix_env/test/.config --header=/home/spvsoc/4G_8006/vsoc_posix_env/test/autoconf.h /usr/bin/kconfig-conf: 未识别的选项 "--header=/home/spvsoc/4G_8006/vsoc_posix_env/test/autoconf.h" Usage: /usr/bin/kconfig-conf [-s] [option] <kconfig-file> [option] is _one_ of the following: --listnewconfig List new options --oldaskconfig Start a new configuration using a line-oriented program --oldconfig Update a configuration using a provided .config as base --silentoldconfig Same as oldconfig, but quietly, additionally update deps --olddefconfig Same as silentoldconfig but sets new symbols to their default value --oldnoconfig An alias of olddefconfig --defconfig <file> New config with default defined in <file> --savedefconfig <file> Save the minimal current configuration to <file> --allnoconfig New config where all options are answered with no --allyesconfig New config where all options are answered with yes --allmodconfig New config where all options are answered with mod --alldefconfig New config with all symbols set to default --randconfig New config with random answer to all options make[2]: *** [Makefile:75:generate_header] 错误 1 make[2]: 离开目录“/home/spvsoc/4G_8006/vsoc_posix_env/test” make[1]: *** [Makefile:71:menuconfig] 错误 2 make[1]: 离开目录“/home/spvsoc/4G_8006/vsoc_posix_env/test” make: *** [Makefile:3:all] 错误 2
08-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值