1. make在某些场景下仍可能失败:调整了submake-list编译依赖:当不存在kwlist_d.h时才会编译;当kwlist.h或者其他依赖编译脚本变更时才会重新编译kwlist_d.h

2. kwlist_d.h生成路径为/src/include/parser/,解决了make clean无法清空kwlist_d.h文件的bug
This commit is contained in:
wuyuechuan
2023-12-04 16:01:01 +08:00
parent 4caf252446
commit 6f3664cdef
4 changed files with 9 additions and 8 deletions

View File

@ -1125,7 +1125,12 @@ submake-pagecompression:
submake-libalarmclient:
$(MAKE) -C $(top_builddir)/src/lib/alarm
submake-kwlist:
submake-kwlist: $(top_srcdir)/src/include/parser/kwlist_d.h
submake-kwlist-clean:
rm $(top_srcdir)/src/include/parser/kwlist_d.h
$(top_srcdir)/src/include/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
.PHONY: submake-libpq submake-libpgport submake-libplpgsql submake-libalarmclient submake-pagecompression submake-kwlist

View File

@ -95,9 +95,8 @@ 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.
clean distclean maintainer-clean:
clean distclean maintainer-clean: submake-kwlist-clean
rm -f lex.backup hint_gram.cpp
rm -f kwlist_d.h
maintainer-check:

View File

@ -93,7 +93,7 @@ ecpg_kwlist_d.h: ecpg_kwlist.h $(GEN_KEYWORDLIST_DEPS)
$(GEN_KEYWORDLIST) --varname ScanECPGKeywords $<
# Force these dependencies to be known even without dependency info built:
ecpg_keywords.o c_keywords.o keywords.o preproc.o parser.o: preproc.hpp kwlist_d.h
ecpg_keywords.o c_keywords.o keywords.o preproc.o parser.o: preproc.hpp submake-kwlist
ecpg_keywords.o: ecpg_kwlist_d.h
c_keywords.o: c_kwlist_d.h
keywords.o: $(top_srcdir)/src/include/parser/kwlist.h
@ -101,9 +101,6 @@ keywords.o: $(top_srcdir)/src/include/parser/kwlist.h
kwlookup.cpp: % : $(top_srcdir)/src/common/backend/parser/%
rm -f $@ && $(LN_S) $< .
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
distprep: preproc.y preproc.cpp preproc.hpp pgc.cpp
install: all installdirs

View File

@ -57,7 +57,7 @@ removefiles:
rm -f fe-*.cpp
all:softlinks scan.o gram.o ${OBJS} all-static-lib
clean: clean-lib
clean: clean-lib submake-kwlist-clean
rm -f gram.cpp gram.hpp scan.cpp
rm -f *.o *.a
rm -f test