Allow initialization functions in .y files

If you add an initialization function to a .y file, it will not show
up in init.c, because if the yacc output is in the build tree, it
won't be found.

This patch changes the Makefile to be more robust in this situation.
This commit is contained in:
Tom Tromey 2024-04-10 14:54:17 -06:00
parent 6bc4d69d3d
commit d1587e198f

View File

@ -2177,7 +2177,9 @@ INIT_FILES = \
init.c: stamp-init; @true
stamp-init: $(INIT_FILES) config.status $(srcdir)/make-init-c
$(ECHO_INIT_C)
$(SILENCE) $(srcdir)/make-init-c $(addprefix $(srcdir)/,$(INIT_FILES)) > init.c-tmp
$(SILENCE) $(srcdir)/make-init-c \
$(filter-out config.status $(srcdir)/make-init-c,$^) \
> init.c-tmp
$(SILENCE) $(SHELL) $(srcdir)/../move-if-change init.c-tmp init.c
$(SILENCE) echo stamp > stamp-init