|
![](/i/fill.gif) |
On 27/05/2016 04:36 PM, Le_Forgeron wrote:
> Actually you can ask gcc/g++ to output the dependencies on sources files. Then you
can have them read back by "make".
Yes, this is the main thing I did.
Originally, the Makefile had one entry for every source file in the
entire project, some (but not all) listing the header files they depend
on. (Hey, at least the exact compilation command was a variable!)
I replaced that with a rule that says how to build any object file from
a source file. That crunched the file size down to a fraction of its
former self. I also made G++ spit out dependency information that then
gets included back into the Makefile. Our CI server probably won't care,
but it'll help the next poor sod who tries to build it by hand.
Finally, I wrote some crazy Make macro [yes, Make has macros] that
generates a list of all the object files in a folder. Before they exist.
So that I can depend on them.
...and then I did it all over again, since apparently SO files have to
be built with -fPIC, whatever that does...
Post a reply to this message
|
![](/i/fill.gif) |