]> granicus.if.org Git - postgresql/commitdiff
Fix make rules for jsonpath grammar making them similar to SQL grammar
authorAlexander Korotkov <akorotkov@postgresql.org>
Sun, 17 Mar 2019 07:51:28 +0000 (10:51 +0300)
committerAlexander Korotkov <akorotkov@postgresql.org>
Sun, 17 Mar 2019 07:55:52 +0000 (10:55 +0300)
Reported-by: Jeff Janes, Tom Lane
Discussion: https://postgr.es/m/CAMkU%3D1w1qBvoW82ZTFpAKae027R-2OHw-m6ALe0VQRNAFueBVA%40mail.gmail.com

src/backend/Makefile
src/backend/utils/adt/Makefile
src/include/Makefile

index 31d9d6605d96b2a44382210991fd8f12c9461da2..ecbfa875af15e681d5772f1c2ef9d8f57b928072 100644 (file)
@@ -315,8 +315,10 @@ maintainer-clean: distclean
              replication/syncrep_scanner.c \
              storage/lmgr/lwlocknames.c \
              storage/lmgr/lwlocknames.h \
-             utils/misc/guc-file.c \
+             utils/adt/jsonpath_gram.c \
              utils/adt/jsonpath_gram.h \
+             utils/adt/jsonpath_scan.c \
+             utils/misc/guc-file.c \
              utils/sort/qsort_tuple.c
 
 
index 6b24a9caa14cba7b5211549b6e28211dfba9b4a0..60925f4e28f224dded2810a0f2562507dbeba7ae 100644 (file)
@@ -33,11 +33,19 @@ OBJS = acl.o amutils.o arrayfuncs.o array_expanded.o array_selfuncs.o \
        txid.o uuid.o varbit.o varchar.o varlena.o version.o \
        windowfuncs.o xid.o xml.o
 
+# There is no correct way to write a rule that generates two files.
+# See comment in src/backend/parser/Makefile for the explanation of
+# the trick used here.
+
+jsonpath_gram.h: jsonpath_gram.c
+       touch $@
+
 jsonpath_gram.c: BISONFLAGS += -d
 
 jsonpath_scan.c: FLEXFLAGS = -CF -p -p
+jsonpath_scan.c: FLEX_NO_BACKUP=yes
+jsonpath_scan.c: FLEX_FIX_WARNING=yes
 
-jsonpath_gram.h: jsonpath_gram.c ;
 
 # Force these dependencies to be known even without dependency info built:
 jsonpath_gram.o jsonpath_scan.o jsonpath_parser.o: jsonpath_gram.h
index c557375ae310f3dbfa3b8d6aa488890399a071c4..652f6dc6cc38e2c38590da6388730484dc040490 100644 (file)
@@ -54,7 +54,7 @@ install: all installdirs
          cp $(srcdir)/$$dir/*.h '$(DESTDIR)$(includedir_server)'/$$dir/ || exit; \
        done
 ifeq ($(vpath_build),yes)
-       for file in catalog/schemapg.h catalog/pg_*_d.h parser/gram.h storage/lwlocknames.h utils/probes.h; do \
+       for file in catalog/schemapg.h catalog/pg_*_d.h parser/gram.h storage/lwlocknames.h utils/probes.h utils/jsonpath_gram.h; do \
          cp $$file '$(DESTDIR)$(includedir_server)'/$$file || exit; \
        done
 endif
@@ -78,7 +78,7 @@ uninstall:
 
 clean:
        rm -f utils/fmgroids.h utils/fmgrprotos.h utils/errcodes.h utils/header-stamp
-       rm -f parser/gram.h storage/lwlocknames.h utils/probes.h
+       rm -f parser/gram.h storage/lwlocknames.h utils/probes.h utils/jsonpath_gram.h
        rm -f catalog/schemapg.h catalog/pg_*_d.h catalog/header-stamp
 
 distclean maintainer-clean: clean