Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Mini-HOWTO] Colormake - colored make output, also in emerge
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
voidzero
Bodhisattva
Bodhisattva


Joined: 21 Jul 2002
Posts: 265
Location: Grnn

PostPosted: Mon Jun 04, 2007 1:55 am    Post subject: [Mini-HOWTO] Colormake - colored make output, also in emerge Reply with quote

Because I find this funny and less-boring to stare at, I found a way to get colored make output. It's not in portage but here's the codebit to get it working, partially used some debian magic to get it going. (Hey, finally some code without loads of explaining! ;))

Note
Ok well, a little bit of explaining might be in order. So here goes. I have /usr/local/bin set in my PATH environment variable, set before the usual /usr/bin andsoforth. PATH order preference goes from left to right, so make sure you have /usr/local/bin before /usr/bin. Example for a user, ie. not root:
Code:
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games"


root usually has /usr/local/sbin, /usr/sbin and /sbin in that order, each one before their 'bin'-variant.

Here's how to get colored make output system-wide. Perform as root:
Code:
wget http://bre.klaki.net/programs/colormake/colormake-0.2.tar.gz
tar zxvf colormake-0.2.tar.gz
cd colormake
cp colormake.pl /usr/local/bin
cat > /usr/local/bin/colormake <<EOF
#!/bin/bash
#
# Wrapper around make, to colorize it's output and pipe through less.
# Jumps to the first gcc error that occurs during the build process.
# After a debian example.

/usr/bin/make "$@" 2>&1 | /usr/local/bin/colormake.pl
exit ${PIPESTATUS[0]}
EOF
chmod 755 /usr/local/bin/colormake
ln -s /usr/local/bin/colormake /usr/local/bin/make

This should make it work without problems, yet with easy re traceable steps might anything go wrong. (Re-)emerge an application to try it out.
_________________
Diplomacy is the art of letting the other party have things your way.
-- Daniele Vare
Back to top
View user's profile Send private message
voidzero
Bodhisattva
Bodhisattva


Joined: 21 Jul 2002
Posts: 265
Location: Grnn

PostPosted: Tue Jun 12, 2007 12:18 pm    Post subject: Reply with quote

So no one's interested? :oops:
_________________
Diplomacy is the art of letting the other party have things your way.
-- Daniele Vare
Back to top
View user's profile Send private message
sonicbhoc
Veteran
Veteran


Joined: 24 Oct 2005
Posts: 1805
Location: In front of the computer screen

PostPosted: Tue Jun 12, 2007 12:20 pm    Post subject: Reply with quote

I am! I would also like to figure out how to get colorgcc (in portage) to work as well, but I believe that these two programs do the same thing so colorgcc is not really important.
_________________
I'm too lazy to keep this stupid signature up to date, so here's something more interesting:
My friend Hetdegon can draw if you ask me.
Now using PClinuxOS on my laptop and Gentoo on my desktop and new laptop.
Back to top
View user's profile Send private message
voidzero
Bodhisattva
Bodhisattva


Joined: 21 Jul 2002
Posts: 265
Location: Grnn

PostPosted: Tue Jun 12, 2007 12:22 pm    Post subject: Reply with quote

sonicbhoc wrote:
I am! I would also like to figure out how to get colorgcc (in portage) to work as well, but I believe that these two programs do the same thing so colorgcc is not really important.


:)

Yeah colorgcc doesn't show colored gcc commands, only errors and warnings in colors (iirc!)
_________________
Diplomacy is the art of letting the other party have things your way.
-- Daniele Vare
Back to top
View user's profile Send private message
ishanarora
n00b
n00b


Joined: 13 Jul 2007
Posts: 40

PostPosted: Mon Aug 13, 2007 11:41 am    Post subject: ebuild!!!!!! Reply with quote

hi!
it would be nice to have an ebuild for this. you may then submit it for portage tree
Back to top
View user's profile Send private message
krushia
n00b
n00b


Joined: 10 May 2007
Posts: 10

PostPosted: Tue Sep 04, 2007 8:21 pm    Post subject: Warning: Breaks "make menuconfig" Reply with quote

I just ran into an issue with "make menuconfig" not formatting or accepting keycodes correctly, and realized it was because colormake screws it up. Beware :)

Just specify the full path to the "real" make if you have issues, like "/usr/bin/make menuconfig"
Back to top
View user's profile Send private message
pota
n00b
n00b


Joined: 25 Jan 2005
Posts: 22

PostPosted: Fri Oct 05, 2007 6:44 am    Post subject: Reply with quote

Also there's a problem with 'linux-info.eclass' calling make in function 'getfilevar()' like this:
Code:
make M="${S}" ${BUILD_FIXES} -s -f - 2>/dev/null

which in turn breaks kernel version string so ebuilds for kernel modules can't work anymore :)
again - just specify the full path - '/usr/bin/make M="${S}"...'
Back to top
View user's profile Send private message
krushia
n00b
n00b


Joined: 10 May 2007
Posts: 10

PostPosted: Fri Oct 12, 2007 5:48 pm    Post subject: Reply with quote

pota wrote:
Also there's a problem with 'linux-info.eclass' calling make in function 'getfilevar()' like this:
Code:
make M="${S}" ${BUILD_FIXES} -s -f - 2>/dev/null

which in turn breaks kernel version string so ebuilds for kernel modules can't work anymore :)
again - just specify the full path - '/usr/bin/make M="${S}"...'

Wow, that's nice to know. I ran into that problem as well, and thought it was a bug in the eclass. I've deleted the make->colormake link since the benefits don't seem to be worth the trouble it can cause.
Back to top
View user's profile Send private message
cubancigar11
Guru
Guru


Joined: 10 Jan 2005
Posts: 340

PostPosted: Wed Feb 13, 2008 1:29 pm    Post subject: Reply with quote

If you are still around, have a look at hmake from blender project.
Code:
https://svn.blender.org/svnroot/bf-blender/trunk/blender/source/tools/hmake/hmake
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum