help-make
[Top][All Lists]
Advanced

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

Re: Evaluation of variables inside make rules' dependencies


From: Philip Guenther
Subject: Re: Evaluation of variables inside make rules' dependencies
Date: Wed, 9 Mar 2011 20:26:22 -0800

On 3/9/11, Dmitry N. Mikushin <address@hidden> wrote:
> Ok, but could you recommend an approach for packing multiple libraries with
> a single rule, that supports varying sources list and flags? Or is this
> method not of your taste in general?

In the systems that I've hacked on, the rule has been "directories and
libraries are cheap: separate sources (and objects) into a directory
per library or program".  Cross-directory references are best done via
-I and -L and never via ../whatever references.

With that, CFLAGS assignments and similar can be done on a per
directory basis, whether via a Makefile per directory (where a
recursive make setup is used for whatever reason) or via a
${OBJDIR}/%.o: ${SRCDIR}/%.c rule for each OBJDIR:SRCDIR pair.


Philip Guenther



reply via email to

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