help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: vpath problem when making static libraries


From: Paul Smith
Subject: Re: vpath problem when making static libraries
Date: Sat, 24 Sep 2016 09:32:44 -0400

On Sat, 2016-09-24 at 10:31 +1000, Karl May wrote:
> I wanna make two different static libraries from the same FORTRAN source 
> files, 
> one with OMP support, one without. Thus %.o file generated during compilation 
> will differ and must be keept for updating both the libraries when one files 
> has changed (to avoid making MAKE recompiling everything). Since the naming 
> of 
> the %.o files is the same they will be kept in two different directories.

VPATH is intended only for locating remote _source_ files.  It cannot be
used to find object files.

More detailed discussion of this issue can be found here:
http://make.mad-scientist.net/papers/how-not-to-use-vpath/

The fact that you had to write your rules such that they violate Paul's
Second Rule of Makefiles should be a hint that you're in the weeds :)
http://make.mad-scientist.net/papers/rules-of-makefiles/#rule2

If you want to create two different sets of object files you need to
write two different pattern rules with different directories.  Since
your makefile is not complete (you didn't show what operations you
wanted for the OMP version, nor how you are going to decide which
version to build) it's hard to give an example.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]