Skip to content

Commit eb6569f

Browse files
committed
Refactor dtrace postprocessing make rules
This is in preparation for building postgres with meson / ninja. Move the dtrace postprocessing sed commands into a separate file so that it can be shared by meson. Also split the rule into two for proper dependency declaration. Reviewed-by: Andres Freund <andres@anarazel.de> Author: Peter Eisentraut <peter@eisentraut.org> Discussion: https://postgr.es/m/5e216522-ba3c-f0e6-7f97-5276d0270029@enterprisedb.com
1 parent adba4b7 commit eb6569f

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

src/backend/utils/Makefile

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,15 @@ fmgr-stamp: Gen_fmgrtab.pl $(catalogdir)/Catalog.pm $(top_srcdir)/src/include/ca
5454
errcodes.h: $(top_srcdir)/src/backend/utils/errcodes.txt generate-errcodes.pl
5555
$(PERL) $(srcdir)/generate-errcodes.pl --outfile $@ $<
5656

57-
ifneq ($(enable_dtrace), yes)
58-
probes.h: Gen_dummy_probes.sed
59-
endif
60-
61-
# We editorialize on dtrace's output to the extent of changing the macro
62-
# names (from POSTGRESQL_foo to TRACE_POSTGRESQL_foo) and changing any
63-
# "char *" arguments to "const char *".
64-
probes.h: probes.d
6557
ifeq ($(enable_dtrace), yes)
66-
$(DTRACE) -C -h -s $< -o $@.tmp
67-
sed -e 's/POSTGRESQL_/TRACE_POSTGRESQL_/g' \
68-
-e 's/( *char \*/(const char */g' \
69-
-e 's/, *char \*/, const char */g' $@.tmp >$@
70-
rm $@.tmp
58+
probes.h: postprocess_dtrace.sed probes.h.tmp
59+
sed -f $^ >$@
60+
61+
probes.h.tmp: probes.d
62+
$(DTRACE) -C -h -s $< -o $@
7163
else
72-
sed -f $(srcdir)/Gen_dummy_probes.sed $< >$@
64+
probes.h: Gen_dummy_probes.sed probes.d
65+
sed -f $^ >$@
7366
endif
7467

7568
# These generated headers must be symlinked into builddir/src/include/,
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#-------------------------------------------------------------------------
2+
# sed script to postprocess dtrace output
3+
#
4+
# Copyright (c) 2008-2022, PostgreSQL Global Development Group
5+
#
6+
# src/backend/utils/postprocess_dtrace.sed
7+
#-------------------------------------------------------------------------
8+
9+
# We editorialize on dtrace's output to the extent of changing the macro
10+
# names (from POSTGRESQL_foo to TRACE_POSTGRESQL_foo) and changing any
11+
# "char *" arguments to "const char *".
12+
13+
s/POSTGRESQL_/TRACE_POSTGRESQL_/g
14+
s/( *char \*/(const char */g
15+
s/, *char \*/, const char */g

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy