1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-28 18:48:04 +03:00

Move psql's psqlscan.l into src/fe_utils.

This completes (at least for now) the project of getting rid of ad-hoc
linkages among the src/bin/ subdirectories.  Everything they share is now
in src/fe_utils/ and is included from a static library at link time.

A side benefit is that we can restore the FLEX_NO_BACKUP check for
psqlscanslash.l.  We might need to think of another way to do that check
if we ever need to build two lexers with that property in the same source
directory, but there's no foreseeable reason to need that.
This commit is contained in:
Tom Lane
2016-03-24 20:28:47 -04:00
parent d65bea26a8
commit c1156411ad
20 changed files with 120 additions and 90 deletions

1
src/fe_utils/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/psqlscan.c

View File

@@ -1,11 +1,13 @@
#-------------------------------------------------------------------------
#
# Makefile
# Makefile for src/fe_utils
# Makefile for src/fe_utils
#
# This makefile generates a static library, libpgfeutils.a,
# for use by client applications
#
# Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
# IDENTIFICATION
# src/fe_utils/Makefile
#
@@ -17,7 +19,7 @@ include $(top_builddir)/src/Makefile.global
override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS)
OBJS = mbprint.o print.o simple_list.o string_utils.o
OBJS = mbprint.o print.o psqlscan.o simple_list.o string_utils.o
all: libpgfeutils.a
@@ -25,6 +27,16 @@ libpgfeutils.a: $(OBJS)
rm -f $@
$(AR) $(AROPT) $@ $^
psqlscan.c: FLEXFLAGS = -Cfe -p -p
psqlscan.c: FLEX_NO_BACKUP=yes
# Latest flex causes warnings in this file.
ifeq ($(GCC),yes)
psqlscan.o: CFLAGS += -Wno-error
endif
distprep: psqlscan.c
# libpgfeutils could be useful to contrib, so install it
install: all installdirs
$(INSTALL_STLIB) libpgfeutils.a '$(DESTDIR)$(libdir)/libpgfeutils.a'
@@ -35,5 +47,10 @@ installdirs:
uninstall:
rm -f '$(DESTDIR)$(libdir)/libpgfeutils.a'
clean distclean maintainer-clean:
rm -f libpgfeutils.a $(OBJS)
clean distclean:
rm -f libpgfeutils.a $(OBJS) lex.backup
# psqlscan.c is supposed to be in the distribution tarball,
# so do not clean it in the clean/distclean rules
maintainer-clean: distclean
rm -f psqlscan.c

1428
src/fe_utils/psqlscan.l Normal file

File diff suppressed because it is too large Load Diff