views:

35

answers:

1

I have a C++ project, I am using Bakefile for build process, Makefiles are generated for msvc, mingw, gnu etc for cross-platform support.

Now the problem is that if I change any .h files (which are included in other .cpp files) and performing a rebuild does not recompile modified files. But changing any .cpp file gets recompiled.

Based on modified time-stamp of any file which is included in the project I expect to consider that file for rebuild.

Am I missing something which required to be added as a tag in .bkl files? Please help.

A: 

Bakefile itself only handles dependencies between targets. Dependencies between source files and headers are too frequently changing to be written down in makefiles. This kind of dependencies is handled by the compiler and make, who have to cooperate.

GCC and GNU make support this just fine (and Bakefile's gnu or autoconf formats generate makefiles with proper deps tracking). I'm guessing that your complain is about nmake (Bakefile's msvc format) in particular, right?

You're out of luck here, I'm afraid -- nmake is too limited and doesn't support dynamic dependencies. I recommend to generate and use project files instead, both the IDE and vcbuild do track dependencies.

vslavik
Thank you 'vslavik' for the answer. I have to check GCC make on my Ubuntu (hope it works), but mingw make also does not rebuild modified files.As you suggested creation of project files only looks like option with MSVC.
harik
MinGW makefiles generated by Bakefile do track dependencies correctly -- see the *.d files created during build. So if you're having problems, they may be elsewhere, like in wrong system clock. (As the primary author of Bakefile, I'm very sure about this; if you believe `mingw` format is broken, I would very much appreciate a bug report over at http://www.bakefile.org/newticket)
vslavik