首页 > 系统相关 >不能使用astyle对Linux的Kconfig和Makefile进行排版,会导致编译错误

不能使用astyle对Linux的Kconfig和Makefile进行排版,会导致编译错误

时间:2023-06-27 10:11:32浏览次数:39  
标签:rw Kconfig -- Jun Makefile hankf Linux xlnx

代码排版工具

不同人代码的排版习惯不一样。遇到自己不喜欢的格式,看起来比较麻烦。可以使用astyle对代码进行排版。 我喜欢以"otbs"格式的排版。命令如下:

astyle -s --style=otbs *.c 
astyle -s --style=otbs *.h

错误排版

一次使用时,不小心对所有文件进行了排版。

hankf@XSZGS4:xilinx$  astyle -s --style=otbs *

hankf@XSZGS4:xilinx$ ls -l -h
total 188K
-rw-rw-r-- 1 hankf hankf 2.1K Jun 20 15:09 Kconfig
-rw-r--r-- 1 hankf hankf 2.1K Jun 16 17:08 Kconfig.orig
-rw-rw-r-- 1 hankf hankf 1.5K Jun 20 14:57 Makefile
-rw-r--r-- 1 hankf hankf  661 Jun 16 17:08 Makefile.orig
-rw-rw-r-- 1 hankf hankf 3.6K Jun 20 14:18 xilinx-dp-card.c
-rw-rw-r-- 1 hankf hankf 4.6K Jun 20 14:18 xilinx-dp-codec.c
-rw-rw-r-- 1 hankf hankf 2.3K Jun 20 14:18 xilinx-dp-pcm.c
-rw-rw-r-- 1 hankf hankf  27K Jun 20 14:52 xlnx_formatter_pcm.c
-rw-rw-r-- 1 hankf hankf 8.1K Jun 20 15:03 xlnx_i2s.c
-rw-rw-r-- 1 hankf hankf  15K Jun 20 14:57 xlnx_pl_snd_card.c
-rw-rw-r-- 1 hankf hankf  15K Jun 20 14:50 xlnx_pl_snd_card.c.orig
-rw-rw-r-- 1 hankf hankf  18K Jun 20 15:04 xlnx_sdi_audio.c
-rw-rw-r-- 1 hankf hankf  383 Jun 20 14:31 xlnx_snd_common.h
-rw-rw-r-- 1 hankf hankf  12K Jun 20 15:05 xlnx_spdif.c

再编译Linux是,得到下列错误。

NOTE: linux-xlnx: compiling from external source tree workspace/linux-xlnx
ERROR: linux-xlnx-5.4+git999-r0 do_compile_kernelmodules: oe_runmake failed
ERROR: linux-xlnx-5.4+git999-r0 do_compile_kernelmodules: Execution of '..../linux-xlnx/5.4+git999-r0/temp/run.do_compile_kernelmodules.3904' failed with exit code 1:
make: Entering directory '..../linux-xlnx/5.4+git999-r0/linux-xlnx-5.4+git999'
  GEN     Makefile
scripts/kconfig/conf  --syncconfig Kconfig
sound/soc/xilinx/Kconfig:13:warning: ignoring unsupported character '.'
sound/soc/xilinx/Kconfig:14: syntax error
sound/soc/xilinx/Kconfig:13: unknown statement "support"
sound/soc/xilinx/Kconfig:14:warning: ignoring unsupported character '.'
sound/soc/xilinx/Kconfig:14: unknown statement "audio"
make[3]: *** [workspace/linux-xlnx/scripts/kconfig/Makefile:73: syncconfig] Error 1
make[2]: *** [workspace/linux-xlnx/Makefile:567: syncconfig] Error 2
make[1]: *** [workspace/linux-xlnx/Makefile:678: include/config/auto.conf.cmd] Error 2
make[1]: *** [include/config/auto.conf.cmd] Deleting file 'include/config/tristate.conf'
make: *** [workspace/linux-xlnx/Makefile:179: sub-make] Error 2
make: Leaving directory '..../linux-xlnx/5.4+git999-r0/linux-xlnx-5.4+git999'

恢复

幸好astyle对文件进行了备份。之间使用 Kconfig.orig、Makefile.orig恢复Kconfig和Makefile。再次编译,又能正常编译了。

hankf@XSZGS4:xilinx$ cp Kconfig.orig  Kconfig

hankf@XSZGS4:xilinx$ cp Makefile.orig  Makefile

标签:rw,Kconfig,--,Jun,Makefile,hankf,Linux,xlnx
From: https://www.cnblogs.com/hankfu/p/17507919.html

相关文章

  • 解决PetaLinux编译Microblaze的U-Boot的错误 “undefined reference to `eth_get_dev_
    错误PetaLinux编译Microblaze的U-Boot时,遇到下列错误,链接时提示找不到相关函数。|microblazeel-xilinx-linux-ld.bfd-Bstatic--no-dynamic-linker-Ttext0x80100000-ou-boot-Tu-boot.ldsarch/microblaze/cpu/start.o--start-grouparch/microblaze/cpu/built-......
  • 查找占用Linux系统上最多空间的目录
    要查找占用Linux系统上最多空间的目录,可以使用以下命令:du-h--max-depth=1/ 这个命令会列出根目录下每个目录占用空间的大小,并以降序排列。其中,`-h`选项表示以人类可读的格式显示大小,`--max-depth=1`选项表示只显示一层目录你可以通过查看这个列表来确定哪些目录占用了最......
  • Linux下进程隐藏
    https://github.com/gianlucaborello/libprocesshider/劫持预加载动态链接库LD_PRELOAD查看Linux操作系统正在运行的进程,一般会使用系统命令ps、top等,像ps这样的命令通常是读取了/proc/目录下文件。Linux操作系统上的/proc目录存储的是当前内核运行状态的一系列特殊......
  • 【Linux】systemd.timer replace the crontab or at jobs
    systemd架构学习Systemd的第一步,就是搞懂"单元"(unit)是什么。简单说,单元就是Systemd的最小功能单位,是单个进程的描述。一个个小的单元互相调用和依赖,组成一个庞大的任务管理系统,这就是Systemd的基本思想。由于Systemd要做的事情太多,导致单元有很多不同的种类,大概一......
  • Linux安装MongoDB
    Linux安装MongoDB环境Linux:Centos7MongoDB:5.0.9下载位置官网:https://www.mongodb.com/try/download/communityhttps://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-5.0.9.tgz下载依赖与安装包安装所需要工具:yuminstallwget-yyuminstallvim-......
  • Linux将home磁盘空间分给root_随笔记
    ==========================================将home空间配给roottarcvf/home.tar/home#备份家目录fuser-km/home#终止家目录所有进程umount/home#卸载家目录lvremove/dev/mapper/......
  • linux服务器网口bond和交换机链路聚合的对接和差异之理解
    linux服务器网口bond和交换机链路聚合的对接和差异之理解1、前言我们在服务器和交换机对接的场景中,经常接到这样的需求——1、希望服务器和接入交换机之间的链路形成冗余;2、两条链路形成冗余的同时,对两条物理链路的流量进行负载分担,从而形成带宽叠加的效果。因此在这样的需求之......
  • 如何创建Linux虚拟机
    二,新建Linux虚拟机1.1创建新的虚拟机12345671.2编制虚拟机设置1 23  3 1.3开启Linux虚拟机1 2 3 4 5 6 6 7 8 9 10 11 12 13 14 15 16 17(C:\Users\G。\AppData\Roami......
  • Linux下安装neo4j
    Linux下安装neo4j一、JDK安装参照https://www.cnblogs.com/yclh/p/14849228.html中jdk1.8的安装二、下载neo4j下载地址:https://neo4j.com/download-center/选择社区版,下载完成后得到neo4j-community-3.5.5-unix.tar.gz为了适配jdk1.8版本,版本太高的需要JDK的更高版本  ......
  • Linux可视化管理-webmin工具
    环境:连接工具:tabby,操作系统:centos7.6.webmin介绍​ Webmin是功能强大的基于Web的Unix/linux系统管理工具。管理员通过浏览器访问Webmin的各种管理功能并完成相应的管理操作。除了各版本的linux以外还可用于:AIX、HPUX、Solaris、Unixware、Irix和FreeBSD等系统安......