Makefile 2.8 KB
Newer Older
1 2
#-------------------------------------------------------------------------
#
3
# Makefile for backend/catalog
4
#
5
# $PostgreSQL: pgsql/src/backend/catalog/Makefile,v 1.60 2006/07/31 01:16:36 tgl Exp $
6 7 8
#
#-------------------------------------------------------------------------

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

13 14
OBJS = catalog.o dependency.o heap.o index.o indexing.o namespace.o aclchk.o \
       pg_aggregate.o pg_constraint.o pg_conversion.o pg_depend.o \
15
       pg_largeobject.o pg_namespace.o pg_operator.o pg_proc.o pg_shdepend.o \
16
       pg_type.o toasting.o
17

18
BKIFILES = postgres.bki postgres.description postgres.shdescription
19 20

all: SUBSYS.o $(BKIFILES)
21 22

SUBSYS.o: $(OBJS)
23
	$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
24

25 26
# Note: there are some undocumented dependencies on the ordering in which
# the catalog header files are assembled into postgres.bki.  In particular,
27
# indexing.h had better be last, and toasting.h just before it.
28

29
POSTGRES_BKI_SRCS := $(addprefix $(top_srcdir)/src/include/catalog/,\
30
	pg_proc.h pg_type.h pg_attribute.h pg_class.h pg_autovacuum.h \
31
	pg_attrdef.h pg_constraint.h pg_inherits.h pg_index.h \
32
	pg_operator.h pg_opclass.h pg_am.h pg_amop.h pg_amproc.h \
33
	pg_language.h pg_largeobject.h pg_aggregate.h pg_statistic.h \
34
	pg_rewrite.h pg_trigger.h pg_listener.h pg_description.h pg_cast.h \
35 36
	pg_namespace.h pg_conversion.h pg_depend.h \
	pg_database.h pg_tablespace.h pg_pltemplate.h \
37
	pg_authid.h pg_auth_members.h pg_shdepend.h pg_shdescription.h \
38
	toasting.h indexing.h \
39 40
    )

41
pg_includes := $(sort -I$(top_srcdir)/src/include -I$(top_builddir)/src/include)
42

43 44 45
# see explanation in ../parser/Makefile
postgres.description: postgres.bki ;

46 47
postgres.shdescription: postgres.bki ;

48
postgres.bki: genbki.sh $(POSTGRES_BKI_SRCS) \
49
    $(top_srcdir)/src/include/postgres_ext.h $(top_builddir)/src/include/pg_config_manual.h
50
	AWK='$(AWK)' $(SHELL) $< $(pg_includes) --set-version=$(VERSION) -o postgres $(POSTGRES_BKI_SRCS)
51

52 53
.PHONY: install-data
install-data: $(BKIFILES) installdirs
54 55
	$(INSTALL_DATA) postgres.bki         '$(DESTDIR)$(datadir)/postgres.bki'
	$(INSTALL_DATA) postgres.description '$(DESTDIR)$(datadir)/postgres.description'
56
	$(INSTALL_DATA) postgres.shdescription '$(DESTDIR)$(datadir)/postgres.shdescription'
57 58 59
	$(INSTALL_DATA) $(srcdir)/system_views.sql '$(DESTDIR)$(datadir)/system_views.sql'
	$(INSTALL_DATA) $(srcdir)/information_schema.sql '$(DESTDIR)$(datadir)/information_schema.sql'
	$(INSTALL_DATA) $(srcdir)/sql_features.txt '$(DESTDIR)$(datadir)/sql_features.txt'
60 61

installdirs:
62
	$(mkinstalldirs) '$(DESTDIR)$(datadir)'
63

64 65
.PHONY: uninstall-data
uninstall-data:
66
	rm -f $(addprefix '$(DESTDIR)$(datadir)'/, $(BKIFILES) system_views.sql information_schema.sql sql_features.txt)
67

68
clean:
69
	rm -f SUBSYS.o $(OBJS) $(BKIFILES)