/
Makefile
50 lines (39 loc) · 1.15 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
EXTENSION = saio
EXTVERSION = $(shell grep default_version $(EXTENSION).control | \
sed -e "s/default_version[[:space:]]*=[[:space:]]*'\([^']*\)'/\1/")
DOCS = $(wildcard doc/*.md)
TESTS = $(wildcard test/sql/*.sql)
REGRESS = $(patsubst test/sql/%.sql,%,$(TESTS))
REGRESS_OPTS = --inputdir=test
PG_CONFIG = pg_config
EXTRA_CLEAN = src/saio_probes.h
MODULE_big = saio
OBJS = src/saio_main.o src/saio_util.o src/saio_trees.o \
src/saio_recalc.o src/saio.o
# make sure
all: all-lib
# check for DTrace support
ifeq (,$(findstring --enable-dtrace,$(shell $(PG_CONFIG) --configure)))
enable_dtrace = no
else
enable_dtrace = yes
endif
ifeq ($(enable_dtrace), yes)
OBJS += src/saio_probes.o
endif
src/saio.o: src/saio_probes.h
src/saio_probes.o: src/saio_probes.d
$(DTRACE) -C -G -s $< -o $@
ifeq ($(enable_dtrace), no)
src/saio_probes.h: src/Gen_dummy_probes.sed
endif
src/saio_probes.h: src/saio_probes.d
ifeq ($(enable_dtrace), yes)
$(DTRACE) -C -h -s $< -o $@.tmp
sed -e 's/SAIO_/TRACE_SAIO_/g' $@.tmp >$@
rm $@.tmp
else
sed -f src/Gen_dummy_probes.sed $< >$@
endif
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)