diff --git a/src/Makefile.global.in b/src/Makefile.global.in index 0c8f2f919..849cb84b6 100644 --- a/src/Makefile.global.in +++ b/src/Makefile.global.in @@ -924,6 +924,11 @@ ETCD_BIN_PATH = $(ETCD_HOME)/bin LIBNANOMSG_INCLUDE_PATH = $(LIBNANOMSG_HOME)/include LIBNANOMSG_LIB_PATH = $(LIBNANOMSG_HOME)/lib + +TOOLSDIR = $(top_srcdir)/src/tools +GEN_KEYWORDLIST = $(PERL) -I $(TOOLSDIR) $(TOOLSDIR)/gen_keywordlist.pl +GEN_KEYWORDLIST_DEPS = $(TOOLSDIR)/gen_keywordlist.pl $(TOOLSDIR)/PerfectHash.pm + ############################################################################# # curl component ############################################################################# @@ -1120,7 +1125,10 @@ submake-pagecompression: submake-libalarmclient: $(MAKE) -C $(top_builddir)/src/lib/alarm -.PHONY: submake-libpq submake-libpgport submake-libplpgsql submake-libalarmclient submake-pagecompression +submake-kwlist: + $(GEN_KEYWORDLIST) --extern -o $(top_srcdir)/src/include/parser $(top_srcdir)/src/include/parser/kwlist.h + +.PHONY: submake-libpq submake-libpgport submake-libplpgsql submake-libalarmclient submake-pagecompression submake-kwlist ########################################################################## diff --git a/src/bin/pg_dump/Makefile b/src/bin/pg_dump/Makefile index 55755bcb4..5a9ca9472 100644 --- a/src/bin/pg_dump/Makefile +++ b/src/bin/pg_dump/Makefile @@ -67,6 +67,8 @@ COMMON_OBJS = $(top_builddir)/src/lib/elog/elog.a EXTRA_OBJS = $(top_builddir)/src/gausskernel/cbb/utils/aes/aes.o KEYWRDOBJS = keywords.o kwlookup.o +keywords.o: submake-kwlist + kwlookup.cpp: % : $(top_srcdir)/src/common/backend/parser/% rm -f $@ && $(LN_S) $< . diff --git a/src/common/backend/parser/Makefile b/src/common/backend/parser/Makefile index afe66b9b7..f433ee23b 100644 --- a/src/common/backend/parser/Makefile +++ b/src/common/backend/parser/Makefile @@ -83,17 +83,6 @@ else sed -i 's/YY_NULL nullptr/YY_NULL 0/g' hint_gram.cpp endif -# where to find gen_keywordlist.pl and subsidiary files -TOOLSDIR = $(top_srcdir)/src/tools -GEN_KEYWORDLIST = $(PERL) -I $(TOOLSDIR) $(TOOLSDIR)/gen_keywordlist.pl -GEN_KEYWORDLIST_DEPS = $(TOOLSDIR)/gen_keywordlist.pl $(TOOLSDIR)/PerfectHash.pm - -distprep: kwlist_d.h - -# generate SQL keyword lookup table to be included into keywords*.o. -kwlist_d.h: $(top_srcdir)/src/include/parser/kwlist.h $(GEN_KEYWORDLIST_DEPS) - $(GEN_KEYWORDLIST) --extern -o $(top_srcdir)/src/include/parser $(top_srcdir)/src/include/parser/kwlist.h - hint_scan.inc: hint_scan.l | scan.inc ifdef FLEX $(FLEX) $(FLEXFLAGS) -o'$@' $< @@ -102,7 +91,7 @@ else @$(missing) flex $< $@ endif -hint_gram.o keywords.o parser.o: hint_gram.hpp kwlist_d.h +hint_gram.o keywords.o parser.o: hint_gram.hpp submake-kwlist # gram.cpp, gram.hpp, and scan.inc are in the distribution tarball, so they # are not cleaned here. diff --git a/src/common/interfaces/libpq/frontend_parser/Makefile b/src/common/interfaces/libpq/frontend_parser/Makefile index b5460859f..c78a7e65d 100644 --- a/src/common/interfaces/libpq/frontend_parser/Makefile +++ b/src/common/interfaces/libpq/frontend_parser/Makefile @@ -13,11 +13,6 @@ subdir = src/common/interfaces/libpq/frontend_parser top_builddir = ../../../../../ backenddir = $(top_builddir)/src/common/backend -# where to find gen_keywordlist.pl and subsidiary files -TOOLSDIR = $(top_srcdir)/src/tools -GEN_KEYWORDLIST = $(PERL) -I $(TOOLSDIR) $(TOOLSDIR)/gen_keywordlist.pl -GEN_KEYWORDLIST_DEPS = $(TOOLSDIR)/gen_keywordlist.pl $(TOOLSDIR)/PerfectHash.pm - # shared library parameters NAME= parser_frontend @@ -34,7 +29,7 @@ include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.shlib parser.o gram.o: scan.cpp gram.hpp: gram.cpp -gram.o kwlookup.o parser.o: gram.hpp kwlist_d.h +gram.o kwlookup.o parser.o: gram.hpp submake-kwlist scan.o: gram.hpp scan.cpp #gram.cpp: build-parser @@ -42,9 +37,6 @@ gram.cpp: gram.y /usr/bin/bison -d -o gram.cpp gram.y -t # $(MAKE) -f Makefile.parser -kwlist_d.h: $(top_srcdir)/src/include/parser/kwlist.h $(GEN_KEYWORDLIST_DEPS) - $(GEN_KEYWORDLIST) --extern -o $(top_srcdir)/src/include/parser $(top_srcdir)/src/include/parser/kwlist.h - scan.cpp: scan.l /usr/bin/flex -CF -b -p -o'scan.cpp' scan.l