Makefile 2.5 KB
Newer Older
1 2
#-------------------------------------------------------------------------
#
3
# Makefile for backend/catalog
4
#
5
# $PostgreSQL: pgsql/src/backend/catalog/Makefile,v 1.55 2005/07/07 20:39:57 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 16
       pg_largeobject.o pg_namespace.o pg_operator.o pg_proc.o pg_shdepend.o \
       pg_type.o
17

18
BKIFILES = postgres.bki postgres.description
19 20

all: SUBSYS.o $(BKIFILES)
21 22

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

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

29
POSTGRES_BKI_SRCS := $(addprefix $(top_srcdir)/src/include/catalog/,\
30
	pg_proc.h pg_type.h pg_attribute.h pg_class.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
	pg_namespace.h pg_conversion.h pg_database.h pg_shdepend.h \
36 37
	pg_authid.h pg_auth_members.h pg_tablespace.h pg_depend.h \
	indexing.h \
38 39
    )

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

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

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

49 50
.PHONY: install-data
install-data: $(BKIFILES) installdirs
51 52
	$(INSTALL_DATA) postgres.bki         $(DESTDIR)$(datadir)/postgres.bki
	$(INSTALL_DATA) postgres.description $(DESTDIR)$(datadir)/postgres.description
53
	$(INSTALL_DATA) $(srcdir)/system_views.sql $(DESTDIR)$(datadir)/system_views.sql
54
	$(INSTALL_DATA) $(srcdir)/information_schema.sql $(DESTDIR)$(datadir)/information_schema.sql
55
	$(INSTALL_DATA) $(srcdir)/sql_features.txt $(DESTDIR)$(datadir)/sql_features.txt
56 57

installdirs:
58
	$(mkinstalldirs) $(DESTDIR)$(datadir)
59

60 61
.PHONY: uninstall-data
uninstall-data:
62
	rm -f $(addprefix $(DESTDIR)$(datadir)/, $(BKIFILES) system_views.sql information_schema.sql sql_features.txt)
63

64
clean:
65
	rm -f SUBSYS.o $(OBJS) $(BKIFILES)