]> granicus.if.org Git - postgresql/blob - src/include/Makefile
Add support for VPATH builds, that is, building somewhere else than in the
[postgresql] / src / include / Makefile
1 #-------------------------------------------------------------------------
2 #
3 # Makefile for src/include
4 #
5 # Install exported headers to the include directory (these headers are
6 # the minimal ones needed to build loadable backend extensions).
7 #
8 # $Header: /cvsroot/pgsql/src/include/Makefile,v 1.5 2000/10/20 21:04:03 petere Exp $
9 #
10 #-------------------------------------------------------------------------
11
12 subdir = src/include
13 top_builddir = ../..
14 include $(top_builddir)/src/Makefile.global
15
16
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
21
22 builddir_headers := os.h config.h utils/fmgroids.h
23
24 HEADERS = $(srcdir_headers) $(builddir_headers)
25
26
27 all: $(HEADERS)
28
29
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 .
34
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
39
40
41 install: all installdirs
42         for file in $(srcdir_headers); do \
43           $(INSTALL_DATA) $(srcdir)/$$file $(DESTDIR)$(includedir)/$$file || exit; \
44         done
45         for file in $(builddir_headers); do \
46           $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/$$file || exit; \
47         done
48
49 # Automatically pick out the needed subdirectories for the include
50 # tree.
51 installdirs:
52         $(mkinstalldirs) $(addprefix $(DESTDIR)$(includedir)/, $(sort $(dir $(HEADERS))))
53
54 uninstall:
55         rm -f $(addprefix $(DESTDIR)$(includedir)/, $(HEADERS))
56
57 clean:
58         rm -f utils/fmgroids.h parser/parse.h
59
60 distclean maintainer-clean: clean
61         rm -f config.h dynloader.h os.h stamp-h