专栏首页悟空被FFmpeg玩使用Kernel的Makefile生成tags和cscope看代码更方便

使用Kernel的Makefile生成tags和cscope看代码更方便

  1. [root@btg ext4]# make help
  2. Cleaning targets:
  3. clean - Remove most generated files but keep the config and
  4. enough build support to build external modules
  5. mrproper - Remove all generated files + config + various backup files
  6. distclean - mrproper + remove editor backup and patch files
  7. Configuration targets:
  8. config - Update current config utilising a line-oriented program
  9. nconfig - Update current config utilising a ncurses menu based program
  10. menuconfig - Update current config utilising a menu based program
  11. xconfig - Update current config utilising a QT based front-end
  12. gconfig - Update current config utilising a GTK based front-end
  13. oldconfig - Update current config utilising a provided .config as base
  14. localmodconfig - Update current config disabling modules not loaded
  15. localyesconfig - Update current config converting local mods to core
  16. silentoldconfig - Same as oldconfig, but quietly, additionally update deps
  17. defconfig - New config with default from ARCH supplied defconfig
  18. savedefconfig - Save current config as ./defconfig (minimal config)
  19. allnoconfig - New config where all options are answered with no
  20. allyesconfig - New config where all options are accepted with yes
  21. allmodconfig - New config selecting modules when possible
  22. alldefconfig - New config with all symbols set to default
  23. randconfig - New config with random answer to all options
  24. listnewconfig - List new options
  25. oldnoconfig - Same as silentoldconfig but set new symbols to n (unset)
  26. Other generic targets:
  27. all - Build all targets marked with [*]
  28. * vmlinux - Build the bare kernel
  29. * modules - Build all modules
  30. modules_install - Install all modules to INSTALL_MOD_PATH (default: /)
  31. firmware_install- Install all firmware to INSTALL_FW_PATH
  32. (default: $(INSTALL_MOD_PATH)/lib/firmware)
  33. dir/ - Build all files in dir and below
  34. dir/file.[oisS] - Build specified target only
  35. dir/file.lst - Build specified mixed source/assembly target only
  36. (requires a recent binutils and recent build (System.map))
  37. dir/file.ko - Build module including final link
  38. modules_prepare - Set up for building external modules
  39. tags/TAGS - Generate tags file for editors
  40. cscope - Generate cscope index
  41. gtags - Generate GNU GLOBAL index
  42. kernelrelease - Output the release version string
  43. kernelversion - Output the version stored in Makefile
  44. headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH
  45. (default: /opt/ext4/usr)
  46. checkstack - Generate a list of stack hogs
  47. namespacecheck - Name space analysis on compiled kernel
  48. versioncheck - Sanity check on version.h usage
  49. includecheck - Check for duplicate included header files
  50. export_report - List the usages of all exported symbols
  51. headers_check - Sanity check on exported headers
  52. headerdep - Detect inclusion cycles in headers
  53. coccicheck - Check with Coccinelle.
  54. Kernel packaging:
  55. rpm-pkg - Build both source and binary RPM kernel packages
  56. binrpm-pkg - Build only the binary kernel package
  57. deb-pkg - Build the kernel as an deb package
  58. tar-pkg - Build the kernel as an uncompressed tarball
  59. targz-pkg - Build the kernel as a gzip compressed tarball
  60. tarbz2-pkg - Build the kernel as a bzip2 compressed tarball
  61. tarxz-pkg - Build the kernel as a xz compressed tarball
  62. perf-tar-src-pkg - Build perf-2.6.39-rc3.tar source tarball
  63. perf-targz-src-pkg - Build perf-2.6.39-rc3.tar.gz source tarball
  64. perf-tarbz2-src-pkg - Build perf-2.6.39-rc3.tar.bz2 source tarball
  65. perf-tarxz-src-pkg - Build perf-2.6.39-rc3.tar.xz source tarball
  66. Documentation targets:
  67. Linux kernel internal documentation in different formats:
  68. htmldocs - HTML
  69. pdfdocs - PDF
  70. psdocs - Postscript
  71. xmldocs - XML DocBook
  72. mandocs - man pages
  73. installmandocs - install man pages generated by mandocs
  74. cleandocs - clean all generated DocBook files
  75. Architecture specific targets (x86):
  76. * bzImage - Compressed kernel image (arch/x86/boot/bzImage)
  77. install - Install kernel using
  78. (your) ~/bin/installkernel or
  79. (distribution) /sbin/installkernel or
  80. install to $(INSTALL_PATH) and run lilo
  81. fdimage - Create 1.4MB boot floppy image (arch/x86/boot/fdimage)
  82. fdimage144 - Create 1.4MB boot floppy image (arch/x86/boot/fdimage)
  83. fdimage288 - Create 2.8MB boot floppy image (arch/x86/boot/fdimage)
  84. isoimage - Create a boot CD-ROM image (arch/x86/boot/image.iso)
  85. bzdisk/fdimage*/isoimage also accept:
  86. FDARGS="..." arguments for the booted kernel
  87. FDINITRD=file initrd for the booted kernel
  88. x86_64_defconfig - Build for x86_64
  89. i386_defconfig - Build for i386
  90. make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build
  91. make V=2 [targets] 2 => give reason for rebuild of target
  92. make O=dir [targets] Locate all output files in "dir", including .config
  93. make C=1 [targets] Check all c source with $CHECK (sparse by default)
  94. make C=2 [targets] Force check of all c source with $CHECK
  95. make W=1 [targets] Enable extra gcc checks
  96. Execute "make" or "make all" to build all targets marked with [*]
  97. For further info see the ./README file
  98. [root@btg ext4]#
  99. [root@btg ext4]# make tags cscope
  100. GEN tags
  101. GEN cscope
  102. [root@btg ext4]#

我自己生成的cscope和tags打开的内容

  1. Cscope tag: start_kernel
  2.    # 行 文件名 / 上下文 / 行
  3.    1 135 arch/alpha/boot/bootp.c <<start_kernel>>
  4.              start_kernel(void )
  5.    2 263 arch/alpha/boot/bootpz.c <<start_kernel>>
  6.              start_kernel(void )
  7.    3 153 arch/alpha/boot/main.c <<start_kernel>>
  8.              void start_kernel(void )
  9.    4 456 init/main.c <<start_kernel>>
  10.              asmlinkage void __init start_kernel(void )
  11. Type number and <Enter> (empty cancels):

如果使用kernel的Makefile里的会直接进入到

  1.    4 456 init/main.c <<start_kernel>>
  2.              asmlinkage void __init start_kernel(void )
  3. 里面

非常方便

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

我来说两句

0 条评论
登录 后参与评论

相关文章

  • 使用ffmpeg的overlay filter为视频增加跑马灯

    在看视频时,图像上面有流动字幕,或者流动图片,这个效果一般名为跑马灯效果,可以通过overlay的filter实现该效果 overlay是ffmpeg的...

    用户3765803
  • linux到3.0了

    Yay! Let the bikeshed painting discussions about version numbering begin (or at...

    用户3765803
  • git 配置基本信息

    用户3765803
  • 十年磨一剑!纳德拉带领微软反超苹果,刷新全球公司市值排行榜

    据微软官方消息,在11月23日周五盘中至收盘,微软以7533.4亿美元的市值正式超过苹果,成为世界上市值最高的公司。

    镁客网
  • 3.shell编程-文件查找之find命令

    搜索/home/shell_learn/下的文件,文件名以.sh结尾,且修改时间在一个星期之内的,然后将其删除

    zhang_derek
  • 【前端基础】JS基础学习笔记整理

    JavaScript是一种基于对象的脚本编程语言,是浏览器上的程序语言。当web容器输出内容到浏览器时,这个内容是包含js源代码的,此时,JavaScript可...

    李海彬
  • 以云计算为名之微软生死战略大逃亡(下)

    以云计算为名之微软生死战略大逃亡(下) ? 题外话:企业话题比较敏感,有时候写出来又被删掉对我打击大。所以部分话题打算在小密圈私下讨论,成熟以后再搬出来写。 ...

    用户1564362
  • 每个JavaScript工程师都应懂的33个概念

    这个项目是为了帮助开发者掌握 JavaScript 概念而创立的。它不是必备,但在未来学习(JavaScript)中,可以作为一篇指南。

    Fundebug
  • 每个JavaScript工程师都应懂的33个概念

    这个项目是为了帮助开发者掌握 JavaScript 概念而创立的。它不是必备,但在未来学习(JavaScript)中,可以作为一篇指南。

    Fundebug
  • jbpm5.1介绍(9)

    Junit测试调用子流程 下面的示例中测试在程序中调用其它程序的子流程的示例,需要加载两个配置文件 ? 和 ? 需要指定属性 下面是调用的示例程序 publ...

    cloudskyme

扫码关注云+社区

领取腾讯云代金券