]> granicus.if.org Git - postgresql/blob - src/backend/utils/Makefile
fcd8138f3e52c66d848edfada007611332f1c6e7
[postgresql] / src / backend / utils / Makefile
1 #
2 # Makefile for utils
3 #
4 # src/backend/utils/Makefile
5 #
6
7 subdir = src/backend/utils
8 top_builddir = ../../..
9 include $(top_builddir)/src/Makefile.global
10
11 OBJS        = fmgrtab.o
12 SUBDIRS     = adt cache error fmgr hash init mb misc mmgr resowner sort time
13
14 # location of Catalog.pm
15 catalogdir  = $(top_srcdir)/src/backend/catalog
16
17 include $(top_srcdir)/src/backend/common.mk
18
19 all: fmgroids.h probes.h
20
21 $(SUBDIRS:%=%-recursive): fmgroids.h
22
23 # see explanation in ../parser/Makefile
24 fmgroids.h: fmgrtab.c ;
25
26 fmgrtab.c: Gen_fmgrtab.pl $(catalogdir)/Catalog.pm $(top_srcdir)/src/include/catalog/pg_proc.h
27         $(PERL) -I $(catalogdir) $< $(top_srcdir)/src/include/catalog/pg_proc.h
28
29 errcodes.h: $(top_srcdir)/src/backend/utils/errcodes.txt generate-errcodes.pl
30         $(PERL) generate-errcodes.pl $< > $@
31
32 ifneq ($(enable_dtrace), yes)
33 probes.h: Gen_dummy_probes.sed
34 endif
35
36 probes.h: probes.d
37 ifeq ($(enable_dtrace), yes)
38         $(DTRACE) -C -h -s $< -o $@.tmp
39         sed -e 's/POSTGRESQL_/TRACE_POSTGRESQL_/g' $@.tmp >$@
40         rm $@.tmp
41 else
42         sed -f $(srcdir)/Gen_dummy_probes.sed $< >$@
43 endif
44
45
46 # fmgroids.h, fmgrtab.c and errcodes.h are in the distribution tarball, so they
47 # are not cleaned here.
48 clean:
49         rm -f probes.h
50
51 maintainer-clean: clean
52         rm -f fmgroids.h fmgrtab.c errcodes.h