From 95f2103922a6df719123e49ec99deb454fb9d29e Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Thu, 29 Mar 2018 13:28:52 +1300 Subject: [PATCH] Install errcodes.txt for use by extensions. Maintainers of out-of-tree PLs typically need access to the set of error codes. To avoid the need to duplicate that information in some form in PL source trees, provide errcodes.txt as part of a server installation. Author: Thomas Munro, based on a suggestion from Andrew Gierth Discussion: https://postgr.es/m/87woykk7mu.fsf%40news-spur.riddles.org.uk --- src/backend/Makefile | 2 ++ src/backend/utils/Makefile | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/backend/Makefile b/src/backend/Makefile index 21b094385f..a4b6d1658c 100644 --- a/src/backend/Makefile +++ b/src/backend/Makefile @@ -247,6 +247,7 @@ endif endif $(MAKE) -C catalog install-data $(MAKE) -C tsearch install-data + $(MAKE) -C utils install-data $(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample '$(DESTDIR)$(datadir)/pg_hba.conf.sample' $(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample '$(DESTDIR)$(datadir)/pg_ident.conf.sample' $(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample '$(DESTDIR)$(datadir)/postgresql.conf.sample' @@ -312,6 +313,7 @@ endif endif $(MAKE) -C catalog uninstall-data $(MAKE) -C tsearch uninstall-data + $(MAKE) -C utils uninstall-data rm -f '$(DESTDIR)$(datadir)/pg_hba.conf.sample' \ '$(DESTDIR)$(datadir)/pg_ident.conf.sample' \ '$(DESTDIR)$(datadir)/postgresql.conf.sample' \ diff --git a/src/backend/utils/Makefile b/src/backend/utils/Makefile index e296e6ce4d..163c81a1c2 100644 --- a/src/backend/utils/Makefile +++ b/src/backend/utils/Makefile @@ -46,6 +46,16 @@ else sed -f $(srcdir)/Gen_dummy_probes.sed $< >$@ endif +.PHONY: install-data +install-data: errcodes.txt installdirs + $(INSTALL_DATA) $(srcdir)/errcodes.txt '$(DESTDIR)$(datadir)/errcodes.txt' + +installdirs: + $(MKDIR_P) '$(DESTDIR)$(datadir)' + +.PHONY: uninstall-data +uninstall-data: + rm -f $(addprefix '$(DESTDIR)$(datadir)'/, errcodes.txt) # fmgroids.h, fmgrprotos.h, fmgrtab.c and errcodes.h are in the # distribution tarball, so they are not cleaned here. -- 2.16.2