[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to write rule that gets all items referenced in a given makefile
From: |
Adrian Muresan |
Subject: |
Re: How to write rule that gets all items referenced in a given makefile |
Date: |
Wed, 6 Jul 2016 04:13:37 +0000 |
Yes, I am using it and yes the info it gives is very useful, parseable and
excellent in general.
The problem is that this information is only outputted by `make` AFTER the
makefile is finished executing whereas I need to access this information - via
some function that apparently doesn't exist - BEFORE the makefile rules start
executing so that I can create rules that act on his information.
As it stands, I'd have to run my build twice: once to get the info and another
time to use the info.
Given my esoteric task, it's not unreasonable for me to do this.
1. Make all
2. Parse output, generate whatever rules I need -> Generated_Rules.mk
3. Make all MAKEFILES=Generated_Rules.mk
> On Jul 5, 2016, at 11:44 PM, Tim Murphy <address@hidden> wrote:
>
> You might want to use makes -p option (--print-data-base) to print out the
> targets and prereqs that it has read. The format of this output is
> simplified - all variables etc are expanded - so in python it's very easy to
> parse.
>
> Regards,
>
> Tim