to see how to do this, search in Makefile.core.am & Makefile.core.def for "hello" module.
Step 2. Install m4-1.4.6
$ wget ftp://ftp.gnu.org/gnu/m4/m4-1.4.6.tar.gz
$ tar -zxvf m4-1.4.6.tar.gz
$ ./configure
$ ./make
$ ./make install
Step 3. Install package
$ apt-get install autoconf automaker1.11 autogen
Step 4. Run autogen.sh
$ cd ./grub-2.00
$ ./autogen
$ cd ./grub-2.00
$ ./configure --prefix=/home/gary/gy-grub/grub-2.00/XXX
$ ./make $ ./make install
note:
$ update-grub