]> granicus.if.org Git - postgresql/blob - src/Makefile
Avoid maintaining three separate copies of the error codes list.
[postgresql] / src / Makefile
1 #-------------------------------------------------------------------------
2 #
3 # Makefile for src
4 #
5 # Copyright (c) 1994, Regents of the University of California
6 #
7 # src/Makefile
8 #
9 #-------------------------------------------------------------------------
10
11 subdir = src
12 top_builddir = ..
13 include Makefile.global
14
15 SUBDIRS = \
16         port \
17         timezone \
18         backend \
19         backend/utils/mb/conversion_procs \
20         backend/snowball \
21         include \
22         interfaces \
23         backend/replication/libpqwalreceiver \
24         bin \
25         pl \
26         makefiles \
27         test/regress
28
29 # There are too many interdependencies between the subdirectories, so
30 # don't attempt parallel make here.
31 .NOTPARALLEL:
32
33 # generate errcodes.h before recursing in the subdirectories
34 $(SUBDIRS:%=all-%-recurse): $(top_builddir)/src/include/utils/errcodes.h
35
36 backend/utils/errcodes.h: backend/utils/generate-errcodes.pl $(top_srcdir)/src/backend/utils/errcodes.txt
37         $(MAKE) -C backend/utils errcodes.h
38
39 $(top_builddir)/src/include/utils/errcodes.h: backend/utils/errcodes.h
40         prereqdir=`cd $(dir $<) >/dev/null && pwd` && \
41           cd $(dir $@) && rm -f $(notdir $@) && \
42           $(LN_S) "$$prereqdir/$(notdir $<)" .
43
44 $(recurse)
45
46 install: install-local
47
48 install-local: installdirs-local
49         $(INSTALL_DATA) Makefile.global '$(DESTDIR)$(pgxsdir)/$(subdir)/Makefile.global'
50         $(INSTALL_DATA) Makefile.port '$(DESTDIR)$(pgxsdir)/$(subdir)/Makefile.port'
51         $(INSTALL_DATA) $(srcdir)/Makefile.shlib '$(DESTDIR)$(pgxsdir)/$(subdir)/Makefile.shlib'
52         $(INSTALL_DATA) $(srcdir)/nls-global.mk '$(DESTDIR)$(pgxsdir)/$(subdir)/nls-global.mk'
53
54 installdirs: installdirs-local
55
56 installdirs-local:
57         $(MKDIR_P) '$(DESTDIR)$(pgxsdir)/$(subdir)'
58
59 uninstall: uninstall-local
60
61 uninstall-local:
62         rm -f $(addprefix '$(DESTDIR)$(pgxsdir)/$(subdir)'/, Makefile.global Makefile.port Makefile.shlib nls-global.mk)
63
64 clean:
65         $(MAKE) -C test $@
66         $(MAKE) -C tutorial NO_PGXS=1 $@
67         $(MAKE) -C test/thread $@
68
69 distclean maintainer-clean:
70         $(MAKE) -C test $@
71         $(MAKE) -C tutorial NO_PGXS=1 $@
72         $(MAKE) -C test/thread $@
73         rm -f Makefile.port Makefile.global
74
75 coverage:
76         $(MAKE) -C timezone $@
77         $(MAKE) -C backend $@
78         $(MAKE) -C backend/utils/mb/conversion_procs $@
79         $(MAKE) -C backend/snowball $@
80         $(MAKE) -C interfaces $@
81         $(MAKE) -C backend/replication/libpqwalreceiver $@
82         $(MAKE) -C bin $@
83         $(MAKE) -C pl $@
84
85
86 .PHONY: install-local installdirs-local uninstall-local