From 15c5c7b41fe7198c03bc32e5968a652d336f76bc Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Thu, 22 Nov 2018 01:00:57 +0000 Subject: [PATCH] Makefile.am: build autogenerates files before other targets (they may create headers). Note: I used $(@:cc=*) construct as bmake doesn't understand $*.* . --- re2c/Makefile.am | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/re2c/Makefile.am b/re2c/Makefile.am index 1857a924..4e4eb479 100644 --- a/re2c/Makefile.am +++ b/re2c/Makefile.am @@ -156,14 +156,17 @@ AUTOGEN_VERTOVERNUM = src/conf/ver_to_vernum.cc AUTOGEN_PARSER = src/ast/parser.cc AUTOGEN_PARSER_HDR = src/ast/y.tab.h AUTOGEN_HELP = src/conf/help.cc -AUTOGEN = \ +AUTOGEN_SRC = \ $(AUTOGEN_LEX) \ $(AUTOGEN_PARSER) \ - $(AUTOGEN_PARSER_HDR) \ $(AUTOGEN_VERTOVERNUM) \ $(AUTOGEN_HELP) \ src/ast/lex_conf.cc \ src/conf/parse_opts.cc +AUTOGEN_HDR = \ + src/ast/lex.h \ + $(AUTOGEN_PARSER_HDR) +AUTOGEN = $(AUTOGEN_SRC) $(AUTOGEN_HDR) nodist_re2c_SOURCES = $(AUTOGEN) # bootstrap sources @@ -177,6 +180,7 @@ BOOTSTRAP = \ $(BOOTSTRAP_PARSER) \ $(BOOTSTRAP_PARSER_HDR) \ bootstrap/src/ast/lex.cc \ + bootstrap/src/ast/lex.h \ bootstrap/src/ast/lex_conf.cc \ bootstrap/src/conf/parse_opts.cc \ bootstrap/src/conf/ver_to_vernum.cc @@ -262,12 +266,13 @@ $(BOOTSTRAP_PARSER): $(CUSTOM_PARSER) $(AM_V_GEN) if test -x $(RE2C); \ then \ $(top_builddir)/$(RE2C) $(RE2CFLAGS) -o $@ $< && \ - cp $@ $(top_srcdir)/bootstrap/$@; \ + cp $(@:cc=*) $(top_srcdir)/bootstrap/$(@D); \ else \ - cp $(top_srcdir)/bootstrap/$@ $@; \ - cp $(top_srcdir)/bootstrap/$*.h $*.h; \ + cp $(top_srcdir)/bootstrap/$(@:cc=*) $(@D); \ fi +all: $(AUTOGEN_SRC) + # rebuild all re2c sources using newly built re2c .PHONY: bootstrap bootstrap: all -- 2.40.0