设为首页 加入收藏

TOP

Ubuntu下编译Linux-xen的问题
2014-11-24 02:38:48 来源: 作者: 【 】 浏览:2
Tags:Ubuntu 编译 Linux-xen 问题

最后发现问题在于Ubuntu默认会把/bin/sh指向/bin/dash,在scripts/Makefile.build里面加上一行SHELL=/bin/bash指定$(shell)使用bash即可。后来还搜了一下为什么Ubuntu使用dash而不是bash,其理由是dash的执行效率更高,但不可否认的是这个改动也导致了一些项目无法成功编译,虽然无法成功编译的原因可能是Makefile里使用了一些bash的特性而非POSIX shell所提供的那些。


另外在debug过程中在网上找到了一些debug Makefile的技巧:


make -n 可以仅仅打印出将要被执行的命令,而不去实际执行


make -np 可以打印出更多的信息(使用的规则和变量),并执行每一条命令


remake也是个不错的选择:“remake is a patched and modernized version of GNU make utility that adds improved error reporting, the ability to trace execution in a comprehensible way, and a debugger.”


在检查shell命令的时候,可以使用set -x使得所有shell命令在执行前都能被输出。


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Java中“equals"和"==”的区别 下一篇Java堆与栈内存分配及String小记

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: