(包:Make+colors
依赖: GNU/Linux, 下载工具, 网页浏览器

闻GoboLinux有一ColorMake,将make的东西分不同内容用不同颜色显示。可惜系统不是GoboLinux,将ColorMake复制到其他GNU/Linux上。于是纂此文。
1:把源码搞到手。
GoboLinux的Scripts的svn地址为:http://svn.gobolinux.org/tools/trunk/Scripts
于是检出:
代码: 全选
cd ~/个人/下载/VCS/SVN-Download &&
svn co http://svn.gobolinux.org/tools/trunk/Scripts
2:Mtail
依赖: Python
代码: 全选
tlcr: 0 庚寅年六月十七日 16:59:39 ~
>> file ~scripts/mtail
/home/tusooa/应用/脚本/mtail: a /usr/bin/python script text executable
安装Mtail:
代码: 全选
cp mtail $HOME/应用/脚本/
代码: 全选
tlcr: 0 庚寅年六月十七日 16:59:53 ~
>> dog ~dw/VCS/SVN-Download/Scripts/bin/ColorMake
#!/bin/bash
. ScriptFunctions
Import File
Import GoboLinux
# XXX "Real vs. rootless" support
if [ -x /bin/make ]
then makecmd=/bin/make
elif [ -x /usr/bin/make ]
then makecmd=/usr/bin/make
fi
for i in "$@"
do
if [ "$i" = "menuconfig" ]
then exec $makecmd "$@"
fi
done
if Quiet which mtail; then
$makecmd "$@" 2>&1 | mtail --config="`Find_Conf ColorMake.mtailrc`" -q
exit ${PIPESTATUS[0]}
else
Log_Terse "mtail not found. Unable to colorize output."
$makecmd "$@"
fi
tlcr: 0 庚寅年六月十七日 17:04:30 ~
>>
Scripts里面的那个ColorMake是给GoboLinux用的,在其他的GNU/Linux里面貌似不能用,所以只要那个配置文件。ColorMake待会儿自己写。
拷贝配置文件:
代码: 全选
cp Resources/Defaults/Settings/Scripts/ColorMake.mtailrc ~/应用/配置/
代码: 全选
tlcr: 0 庚寅年六月十七日 17:42:57 ~
>> ds-打印脚本.bash ColorMake
#!/bin/bash
# vim : ft=bash
. scriptFunctions
if [ "$(no-err which make)" ] ; then
makeCmd="$(which make)"
else
dieg $Ec_FileNotFound "没有找到 make"
fi
args=()
while [[ $# > 0 ]] ; do
if [[ "$1" == "-N" ]] || [[ "$1" == "--no-colors" ]] ; then
shift
"$makeCmd" "${args[@]}" "$@"
exit
else
args=("${args[@]}" "$1")
fi
shift
done
if quiet which mtail ; then
"$makeCmd" "${args[@]}" 2>&1 | mtail --config "$HOME/应用/配置/ColorMake.mtailrc" -q
else
"$makeCmd" "${args[@]}"
fi
tlcr: 0 庚寅年六月十七日 17:42:58 ~
>>
输入make的时候自动加colors:
以下内容,拷贝到~/.zshrc的最后:
代码: 全选
alias make=ColorMake