menthion Daria as one of aouthors
[gevel.git] / Makefile
1 # contrib/gevel/Makefile
2
3 MODULE_big = gevel
4 OBJS = gevel.o
5 REGRESS = gevel
6 DATA = gevel.sql
7 DOCS = README.gevel
8 EXTRA_CLEAN =  pg_version.txt expected/gevel.out
9
10 all installcheck: pg_version.txt
11
12 ifdef USE_PGXS
13 PG_CONFIG = pg_config
14 PGXS := $(shell $(PG_CONFIG) --pgxs)
15 include $(PGXS)
16 else
17 subdir = contrib/gevel
18 include $(top_srcdir)/contrib/contrib-global.mk
19 endif
20
21 VERSION = $(MAJORVERSION)
22 ifeq ($(VERSION),12)
23         REGRESS += gevel_btree gevel_brin
24         DATA += gevel.btree.sql gevel.brin.sql
25 endif
26
27
28 pg_version.txt:
29         echo PG_MAJORVERSION | $(CPP) -undef -x c -w  -P $(CPPFLAGS) -include pg_config.h -o - - |  grep -v '^$$' | sed -e 's/"//g' > $@
30         if [ -f expected/gevel.out.$(VERSION)`cat pg_version.txt` ] ; \
31         then \
32                 cp expected/gevel.out.$(VERSION)`cat pg_version.txt` expected/gevel.out ; \
33         else \
34                 cp expected/gevel.out.$(VERSION) expected/gevel.out ; \
35         fi