1 #-------------------------------------------------------------------------
3 # Makefile for src/include
5 # Install exported headers to the include directory (these headers are
6 # the minimal ones needed to build loadable backend extensions).
8 # $Header: /cvsroot/pgsql/src/include/Makefile,v 1.5 2000/10/20 21:04:03 petere Exp $
10 #-------------------------------------------------------------------------
14 include $(top_builddir)/src/Makefile.global
17 srcdir_headers := c.h postgres.h postgres_ext.h fmgr.h \
18 libpq/pqcomm.h libpq/libpq-fs.h lib/dllist.h \
19 utils/geo_decls.h utils/elog.h utils/palloc.h \
20 access/attnum.h executor/spi.h commands/trigger.h
22 builddir_headers := os.h config.h utils/fmgroids.h
24 HEADERS = $(srcdir_headers) $(builddir_headers)
30 # These rules are necessary in case someone installs the include tree
31 # before building the backend tree. Very messy.
32 utils/fmgroids.h: $(top_builddir)/src/backend/utils/fmgroids.h
33 cd utils && rm -f fmgroids.h && $(LN_S) ../$(top_builddir)/src/backend/utils/fmgroids.h .
35 # This file is built in the backend tree, but we need to keep track of
36 # the dependencies here.
37 $(top_builddir)/src/backend/utils/fmgroids.h: $(top_srcdir)/src/backend/utils/Gen_fmgrtab.sh catalog/pg_proc.h
38 $(MAKE) -C $(dir $@) fmgroids.h
41 install: all installdirs
42 for file in $(srcdir_headers); do \
43 $(INSTALL_DATA) $(srcdir)/$$file $(DESTDIR)$(includedir)/$$file || exit; \
45 for file in $(builddir_headers); do \
46 $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/$$file || exit; \
49 # Automatically pick out the needed subdirectories for the include
52 $(mkinstalldirs) $(addprefix $(DESTDIR)$(includedir)/, $(sort $(dir $(HEADERS))))
55 rm -f $(addprefix $(DESTDIR)$(includedir)/, $(HEADERS))
58 rm -f utils/fmgroids.h parser/parse.h
60 distclean maintainer-clean: clean
61 rm -f config.h dynloader.h os.h stamp-h