On 2021-09-25, at 17:49:27 +0200, Jan Engelhardt wrote: > On Saturday 2021-09-25 17:10, Jeremy Sowden wrote: > > List it as a built source in order to force make to create it before > > compilation. Otherwise, a parallel make can end up attempting to > > compile the output of lex before yacc has finished generating its > > own output: > > > > --- a/src/Makefile.am > > +++ b/src/Makefile.am > > @@ -6,6 +6,7 @@ endif > > > > AM_YFLAGS = -d > > > > +BUILT_SOURCES = read_config_yy.h > > MAINTAINERCLEANFILES = read_config_yy.c read_config_yy.h read_config_lex.c > > I have a strong reason to believe that you could just write > > read_config_yy.h: read_config_yy.y > > (detail https://lists.gnu.org/archive/html/automake/2021-09/msg00011.html ) Automake complains: src/Makefile.am:65: warning: user target 'read_config_yy.h' defined here ... automake: ... overrides Automake target 'read_config_yy.h' defined here From the documentation (https://www.gnu.org/software/automake/manual/automake.html#Extending): Note that Automake does not make any distinction between rules with commands and rules that only specify dependencies. So it is not possible to append new dependencies to an automake-defined target without redefining the entire rule. In this case, adding the rule you suggest to Makefile.am suppresses the rule that automake would normally generate: read_config_yy.h: read_config_yy.c @if test ! -f $@; then rm -f read_config_yy.c; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) read_config_yy.c; else :; fi J.