Ak,
When it comes to compiling, building, etc. on the MPC8313E-RDB (or other Freescale boards) on a Linux Development system using the Freescale BSP, the key thing IMHO to remember is that what you need to do is build for the target, not the way that you usually build Linux where you are building for the same machine you are running on.
Because of that paradigm, if you go to a directory and try and run standard make, gcc, or other linux commands, they will execute in the context of building for your host machine, not as a cross compile.
So IMHO, if you want to develop kernel or user mode programs for the MPC8313E-RDB, you will need to use the Freescale Linux Target Image Builder (LTIB), let it do the work as far as setting the right environment variables, using the right compiler, etc. and not try and setup all the environment variables, cross compilers, etc. on your own. In theory it probably could be done, but using LTIB is a lot less work.
So for your case, where you wish to compile, build, etc. for the kernel, if you have edited your files correctly and make changes (assuming you've done the step of telling LTIB to build and leave the kernel sources), if you go to your LTIB main directory and type "./ltib" it will setup the proper environment variables, prep the kernel for building, compile, link, setup, etc. to the point where it creates a file call "uImage" which is the actual kernel to load on the target board.
If you want to execute individual steps, LTIB allows for step by step development by allowing command line options when you call the ./ltib script. So for example, to do a step by step build of the kernel you can do an initial setup, compile and build by executing:
alan@raptor:~/ltib-mpc8313erdb-20070824$ ./ltib -p kernel -m scbuild
To perform the "install step" (which does further setup of the kernel): you use:
alan@raptor:~/ltib-mpc8313erdb-20070824$ ./ltib -p kernel -m scinstall
To perform the "deploy step" (which also calls the install step, and does the full binary build of the kernel): you use:
alan@raptor:~/ltib-mpc8313erdb-20070824$ ./ltib -p kernel -m scdeploy
If you want to cut to the chase and just build the kernel as a complete step, but leave everything else alone, you can use:
alan@raptor:~/ltib-mpc8313erdb-20070824$ ./ltib -p kernel
There is a pretty good description of the command line options and how to use them at www.bitshrine.org which is the home page for the open source LTIB. In particular, you should download and read the instructions from the FAQ. Here is the direct link to it:
http://www.bitshrine.org/autodocs/LtibFaq.html
In particular pay attention to the steps mentioned in the "How do I make changes to a package and capture them" section which lists the step by step process of using LTIB (the kernel is treated as a single package).
In my case I have made several modifications to the Ethernet/IEEE-1588 gianfar.c code for my project and have used the above steps when I do my incremental compiles and builds for my MPC8313E-RDB kernel modifications.
Hope this helps :smileyhappy:
Cheers,
abartky