Tool for make file

Hi, so far i am writting make file explicitly, is there is any tool is there to write make file automatically....if so please tell me about that...
Thanks in advance
Sarwan

you could use the command gcc -m sourcefile.c to obtain the file on which depends sourcefile.c

GNU autotools.
however, i'd suggest learning how to write a Makefile rather than using autotools at the first stage.

The first program like this that I ever saw was mkmf which was added to early versions of BSD. HP-UX picked it up and still has it: mkmf man page.

The X consortium extended mkmf a bit and called it xmkmf. xmkmf will invoke a program called imake. And it is common for the generated makefiles to have a rule to invoke makedepend. Man pages: xmkmf, imake, makedepend.

sorry i am not able to get you, if i have 5 files, among them 1 file will have main(),so if i used gcc -m with the main function file ,i can able to know the dependency ...is that u r coming to say right....plz give me one small example...i never used -m flag now i will experiment with that.....thanks 4 u r reply, and i m expecting u r reply again.
Thanks in advance
sarwan