Http://www.ibm.com/developerworks/cn/linux/l-makefile/
Generate the ins and outs of makefile
First, go to the project directory, run a series of commands in the directory, and create and modify several files to generate makefile files that match the platform. The procedure is as follows:
1) run the autoscan command
2) Rename Configure. Scan to configure. In and modify the configure. In file.
3) create a makefile. Am file in the project directory, and create a makefile. Am file in the core and shell directories.
4) create news, README, changelog, and authors files in the project directory
5) copy the depcomp and complie files under the/usr/share/automake-1.X/directory to the local directory
6) run the aclocal command
7) run the Autoconf command
8) run the automake-a command.
9) run the./confiugre script.
You can see in Figure 2 the process of generating makefile ,:
Figure 2 generate makefile Flowchart