0

I found the following line in an automake script

brickval_SOURCES = \
    $(brickval_VALASOURCES:.vala=.c) \
    $(brickval_VALASOURCES:.vala=.h)

the whole thing is here

I actually have a very good guess as to what it does, expand brickval_VALASOURCES then replace .vala with .c, but because of previous experiences I'd like to actually read what exactly this does in some kind of manual. I've looked in the autoconf, automake, and shell manuals and I've found nothing. I also tried google searches but it's hard to think of a good search term.

user615457
  • 817
  • 1
  • 7
  • 13

3 Answers3

1

Try the manual for GNU make or some other make manual. The automake program just adds functionality to whatever make happens to be installed on the build machine.

ldav1s
  • 15,885
  • 2
  • 53
  • 56
1

This this a feature available in any POSIX-compliant make implementation, and supported by Automake. You can read about it in the POSIX specs (search subst1).

adl
  • 15,627
  • 6
  • 51
  • 65
  • I disagree about this being supported by Automake. Automake looks at brickval_SOURCES to generate the list of files to include in the distribution. If these files are not included, they ought to be listed as nodist_brickval_SOURCES and mentioned in BUILT_SOURCES. If they are distributed, *maybe* it is okay to describe brickval_SOURCES this way, but it certainly smells funny. I think best practice would be to explicitly list the files. – William Pursell May 12 '12 at 12:06
  • +1 for mentioning POSIX-compliance, and because autotool'd questions don't seem to get many votes. Some tags seem to get +20 upvotes for the lamest answers! – William Pursell May 12 '12 at 12:08
  • @William: It is supported in the sense that (1) Automake understand this syntax and (2) il will therefore distribute the `*.c` and `*.h` files corresponding to `*.vala` files listed in `brickval_VALASOURCES`, and compile them with the right compiler. This is an actual feature of Automake, backed with many test cases, and that was not that easy to implement, it does not work by luck. This syntax is actually useful in many cases where you do not want to list several sets of files that differ only by their extension. – adl May 15 '12 at 19:04
0

see section 6.3.1 in the GNU Make Manual called Substitution References for a full description about the functionality.

ThePosey
  • 2,734
  • 2
  • 19
  • 20