Fix a compiler warning in initStringInfo().
[pgsql.git] / src / backend / utils / Makefile
blob140fbba5c222a250a35198320253d625e08d69d2
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
16 OBJS = fmgrtab.o
17 SUBDIRS = \
18 activity \
19 adt \
20 cache \
21 error \
22 fmgr \
23 hash \
24 init \
25 mb \
26 misc \
27 mmgr \
28 resowner \
29 sort \
30 time
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
43 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
53 touch $@
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
60 sed -f $^ >$@
61 rm probes.h.tmp
63 probes.h.tmp: probes.d
64 $(DTRACE) -C -h -s $< -o $@
65 else
66 probes.h: Gen_dummy_probes.pl probes.d
67 $(PERL) -n $^ >$@
68 endif
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" . ; \
76 done
77 touch $@
79 .PHONY: install-data
80 install-data: errcodes.txt installdirs
81 $(INSTALL_DATA) $(srcdir)/errcodes.txt '$(DESTDIR)$(datadir)/errcodes.txt'
83 installdirs:
84 $(MKDIR_P) '$(DESTDIR)$(datadir)'
86 .PHONY: uninstall-data
87 uninstall-data:
88 rm -f $(addprefix '$(DESTDIR)$(datadir)'/, errcodes.txt)
90 clean:
91 rm -f probes.h probes.h.tmp
92 rm -f fmgroids.h fmgrprotos.h fmgrtab.c fmgr-stamp errcodes.h