Reputation: 3997
I am using non-gnu C compiler which doesn't support dependency generation option (-MM in gcc).
In this software, they are not using makefiles. They are using some ancient windows batch files to compiler and link the code.
These batch files doesn't have incremental building. I traced the batch files and I find that at the end it execute these commands:
compiler.exe -option1 -option2 *.c linker.exe -foo -bar *.obj
compilation takes loong time, because you have to compile all the files again even if you don't have any modified files!
I am searching for a stand-alone tool which generate dependencies from C files. But I didn't find any one.
EDIT: It seems that I wasn't clear enough. I can't change the batch files to makefiles, this is something BIG. I just want minor change to support incremental building.
EDIT: The required tool is a stand-alone tool which generates dependencies from c files.
Upvotes: 0
Views: 365
Reputation: 13690
You have two dependencies in your project.
First topic can be written with a inference rule in your makefile. That allows to just enumerate the OBJ files, that will be used for linking.
The second topic is to find the header files that are included. I dont know a standalone tool. But you could try to write your own using the C preprocessor. You need to parse the output of this command:
cl -E -I<your_include_path> *.c | find "#line"
The file names surrounden in quotation marks gives the dependencies. If the file name ends with .c it's a target. Elsewhere it's a dependency.
Upvotes: 1
Reputation:
The dependency information GCC produces is actually generated by GNU make, called by the gcc driver. You can get a version of GNU make for windows from lots of places, including http://www.mingw.org/wiki/msys. You might also consider using GCC on Windows - you can get the MinGW version at http://tdragon.net/recentgcc.
Upvotes: 0
Reputation: 14059
Why not get Make (under Cygwin) and create Makefiles that use your compiler.exe as CC ?
Upvotes: 0