1
votes

Is there any way to use the list of programs to build from a Makefile.am and put it in a bash script (autotools substitution, variables, ...)?

Something like below :

Example

Makefile.am

bin_PROGRAMS = prog1 prog2 prog3
[...]

script.sh

#!/bin/bash
EXEC=@bin_PROGRAMS@ # something like this

The goal is to give this script the list of programs being built

1

1 Answers

2
votes

No, because substitution happens at configure time, while the Makefile stuff happens at make time.

However, you can ensure that both lists are defined at configure time:

configure.ac

AC_SUBST([PROGRAMS], [prog1 prog2 prog3])

Makefile.am

bin_PROGRAMS = @PROGRAMS@

script.sh

EXEC=@PROGRAMS@