1 #-------------------------------------------------------------------------
3 # Makefile for backend/catalog
5 # Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
6 # Portions Copyright (c) 1994, Regents of the University of California
8 # src/backend/catalog/Makefile
10 #-------------------------------------------------------------------------
12 subdir
= src
/backend
/catalog
13 top_builddir
= ..
/..
/..
14 include $(top_builddir
)/src
/Makefile.global
33 pg_db_role_setting.o \
49 include $(top_srcdir
)/src
/backend
/common.mk
51 # Note: the order of this list determines the order in which the catalog
52 # header files are assembled into postgres.bki. BKI_BOOTSTRAP catalogs
53 # must appear first, and pg_statistic before pg_statistic_ext_data, and
54 # there are reputedly other, undocumented ordering dependencies.
56 pg_proc.h pg_type.h pg_attribute.h pg_class.h \
57 pg_attrdef.h pg_constraint.h pg_inherits.h pg_index.h pg_operator.h \
58 pg_opfamily.h pg_opclass.h pg_am.h pg_amop.h pg_amproc.h \
59 pg_language.h pg_largeobject_metadata.h pg_largeobject.h pg_aggregate.h \
60 pg_statistic.h pg_statistic_ext.h pg_statistic_ext_data.h \
61 pg_rewrite.h pg_trigger.h pg_event_trigger.h pg_description.h \
62 pg_cast.h pg_enum.h pg_namespace.h pg_conversion.h pg_depend.h \
63 pg_database.h pg_db_role_setting.h pg_tablespace.h \
64 pg_authid.h pg_auth_members.h pg_shdepend.h pg_shdescription.h \
65 pg_ts_config.h pg_ts_config_map.h pg_ts_dict.h \
66 pg_ts_parser.h pg_ts_template.h pg_extension.h \
67 pg_foreign_data_wrapper.h pg_foreign_server.h pg_user_mapping.h \
68 pg_foreign_table.h pg_policy.h pg_replication_origin.h \
69 pg_default_acl.h pg_init_privs.h pg_seclabel.h pg_shseclabel.h \
70 pg_collation.h pg_partitioned_table.h pg_range.h pg_transform.h \
71 pg_sequence.h pg_publication.h pg_publication_rel.h pg_subscription.h \
74 GENERATED_HEADERS
:= $(CATALOG_HEADERS
:%.h
=%_d.h
) schemapg.h system_fk_info.h
76 POSTGRES_BKI_SRCS
:= $(addprefix $(top_srcdir
)/src
/include/catalog
/, $(CATALOG_HEADERS
))
78 # The .dat files we need can just be listed alphabetically.
79 POSTGRES_BKI_DATA
= $(addprefix $(top_srcdir
)/src
/include/catalog
/,\
80 pg_aggregate.dat pg_am.dat pg_amop.dat pg_amproc.dat pg_authid.dat \
81 pg_cast.dat pg_class.dat pg_collation.dat pg_conversion.dat \
82 pg_database.dat pg_language.dat \
83 pg_namespace.dat pg_opclass.dat pg_operator.dat pg_opfamily.dat \
84 pg_proc.dat pg_range.dat pg_tablespace.dat \
85 pg_ts_config.dat pg_ts_config_map.dat pg_ts_dict.dat pg_ts_parser.dat \
86 pg_ts_template.dat pg_type.dat \
89 all: distprep generated-header-symlinks
93 .PHONY
: generated-header-symlinks
95 generated-header-symlinks
: $(top_builddir
)/src
/include/catalog
/header-stamp
97 # bki-stamp records the last time we ran genbki.pl. We don't rely on
98 # the timestamps of the individual output files, because the Perl script
99 # won't update them if they didn't change (to avoid unnecessary recompiles).
100 # Technically, this should depend on Makefile.global which supplies
101 # $(MAJORVERSION); but then genbki.pl would need to be re-run after every
102 # configure run, even in distribution tarballs. So depending on configure.ac
103 # instead is cheating a bit, but it will achieve the goal of updating the
104 # version number when it changes.
105 bki-stamp
: genbki.pl Catalog.pm
$(POSTGRES_BKI_SRCS
) $(POSTGRES_BKI_DATA
) $(top_srcdir
)/configure.ac
106 $(PERL
) $< --include-path
=$(top_srcdir
)/src
/include/ \
107 --set-version
=$(MAJORVERSION
) $(POSTGRES_BKI_SRCS
)
110 # The generated headers must all be symlinked into builddir/src/include/,
111 # using absolute links for the reasons explained in src/backend/Makefile.
112 # We use header-stamp to record that we've done this because the symlinks
113 # themselves may appear older than bki-stamp.
114 $(top_builddir
)/src
/include/catalog
/header-stamp
: bki-stamp
115 prereqdir
=`cd '$(dir $<)' >/dev/null && pwd` && \
116 cd
'$(dir $@)' && for file in
$(GENERATED_HEADERS
); do \
117 rm -f
$$file && $(LN_S
) "$$prereqdir/$$file" .
; \
121 # Note: installation of generated headers is handled elsewhere
123 install-data
: bki-stamp
installdirs
124 $(INSTALL_DATA
) $(call vpathsearch
,postgres.bki
) '$(DESTDIR)$(datadir)/postgres.bki'
125 $(INSTALL_DATA
) $(call vpathsearch
,system_constraints.sql
) '$(DESTDIR)$(datadir)/system_constraints.sql'
126 $(INSTALL_DATA
) $(srcdir)/system_functions.sql
'$(DESTDIR)$(datadir)/system_functions.sql'
127 $(INSTALL_DATA
) $(srcdir)/system_views.sql
'$(DESTDIR)$(datadir)/system_views.sql'
128 $(INSTALL_DATA
) $(srcdir)/information_schema.sql
'$(DESTDIR)$(datadir)/information_schema.sql'
129 $(INSTALL_DATA
) $(srcdir)/sql_features.txt
'$(DESTDIR)$(datadir)/sql_features.txt'
132 $(MKDIR_P
) '$(DESTDIR)$(datadir)'
134 .PHONY
: uninstall-data
136 rm -f
$(addprefix '$(DESTDIR)$(datadir)'/, postgres.bki system_constraints.sql system_functions.sql system_views.sql information_schema.sql sql_features.txt
)
138 # postgres.bki, system_constraints.sql, and the generated headers are
139 # in the distribution tarball, so they are not cleaned here.
142 maintainer-clean
: clean
143 rm -f bki-stamp postgres.bki system_constraints.sql
$(GENERATED_HEADERS
)