[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Target depending variables?
From: |
Stefano Lattarini |
Subject: |
Re: Target depending variables? |
Date: |
Mon, 02 Apr 2012 11:15:43 +0200 |
On 04/01/2012 06:52 PM, Jules Colding wrote:
> Hi,
>
> I'd like my SUBDIRS variable not to be set when, and only when,
> the target is distclean. I can't seem to find a way to do that
> in my Makefile.am. Is it possible at all?
>
If you can assume GNU make, yes:
SUBDIRS = foo bar
distclean-recursive: SUBDIRS =
If you need something that works also with non-GNU make implementations,
you could resort to the following hack (which abuses Automake internal
details):
distclean-recursive:
RECURSIVE_CLEAN_TARGETS = \
mostlyclean-recursive \
clean-recursive \
maintainer-clean-recursive
Note that there is no assurance this will continue to work with future
versions of Automake.
HTH,
Stefano