Makefile 5.2 KB
Newer Older
1 2
#-------------------------------------------------------------------------
#
3
# Makefile for backend/catalog
4
#
5
# src/backend/catalog/Makefile
6 7 8
#
#-------------------------------------------------------------------------

9 10
subdir = src/backend/catalog
top_builddir = ../../..
11
include $(top_builddir)/src/Makefile.global
12

13 14 15 16
ifndef ADDON_DIR
QUICKLZ_COMPRESSION = quicklz_compression.o
endif

17
OBJS = catalog.o dependency.o heap.o index.o indexing.o namespace.o aclchk.o \
18
       pg_aggregate.o pg_constraint.o pg_conversion.o pg_depend.o pg_enum.o \
19
       pg_largeobject.o pg_namespace.o pg_operator.o pg_proc.o pg_shdepend.o \
20 21 22 23 24 25
       pg_type.o toasting.o \
       pg_exttable.o pg_extprotocol.o \
       pg_proc_callback.o \
       aoseg.o aoblkdir.o gp_fastsequence.o \
       pg_attribute_encoding.o pg_compression.o aovisimap.o \
       gp_global_sequence.o gp_persistent.o pg_appendonly.o \
26
       aocatalog.o $(QUICKLZ_COMPRESSION)
27 28 29


SUBDIRS = caql core
30

31
BKIFILES = postgres.bki postgres.description postgres.shdescription
32

33 34
include $(top_srcdir)/src/backend/common.mk

35
all: $(BKIFILES)
36 37 38 39 40 41 42 43 44 45 46 47 48 49

# TIDYCAT_BEGIN_CODEGEN
# WARNING: DO NOT MODIFY THE FOLLOWING SECTION:
# Generated by ./tidycat.pl version 31
# on Thu Sep  1 16:43:17 2011


TIDYCAT_BKI_SRCS := \
	pg_attribute_encoding.h \
	pg_auth_time_constraint.h \
	pg_compression.h \
	pg_proc_callback.h \
	pg_partition_encoding.h \
	pg_type_encoding.h
50

51
# TIDYCAT_END_CODEGEN
52

53 54
# Note: there are some undocumented dependencies on the ordering in which
# the catalog header files are assembled into postgres.bki.  In particular,
55
# indexing.h had better be last, and toasting.h just before it.
56
# And pg_proc_gp.h must be immediately after pg_proc.h
57

58 59 60
POSTGRES_BKI_SRCS := $(addprefix $(top_srcdir)/src/include/catalog/, \
	pg_proc.h pg_proc_gp.h \
	pg_type.h pg_attribute.h pg_class.h pg_autovacuum.h \
61 62
	pg_attrdef.h pg_constraint.h pg_inherits.h pg_index.h pg_operator.h \
	pg_opfamily.h pg_opclass.h pg_am.h pg_amop.h pg_amproc.h \
63
	pg_language.h pg_largeobject.h pg_aggregate.h pg_statistic.h \
64
	pg_rewrite.h pg_trigger.h pg_listener.h pg_description.h pg_cast.h \
65
	pg_enum.h pg_namespace.h pg_conversion.h pg_depend.h \
66
	pg_database.h pg_tablespace.h pg_pltemplate.h \
67
	pg_authid.h pg_auth_members.h pg_shdepend.h pg_shdescription.h pg_resqueue.h \
68 69
	pg_ts_config.h pg_ts_config_map.h pg_ts_dict.h \
	pg_ts_parser.h pg_ts_template.h \
70 71 72
	gp_configuration.h gp_id.h gp_policy.h gp_version.h \
	gp_segment_config.h gp_san_config.h \
	pg_window.h \
73
	pg_exttable.h pg_appendonly.h aoseg.h \
74 75 76 77
	gp_fastsequence.h pg_extprotocol.h \
	pg_partition.h pg_partition_rule.h pg_filespace.h pg_filespace_entry.h \
	gp_global_sequence.h gp_persistent.h \
	$(TIDYCAT_BKI_SRCS) \
78
	toasting.h indexing.h \
79 80
    )

81
pg_includes = $(sort -I$(top_srcdir)/src/include -I$(top_builddir)/src/include)
82

83 84 85
# see explanation in ../parser/Makefile
postgres.description: postgres.bki ;

86 87
postgres.shdescription: postgres.bki ;

88 89 90 91 92 93 94 95 96 97 98 99 100 101
# In Greenplum, we have added extra columns to some catalog tables. To avoid
# having to change every single DATA row in those header files, which would
# create massive merge conflicts when merging with upstream, the extra
# columns are marked with GPDB_COLUMN_DEFAULT() lines in the header files,
# which provides a default for every data row that's missing the column. That
# way, new rows can have all the columns, but there's no need to modify rows
# inherited from upstream.
#
# process_col_defaults.pl reads the catalog headers, and creates a modified
# source file (postgres_bki_srcs) that has all the defaults injected into
# the DATA rows. That is fed to genbki.sh, instead of the original headers.
postgres_bki_srcs: process_col_defaults.pl $(POSTGRES_BKI_SRCS)
	cat $(POSTGRES_BKI_SRCS) | $(PERL) process_col_defaults.pl > postgres_bki_srcs

102
postgres.bki: genbki.sh postgres_bki_srcs $(top_srcdir)/src/include/pg_config_manual.h
103
	AWK='$(AWK)' $(SHELL) $< $(pg_includes) --set-version=$(VERSION) -o postgres postgres_bki_srcs
104

105 106
.PHONY: install-data
install-data: $(BKIFILES) installdirs
107 108 109
	$(INSTALL_DATA) $(call vpathsearch,postgres.bki) '$(DESTDIR)$(datadir)/postgres.bki'
	$(INSTALL_DATA) $(call vpathsearch,postgres.description) '$(DESTDIR)$(datadir)/postgres.description'
	$(INSTALL_DATA) $(call vpathsearch,postgres.shdescription) '$(DESTDIR)$(datadir)/postgres.shdescription'
110 111
	$(INSTALL_DATA) $(srcdir)/system_views.sql '$(DESTDIR)$(datadir)/system_views.sql'
	$(INSTALL_DATA) $(srcdir)/information_schema.sql '$(DESTDIR)$(datadir)/information_schema.sql'
112 113
	$(INSTALL_DATA) $(call vpathsearch,cdb_util.sql) '$(DESTDIR)$(datadir)/cdb_util.sql'
	$(INSTALL_DATA) $(call vpathsearch,cdb_schema.sql) '$(DESTDIR)$(datadir)/cdb_init.d/cdb_schema.sql'
114
	$(INSTALL_DATA) $(srcdir)/sql_features.txt '$(DESTDIR)$(datadir)/sql_features.txt'
115
	$(INSTALL_DATA) $(call vpathsearch,gp_toolkit.sql) '$(DESTDIR)$(datadir)/cdb_init.d/gp_toolkit.sql'
116 117

installdirs:
118
	$(MKDIR_P) '$(DESTDIR)$(datadir)'
119

120 121
.PHONY: uninstall-data
uninstall-data:
122
	rm -f $(addprefix '$(DESTDIR)$(datadir)'/, $(BKIFILES) system_views.sql information_schema.sql cdb_init.d/cdb_schema.sql sql_features.txt)
123

124
# postgres_bki_srcs is in the distribution tarball, so it is not cleaned here.
125
clean:
126
	rm -f SUBSYS.o $(OBJS) $(BKIFILES)
127 128 129

maintainer-clean: clean
	rm -f postgres_bki_srcs