Best practice for extracting information from a makefile

Garry Williams gtwilliams at gmail.com
Tue Aug 16 13:24:38 UTC 2011


On Tue, Aug 16, 2011 at 9:18 AM, Richard Shaw <hobbes1069 at gmail.com> wrote:
> I'm working on a small library that uses a very simple makefile (no
> autoconf, etc.) and it sets the library name and soname within the
> makefile.
>
> Instead of hard coding it in the spec file I would like to extract the
> library name and soname from the makefile.
>
> I tried "grep soname Makefile | awk..." type approach which works for
> the soname but the library name is generated from the soname with a
> variable and I haven't found a way to get an "evaluated" version of
> the makefile.

How about make -n some-target, where some-target emits on stdout what you need?

-- 
Garry Williams


More information about the devel mailing list