nightsparc
nightsparc

Reputation: 140

QMAKE make install - how to disable 'all' target dependency?

for some reasons, we're using QMAKE for managing our C++ dev projects.

Ok, not really my favourite cross-build system, but I've to live with it...ahh, my question.

When you create QMAKE projects with INSTALL target where you, the resulting Makefile does always contain a make installinstall target which looks alike:

install: install_target  FORCE
...
install_target: all FORCE
...

where the all target is basically the build all target...

So, as I see it. Qmake does always recheck the targets whether there are changes and rebuilt the respective targets if there are any. In some of our projects with heavy linking, this costs a lot of time.

Is there a way to prevent this behavior? I've just no idea :/

Thanks!

Upvotes: 1

Views: 568

Answers (1)

Top-Master
Top-Master

Reputation: 8735

In my case, the Makefile has a list of dependencies for each object (*.obj file), like related C or C++ file, and even all included headers.

Hence my make executable only rebuilds an object if any dependency's modify-date is newer than that of the related object itself.

You could create a VSCode extension, that adds "Save as Old" feature/option to File menu (Ctrl+Alt+S), which sets file's modify-date to 2000-1-1 (without showing the Save-as dialog), finally, use that feature whenever you decide that the change should not need a rebuild.

WARNING: I previously did something similar, for headers only, and even then often my decesion to skip the partial one hour build was wrong, causing me to wonder "what's wrong?", and would end up doing a complete 5 hour rebuild ;-)

Note that my project has/had around 3 GB source-code, and on a Core i5 CPU would take 5 hours to build, however, even then I decided to never use "Save as Old" unless I only change doc-comments, I mean, if you have less source-code don't bother creating/using such extension.

Upvotes: 0

Related Questions