Hi All,

I am using microsoft nmake tool version 6.00 for my project. when I make changes in any of the .h files, the C files which includes the header file is not getting compiled automatically. Can anyone give some suggestions please?

Thanks in advance!!

-Karuppiah

I didn't think nmake did automatic detection of dependencies which means you will have to edit your make file(s) and manual type in you dependencies.

Thanks!! Can you pls let me know how to do automatic detection of dependencies. I mean I have a C file. This has many header files included to it. When the header file is changed the C file should be compiled automatically.
Though in the dependency we dont have the list of header files included in the C file.

You just need to add a line to your make file that looks something like

<CFileName>.c : <HeaderFile1>.h <HeaderFile2>.h <HeaderFileN>.h

For all your C files.

Thats direct way of doing it. But I have hundreds of C file with multiple header files included in it. Also it is not possible to update make file every time when a header file is added or removed from C file.

Look I know that GNU gcc can produce dependencies and I know that some third party make engines can produce dependencies but as I said I do not believe Microsofts nmake can produce dependencies, in fact as a make engine it is somewhat feature poor.

You keep saying that you want automatic creation of dependencies but I answered that with my first post, nmake does not do that and I am not aware of any tool in the Microsoft tool chain that does except using their IDE which if you are using nmake you are clearly no doing.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.