Skip to content

Commit 142c400

Browse files
committed
Fix make rules for jsonpath grammar making them similar to SQL grammar
Reported-by: Jeff Janes, Tom Lane Discussion: https://postgr.es/m/CAMkU%3D1w1qBvoW82ZTFpAKae027R-2OHw-m6ALe0VQRNAFueBVA%40mail.gmail.com
1 parent b8f9a2a commit 142c400

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

src/backend/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,10 @@ maintainer-clean: distclean
315315
replication/syncrep_scanner.c \
316316
storage/lmgr/lwlocknames.c \
317317
storage/lmgr/lwlocknames.h \
318-
utils/misc/guc-file.c \
318+
utils/adt/jsonpath_gram.c \
319319
utils/adt/jsonpath_gram.h \
320+
utils/adt/jsonpath_scan.c \
321+
utils/misc/guc-file.c \
320322
utils/sort/qsort_tuple.c
321323

322324

src/backend/utils/adt/Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,19 @@ OBJS = acl.o amutils.o arrayfuncs.o array_expanded.o array_selfuncs.o \
3333
txid.o uuid.o varbit.o varchar.o varlena.o version.o \
3434
windowfuncs.o xid.o xml.o
3535

36+
# There is no correct way to write a rule that generates two files.
37+
# See comment in src/backend/parser/Makefile for the explanation of
38+
# the trick used here.
39+
40+
jsonpath_gram.h: jsonpath_gram.c
41+
touch $@
42+
3643
jsonpath_gram.c: BISONFLAGS += -d
3744

3845
jsonpath_scan.c: FLEXFLAGS = -CF -p -p
46+
jsonpath_scan.c: FLEX_NO_BACKUP=yes
47+
jsonpath_scan.c: FLEX_FIX_WARNING=yes
3948

40-
jsonpath_gram.h: jsonpath_gram.c ;
4149

4250
# Force these dependencies to be known even without dependency info built:
4351
jsonpath_gram.o jsonpath_scan.o jsonpath_parser.o: jsonpath_gram.h

src/include/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ install: all installdirs
5454
cp $(srcdir)/$$dir/*.h '$(DESTDIR)$(includedir_server)'/$$dir/ || exit; \
5555
done
5656
ifeq ($(vpath_build),yes)
57-
for file in catalog/schemapg.h catalog/pg_*_d.h parser/gram.h storage/lwlocknames.h utils/probes.h; do \
57+
for file in catalog/schemapg.h catalog/pg_*_d.h parser/gram.h storage/lwlocknames.h utils/probes.h utils/jsonpath_gram.h; do \
5858
cp $$file '$(DESTDIR)$(includedir_server)'/$$file || exit; \
5959
done
6060
endif
@@ -78,7 +78,7 @@ uninstall:
7878

7979
clean:
8080
rm -f utils/fmgroids.h utils/fmgrprotos.h utils/errcodes.h utils/header-stamp
81-
rm -f parser/gram.h storage/lwlocknames.h utils/probes.h
81+
rm -f parser/gram.h storage/lwlocknames.h utils/probes.h utils/jsonpath_gram.h
8282
rm -f catalog/schemapg.h catalog/pg_*_d.h catalog/header-stamp
8383

8484
distclean maintainer-clean: clean

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy