support 9.5 & 9.6
[gevel.git] / Makefile
1 subdir = contrib/gevel
2 top_builddir = ../..
3
4 MODULES = gevel
5 DATA_built = gevel.sql
6 DOCS = README.gevel
7 REGRESS = gevel
8
9 EXTRA_CLEAN =  pg_version.txt expected/gevel.out
10
11 ifdef USE_PGXS
12 PG_CONFIG = pg_config
13 PGXS := $(shell $(PG_CONFIG) --pgxs)
14 include $(PGXS)
15 else
16 subdir = contrib/gevel
17 top_builddir = ../..
18 include $(top_builddir)/src/Makefile.global
19 include $(top_srcdir)/contrib/contrib-global.mk
20 endif
21
22 all installcheck: pg_version.txt
23
24 pg_version.txt:
25         echo PG_MAJORVERSION | $(CPP) -undef -x c -w  -P $(CPPFLAGS) -include pg_config.h -o - - |  grep -v '^$$' | sed -e 's/"//g' > $@
26         if [ -f expected/gevel.out.`cat pg_version.txt` ] ; \
27         then \
28                 cp expected/gevel.out.`cat pg_version.txt` expected/gevel.out ; \
29         else \
30                 cp expected/gevel.out.st expected/gevel.out ; \
31         fi