X-Git-Url: http://www.sigaev.ru/git/gitweb.cgi?a=blobdiff_plain;f=Makefile;h=e15bc012dc9b333c4c54301d9f266b802a5209fd;hb=bf5ed50f54f041782049b93abe9fa4bc43a4867d;hp=6bcaa542627da402bc44e14cede11f07b42d6465;hpb=a28232afd1ec8cf67df1de4d4d8c8f5783762004;p=gevel.git diff --git a/Makefile b/Makefile index 6bcaa54..e15bc01 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,31 @@ subdir = contrib/gevel top_builddir = ../.. -include $(top_builddir)/src/Makefile.global MODULES = gevel DATA_built = gevel.sql DOCS = README.gevel REGRESS = gevel +EXTRA_CLEAN = pg_version.txt expected/gevel.out + +ifdef USE_PGXS +PG_CONFIG = pg_config +PGXS := $(shell $(PG_CONFIG) --pgxs) +include $(PGXS) +else +subdir = contrib/gevel +top_builddir = ../.. +include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk +endif + +all installcheck: pg_version.txt + +pg_version.txt: + echo PG_MAJORVERSION | $(CPP) -undef -x c -w -P $(CPPFLAGS) -include pg_config.h -o - - | grep -v '^$$' | sed -e 's/"//g' > $@ + if [ -f expected/gevel.out.`cat pg_version.txt` ] ; \ + then \ + cp expected/gevel.out.`cat pg_version.txt` expected/gevel.out ; \ + else \ + cp expected/gevel.out.st expected/gevel.out ; \ + fi