make V=1 查看完整的gcc編譯信息
Linux內核make命令選項
2012年5月28日升級Linux內核的操作已經變得很簡單,基本的幾個命令即可搞定:make menuconfig、make、make modules、make modules_install、make install。除了這幾個常用選項,make命令還有另外的幾個選項對於我們也是十分有幫助,在內核源碼樹目錄下執行make help可以看到這些選項,不過下面還是介紹幾個我認為比較有用的選項:
1,make V=1,這個選項能顯示出編譯過程中的詳細信息,即是verbose編譯模式,在之前的《顯示make編譯信息》文章裏曾介紹過修改makefile來達到這個目的,但make V=1更簡單方便,而make V=0或直接make(V=0是默認值)則是quiet編譯模式,只會顯示出簡單的編譯信息。
1 |
[root@localhost linux-2.6.30]# make V=1
|
2,make dir/:指定編譯目標,編譯指定的某個目錄:
1 |
[root@localhost linux-2.6.30]# make drivers/scsi/
|
3,make dir/file.ko:指定編譯目標,編譯指定的某個模塊:
1 |
[root@localhost linux-2.6.30]# make drivers/net/igb/igb.ko
|
4,make dir/file.[ois]:指定編譯目標,編譯指定的某個文件為目標文件、頭文件展開文件、匯編文件:
1 2 3 |
[root@localhost linux-2.6.30]# make drivers/net/igb/igb_main.o
[root@localhost linux-2.6.30]# make drivers/net/igb/igb_main.i
[root@localhost linux-2.6.30]# make drivers/net/igb/igb_main.s
|
5,make checkstack:函數棧靜態檢查
6,make includecheck:頭文件重復靜態檢查
最後看下命令make help執行的顯示信息:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
[root@localhost linux-2.6.30]# make help
Cleaning targets:
clean - Remove most generated files but keep the config and
enough build support to build external modules
mrproper - Remove all generated files + config + various backup files
distclean - mrproper + remove editor backup and patch files
Configuration targets:
config - Update current config utilising a line-oriented program
menuconfig - Update current config utilising a menu based program
xconfig - Update current config utilising a QT based front-end
gconfig - Update current config utilising a GTK based front-end
oldconfig - Update current config utilising a provided .config as base
silentoldconfig - Same as oldconfig, but quietly
randconfig - New config with random answer to all options
defconfig - New config with default answer to all options
allmodconfig - New config selecting modules when possible
allyesconfig - New config where all options are accepted with yes
allnoconfig - New config where all options are answered with no
Other generic targets:
all - Build all targets marked with [*]
* vmlinux - Build the bare kernel
* modules - Build all modules
modules_install - Install all modules to INSTALL_MOD_PATH ( default : /)
firmware_install- Install all firmware to INSTALL_FW_PATH
( default : $(INSTALL_MOD_PATH)/lib/firmware)
dir/ - Build all files in dir and below
dir/file.[ois] - Build specified target only
dir/file.ko - Build module including final link
modules_prepare - Set up for building external modules
tags/TAGS - Generate tags file for editors
cscope - Generate cscope index
kernelrelease - Output the release version string
kernelversion - Output the version stored in Makefile
headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH
( default : /usr/src/linux-2.6.30/usr)
Static analysers
checkstack - Generate a list of stack hogs
namespacecheck - Name space analysis on compiled kernel
versioncheck - Sanity check on version.h usage
includecheck - Check for duplicate included header files
export_report - List the usages of all exported symbols
headers_check - Sanity check on exported headers
headerdep - Detect inclusion cycles in headers
Kernel packaging:
rpm-pkg - Build both source and binary RPM kernel packages
binrpm-pkg - Build only the binary kernel package
deb-pkg - Build the kernel as an deb package
tar-pkg - Build the kernel as an uncompressed tarball
targz-pkg - Build the kernel as a gzip compressed tarball
tarbz2-pkg - Build the kernel as a bzip2 compressed tarball
Documentation targets:
Linux kernel internal documentation in different formats:
htmldocs - HTML
pdfdocs - PDF
psdocs - Postscript
xmldocs - XML DocBook
mandocs - man pages
installmandocs - install man pages generated by mandocs
cleandocs - clean all generated DocBook files
Architecture specific targets (x86):
* bzImage - Compressed kernel image (arch/x86/boot/bzImage)
install - Install kernel using
(your) ~/bin/installkernel or
(distribution) /sbin/installkernel or
install to $(INSTALL_PATH) and run lilo
fdimage - Create 1.4MB boot floppy image (arch/x86/boot/fdimage)
fdimage144 - Create 1.4MB boot floppy image (arch/x86/boot/fdimage)
fdimage288 - Create 2.8MB boot floppy image (arch/x86/boot/fdimage)
isoimage - Create a boot CD-ROM image (arch/x86/boot/image.iso)
bzdisk/fdimage*/isoimage also accept:
FDARGS= "..." arguments for the booted kernel
FDINITRD=file initrd for the booted kernel
i386_defconfig - Build for i386
x86_64_defconfig - Build for x86_64
make V=0|1 [targets] 0 => quiet build ( default ), 1 => verbose build
make V=2 [targets] 2 => give reason for rebuild of target
make O=dir [targets] Locate all output files in "dir" , including .config
make C=1 [targets] Check all c source with $CHECK (sparse by default )
make C=2 [targets] Force check of all c source with $CHECK
Execute "make" or "make all" to build all targets marked with [*]
For further info see the ./README file
[root@localhost linux-2.6.30]#
|
轉載請保留地址:http://www.lenky.info/archives/2012/05/1688 或 http://lenky.info/?p=1688
備註:如無特殊說明,文章內容均出自Lenky個人的真實理解而並非存心妄自揣測來故意愚人耳目。由於個人水平有限,雖力求內容正確無誤,但仍然難免出錯,請勿見怪,如果可以則請留言告之,並歡迎來信討論。另外值得說明的是,Lenky的部分文章以及部分內容參考借鑒了網絡上各位網友的熱心分享,特別是一些帶有完全參考的文章,其後附帶的鏈接內容也許更直接、更豐富,而我只是做了一下歸納&轉述,在此也一並表示感謝。關於本站的所有技術文章,歡迎轉載,但請遵從CC創作共享協議,而一些私人性質較強的心情隨筆,建議不要轉載。
法律:根據最新頒布的《信息網絡傳播權保護條例》,如果您認為本文章的任何內容侵犯了您的權利,請以Email或書面等方式告知,本站將及時刪除相關內容或鏈接。
分類:*nix技術, 內核技術, 跟蹤調試類似文章
make V=1 查看完整的gcc編譯信息