automake
[Top][All Lists]
Advanced

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

Re: Getting long SOURCES lines with subdirs shorter


From: Václav Haisman
Subject: Re: Getting long SOURCES lines with subdirs shorter
Date: Mon, 17 Jul 2023 18:27:52 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

On 17. 07. 23 0:55, Jan Engelhardt wrote:
Given

        a_SOURCES = aprog/main.c aprog/foo.c aprog/bar.c aprog/baz.c ...

The more source files there are to be listed, the longer that line gets,
the bigger the Makefile.am fragment becomes, etc. I am thinking about
how to cut that repetition down. Current automake likely won't have
anything in store already, so I'm thinking of editing automake and
targeting a future automake release.

The syntax would need to be understood by automake and expanded at the
right time; Makefile.in should have the expanded list already. How
about recognizing the gmake function syntax?

a_SOURCES = $(addprefix aprog/,main.c foo.c bar.c baz.c)


You can use the %D% placeholder for the directory of the Makefile.am relative to the source directory. I can't find where I found out about it but it works. E.g., https://github.com/log4cplus/log4cplus/blob/master/src/Makefile.am. You can also generate the Makefile.am from a template using AutoGen to make things even easier.

--
VH




reply via email to

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