1 #-------------------------------------------------------------------------
3 # Makefile for backend/utils
5 # Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
6 # Portions Copyright (c) 1994, Regents of the University of California
8 # src/backend/utils/Makefile
10 #-------------------------------------------------------------------------
12 subdir
= src
/backend
/utils
13 top_builddir
= ..
/..
/..
14 include $(top_builddir
)/src
/Makefile.global
32 # location of Catalog.pm
33 catalogdir
= $(top_srcdir
)/src
/backend
/catalog
35 include $(top_srcdir
)/src
/backend
/common.mk
37 all: probes.h generated-header-symlinks
39 .PHONY
: generated-header-symlinks submake-adt-headers
41 generated-header-symlinks
: $(top_builddir
)/src
/include/utils
/header-stamp submake-adt-headers
44 $(MAKE
) -C adt jsonpath_gram.h
46 $(SUBDIRS
:%=%-recursive
): fmgr-stamp errcodes.h
48 # fmgr-stamp records the last time we ran Gen_fmgrtab.pl. We don't rely on
49 # the timestamps of the individual output files, because the Perl script
50 # won't update them if they didn't change (to avoid unnecessary recompiles).
51 fmgr-stamp
: Gen_fmgrtab.pl
$(catalogdir
)/Catalog.pm
$(top_srcdir
)/src
/include/catalog
/pg_proc.dat
52 $(PERL
) -I
$(catalogdir
) $< --include-path
=$(top_srcdir
)/src
/include/ $(top_srcdir
)/src
/include/catalog
/pg_proc.dat
55 errcodes.h
: $(top_srcdir
)/src
/backend
/utils
/errcodes.txt generate-errcodes.pl
56 $(PERL
) $(srcdir)/generate-errcodes.pl
--outfile
$@
$<
58 ifeq ($(enable_dtrace
), yes
)
59 probes.h
: postprocess_dtrace.sed probes.h.tmp
63 probes.h.tmp
: probes.d
64 $(DTRACE
) -C
-h
-s
$< -o
$@
66 probes.h
: Gen_dummy_probes.pl probes.d
70 # These generated headers must be symlinked into src/include/.
71 # We use header-stamp to record that we've done this because the symlinks
72 # themselves may appear older than fmgr-stamp.
73 $(top_builddir
)/src
/include/utils
/header-stamp
: fmgr-stamp errcodes.h probes.h
74 cd
'$(dir $@)' && for file in fmgroids.h fmgrprotos.h errcodes.h probes.h
; do \
75 rm -f
$$file && $(LN_S
) "../../../$(subdir)/$$file" .
; \
80 install-data
: errcodes.txt
installdirs
81 $(INSTALL_DATA
) $(srcdir)/errcodes.txt
'$(DESTDIR)$(datadir)/errcodes.txt'
84 $(MKDIR_P
) '$(DESTDIR)$(datadir)'
86 .PHONY
: uninstall-data
88 rm -f
$(addprefix '$(DESTDIR)$(datadir)'/, errcodes.txt
)
91 rm -f probes.h probes.h.tmp
92 rm -f fmgroids.h fmgrprotos.h fmgrtab.c fmgr-stamp errcodes.h