Makefile 2.4 KB
Newer Older
1 2
#-------------------------------------------------------------------------
#
3
# Makefile for catalog
4
#
5
# $Header: /cvsroot/pgsql/src/backend/catalog/Makefile,v 1.34 2001/05/14 21:58:10 momjian Exp $
6 7 8
#
#-------------------------------------------------------------------------

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

13
OBJS = catalog.o heap.o index.o indexing.o aclchk.o \
14 15
       pg_aggregate.o pg_largeobject.o pg_operator.o pg_proc.o \
       pg_type.o
16

17
BKIFILES = global.bki template1.bki global.description template1.description
18 19

all: SUBSYS.o $(BKIFILES)
20 21

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


25
GLOBAL_BKI_SRCS := $(addprefix $(top_srcdir)/src/include/catalog/,\
26
	pg_database.h pg_shadow.h pg_group.h pg_log.h \
27
    )
28

29 30 31 32
TEMPLATE1_BKI_SRCS := $(addprefix $(top_srcdir)/src/include/catalog/,\
	pg_proc.h pg_type.h pg_attribute.h pg_class.h \
	pg_inherits.h pg_index.h pg_statistic.h \
	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 \
34 35 36
	pg_rewrite.h pg_listener.h pg_description.h indexing.h \
    )

37
pg_includes := $(sort -I$(top_srcdir)/src/include -I$(top_builddir)/src/include)
38

39 40
global.bki global.description: genbki.sh $(GLOBAL_BKI_SRCS) $(top_srcdir)/src/include/catalog/indexing.h \
    $(top_srcdir)/src/include/postgres_ext.h $(top_builddir)/src/include/config.h
P
Peter Eisentraut 已提交
41
	CPP='$(CPP)' AWK='$(AWK)' $(SHELL) $< $(BKIOPTS) -o global $(pg_includes) $(GLOBAL_BKI_SRCS) --set-version=$(VERSION)
42

43 44
template1.bki template1.description: genbki.sh $(TEMPLATE1_BKI_SRCS) \
    $(top_srcdir)/src/include/postgres_ext.h $(top_builddir)/src/include/config.h
P
Peter Eisentraut 已提交
45
	CPP='$(CPP)' AWK='$(AWK)' $(SHELL) $< $(BKIOPTS) -o template1 $(pg_includes) $(TEMPLATE1_BKI_SRCS) --set-version=$(VERSION)
46 47 48

.PHONY: install-bki
install-bki: $(BKIFILES) installdirs
49 50 51 52
	$(INSTALL_DATA) global.bki            $(DESTDIR)$(datadir)/global.bki
	$(INSTALL_DATA) global.description    $(DESTDIR)$(datadir)/global.description
	$(INSTALL_DATA) template1.bki         $(DESTDIR)$(datadir)/template1.bki
	$(INSTALL_DATA) template1.description $(DESTDIR)$(datadir)/template1.description
53 54

installdirs:
55
	$(mkinstalldirs) $(DESTDIR)$(datadir)
56 57 58

.PHONY: uninstall-bki
uninstall-bki:
59
	rm -f $(addprefix $(DESTDIR)$(datadir)/, $(BKIFILES))
60

61 62

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

65 66 67 68

depend dep:
	$(CC) -MM $(CFLAGS) *.c >depend

69 70 71
ifeq (depend,$(wildcard depend))
include depend
endif