Want to compile a firmware now? Follow these instructions:

Install git

There is a nice git installer. Download it from here, and run the installer.

Get NXT Improved Firmware sources

Now that git is installed, it is easy to get the sources.

By accessing NXT Improved Firmware, you accept the license.

Now open a terminal and type:

cd $HOME/Documents
git clone http://git.ni.fr.eu.org/nxt-firmware.git/

That's it! You can now browse source code.

Install GNU Make

You can skip this section if you have it yet. For example, if you have Xcode installed, you can skip this section.

If you do not know, open a terminal and type:

make --version

Skip this section if it returns something like (details may vary):

GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin10.0

Do not skip this section if you get something like:

bash: make: command not found

To install GNU Make from this web site, open a terminal and type:

cd $HOME
curl -O http://nxt-firmware.ni.fr.eu.org/files/macosx/make.tar.gz
cd /usr/local
sudo tar -xzof $HOME/make.tar.gz
sudo ./make/install_path.sh
cd $HOME
rm make.tar.gz

Install CodeSourcery prebuilt toolchain

CodeSourcery does not provide prebuilt toolchain for MAC OS X. I used James Snyder's Toolchain Builder to build one that you can install.

Open a terminal and type:

cd $HOME
curl -O http://nxt-firmware.ni.fr.eu.org/files/macosx/arm-eabi-toolchain.tar.gz
cd /usr/local
sudo tar -xzof $HOME/arm-eabi-toolchain.tar.gz
sudo ./arm-eabi-toolchain/install_path.sh
cd $HOME
rm arm-eabi-toolchain.tar.gz

Build NXT Improved Firmware

If you followed previous instructions, everything should be ready to compile the firmware. If you just installed the toolchain, open a fresh terminal and type:

cd $HOME/Documents/nxt-firmware/AT91SAM7S256/SAM7S256/gcc
make

Check that no error is displayed, then copy the generated firmware so you can find it easily:

cp nxt_firmware.bin $HOME/Desktop/nxt_firmware.rfw

You can then use your favorite firmware update tool to send it to your NXT.