In my configure.ac file, I have this:
AC_CONFIG_FILES([Makefile foo/bar.h],
[mkdir -p ../dir1 && cp foo/bar.h ../dir1]
)
The goal is to:
While it works, I'm pretty sure I've done that last part wrong. Looking at the generated output, I see:
case $ac_file$ac_mode in
"Makefile":F) mkdir -p ../dir1 && cp foo/bar.h ../dir1
;;
"foo/bar.h":F) mkdir -p ../dir1 && cp foo/bar.h ../dir1
;;
esac
So it looks like it is doing my 'mkdir' command once for each file in the file list which is a bit redundant. The fact that it does this in a 'case' statement suggests there is some way to specify commands to run specific to each file (otherwise why have a 'case'?).
What's the trick?
So it turns out I was misinterpreting what I was seeing.
Seeing that 'case' statement made me think there was some way to specify that some of the cmds
applied to specific entries from the files
parameter (something like [makefile:stuff1 foo/bar.h:stuff2]). But (thankfully) that's not why the 'case' is there.
The trick here is that at the point where the case statement is produced, we aren't just walking the entries from AC_CONFIG_FILES files
. So in order to limit the cmds
to the just AC_CONFIG_FILES entries, it uses a 'case.'
While my early attempts suggested that using two AC_CONFIG_FILES was not supported, that was wrong too.
My solution was to use 2 AC_CONFIG_FILES.