My project uses a static library from an external supplier, libext.a.
The library is kept in a central location shared among all the project developers, central/, and with each updated release of the library, the new file with a suffix of the current version is added: central/libext.a.1, central/libext.a.2, central/libext.a.3, …
The project’s Subversion repository contains a symbolic link, libext.a, that points to the latest version of the library in central. Whenever a new version is added, the link is changed and committed to the repository.
The problem is that when recompiling the project after the link was changed and the working copy updated, make looks at the modification time of the link’s target, and not at the modification time of the link itself (libext.a). So the library used in effect in the compiled project is still the old version.
I am aware of the -L/--check-symlink-times flag available in GNU Make since version 3.81, which makes make look at the modification times of both the link’s target and the link itself, but my project uses version 3.80, and upgrading would be very difficult as compilation has to be supported on many different machines, of some of which I have no control.
What is the most simple way to emulate the behavior of this new flag in my older version of make?
I prefer something that can be local to a specific Makefile and implemented within it, not a script that has to be run before running make or a command line option that has to be specified with it, although it is not completely unacceptable.
The best solution I’ve come up with so far is to add
libext.a.timestampas a requirement in the Makefile that requireslibext.a, and add it as a prerequisite to the rule that haslibext.aas a prerequisite.Also, I added a rule:
Now I need to find a way to touch the timestamp whenever the link is updated. Unfortunately, I didn’t find a way to do this yet (there is no post-updated hook in SVN)…