mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-03-01 19:45:33 +08:00
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
This commit is contained in:
parent
adba4b7471
commit
eb6569fd0e
@ -54,22 +54,15 @@ fmgr-stamp: Gen_fmgrtab.pl $(catalogdir)/Catalog.pm $(top_srcdir)/src/include/ca
|
||||
errcodes.h: $(top_srcdir)/src/backend/utils/errcodes.txt generate-errcodes.pl
|
||||
$(PERL) $(srcdir)/generate-errcodes.pl --outfile $@ $<
|
||||
|
||||
ifneq ($(enable_dtrace), yes)
|
||||
probes.h: Gen_dummy_probes.sed
|
||||
endif
|
||||
|
||||
# We editorialize on dtrace's output to the extent of changing the macro
|
||||
# names (from POSTGRESQL_foo to TRACE_POSTGRESQL_foo) and changing any
|
||||
# "char *" arguments to "const char *".
|
||||
probes.h: probes.d
|
||||
ifeq ($(enable_dtrace), yes)
|
||||
$(DTRACE) -C -h -s $< -o $@.tmp
|
||||
sed -e 's/POSTGRESQL_/TRACE_POSTGRESQL_/g' \
|
||||
-e 's/( *char \*/(const char */g' \
|
||||
-e 's/, *char \*/, const char */g' $@.tmp >$@
|
||||
rm $@.tmp
|
||||
probes.h: postprocess_dtrace.sed probes.h.tmp
|
||||
sed -f $^ >$@
|
||||
|
||||
probes.h.tmp: probes.d
|
||||
$(DTRACE) -C -h -s $< -o $@
|
||||
else
|
||||
sed -f $(srcdir)/Gen_dummy_probes.sed $< >$@
|
||||
probes.h: Gen_dummy_probes.sed probes.d
|
||||
sed -f $^ >$@
|
||||
endif
|
||||
|
||||
# These generated headers must be symlinked into builddir/src/include/,
|
||||
|
15
src/backend/utils/postprocess_dtrace.sed
Normal file
15
src/backend/utils/postprocess_dtrace.sed
Normal file
@ -0,0 +1,15 @@
|
||||
#-------------------------------------------------------------------------
|
||||
# sed script to postprocess dtrace output
|
||||
#
|
||||
# Copyright (c) 2008-2022, PostgreSQL Global Development Group
|
||||
#
|
||||
# src/backend/utils/postprocess_dtrace.sed
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
# We editorialize on dtrace's output to the extent of changing the macro
|
||||
# names (from POSTGRESQL_foo to TRACE_POSTGRESQL_foo) and changing any
|
||||
# "char *" arguments to "const char *".
|
||||
|
||||
s/POSTGRESQL_/TRACE_POSTGRESQL_/g
|
||||
s/( *char \*/(const char */g
|
||||
s/, *char \*/, const char */g
|
Loading…
Reference in New Issue
Block a user