[LLVMdev] patch: purdy colours for makefiles
Kona Blend
kona8lend at gmail.com
Sat Feb 20 22:59:05 PST 2010
Here is a patch to add colour to build output (make) for LLVM sources.
Feedback and ideas welcome.
The patch replaces $(Echo) usage in some key rules in Makefile.rules
with $(Banner) which invokes a new script utils/make-banner.sh which
is capable of adding appropriate ANSI escape sequences.
step1: apply patch
step2: chmod 755 utils/make-banner.sh
step3: export MAKE_BANNER_ANSI=1
Next, you must have an xterm or an ANSI capable terminal advertising
itself via $TERM and matching substring 'xterm'. Now simply set your env
and make:
export MAKE_BANNER_ANSI=1
make
SOME EXAMPLES:
export MAKE_BANNER_ANSI=1
utils/make-banner.sh -help
utils/make-banner.sh Hello -bold world.
utils/make-banner.sh -prefix "llvm[99]:" -bold M4 processing -in file.txt.m4 "->" -out file.txt
PERFORMANCE CONSIDERATIONS
- total lines of make output to build llvm+clang: 1330
- sub-shell echo rate: ~1485 lines/second
- sub-shell make-banner.sh rate: ~267 lines/second
Build speed comparison. Host environment:
- Mac OS X 10.6.2, gcc-4.2, 8 core host
- build llvm + clang (debug)
- llvm and clang trunk at 96719
- timing command: time make -j8 (times shown are in seconds, USER SYSTEM ELAPSED)
BEFORE PATCH:
>time make -j8
pass1. 1384.373u 226.969s 4:22.87 612.9%
pass2. 1385.766u 227.542s 4:18.40 624.3%
pass3. 1379.234u 224.674s 4:17.56 622.7%
AFTER PATCH:
>setenv MAKE_BANNER_ANSI=1
>time make -j8
pass1. 1387.113u 228.287s 4:20.97 618.9%
pass2. 1389.143u 228.544s 4:20.58 620.7%
pass3. 1386.785u 228.141s 4:20.37 620.2%
--kb
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 835091.txt
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100221/3f620ccf/attachment.txt>
-------------- next part --------------
More information about the llvm-dev
mailing list