Any qmake experts out there?

Thiago Macieira thiago at macieira.org
Wed Jan 28 18:59:31 PST 2015


On Wednesday 28 January 2015 11:04:21 Linus Torvalds wrote:
> The proper way to get the git version is to just do
> 
>      # get raw SHA1
>      git rev-parse HEAD
> 
>      # get "description" of it
>      git describe --tags --abbrev=12
> 
> but actually accessing the .git/HEAD file directly is very wrong. But
> I have no idea how to do git commands in the *.pri file, and handling
> failure gracefully (in case it's not a git repository etc).

You're right, but this implies always running the rule. That implies Make must 
find that a given file is not up to date, otherwise it won't run the rule. In 
turn, it means the not-up-to--date status cascades down to the binary and Make 
will recompile and relink, even if nothing changed.

I don't know of a way to ask Make to always run some commands and inspect file 
contents before deciding what is up to date and what isn't. The closest I can 
think of is to touch or not touch another file, but in a parallel build Make 
may have already inspected that file and decided it was up-to-date.

Do you know of any tricks I'm missing?
-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358



More information about the subsurface mailing list