|
6 | 6 | # Portions Copyright (c) 2012-2015, The Reorg Development Team
|
7 | 7 | #
|
8 | 8 |
|
| 9 | +ifdefUSE_PGXS |
9 | 10 | PG_CONFIG ?= pg_config
|
10 |
| -EXTENSION = pg_repack |
11 |
| - |
12 |
| -.PHONY: dist/$(EXTENSION)-$(EXTVERSION).zip |
13 |
| - |
14 | 11 | # Pull out PostgreSQL version number from pg_config
|
15 | 12 | VERSION :=$(shell$(PG_CONFIG) --version | awk '{print $$2}')
|
16 | 13 | ifeq ("$(VERSION)","")
|
17 | 14 | $(error pg_config not found)
|
18 | 15 | endif
|
19 |
| - |
20 |
| -# PostgreSQL version as a number, e.g. 9.1.4 -> 901 |
21 |
| -INTVERSION :=$(shell echo$$(($$(echo$(VERSION) | sed 's/\([[:digit:]]\{1,\}\)\.\([[:digit:]]\{1,\}\).*/\1*100+\2/')))) |
22 |
| - |
23 |
| -# The version number of the library |
24 |
| -EXTVERSION =$(shell grep '"version":' META.json | head -1 \ |
25 |
| -| sed -e 's/[ ]*"version":[ ]*"\(.*\)",/\1/') |
26 |
| - |
27 |
| -ifeq ($(shell echo$$(($(INTVERSION) < 803))),1) |
28 |
| -$(error $(EXTENSION) requires PostgreSQL 8.3 or later. This is $(VERSION)) |
| 16 | +else |
| 17 | +subdir= contrib/pg_repack |
| 18 | +top_builddir = ../.. |
| 19 | +include$(top_builddir)/src/Makefile.global |
| 20 | +include$(top_srcdir)/contrib/contrib-global.mk |
29 | 21 | endif
|
| 22 | +EXTENSION = pg_repack |
| 23 | + |
30 | 24 |
|
31 | 25 | SUBDIRS = bin lib regress
|
32 | 26 |
|
33 | 27 | allinstallinstalldirsuninstalldistprepcleandistcleanmaintainer-cleandebug:
|
34 |
| -@for dirin$(SUBDIRS);do\ |
| 28 | +fordirin$(SUBDIRS);do \ |
35 | 29 | $(MAKE) -C$$dir$@||exit;\
|
36 | 30 | done
|
37 | 31 |
|
38 | 32 | # We'd like check operations to run all the subtests before failing.
|
39 | 33 | checkinstallcheck:
|
40 |
| -@CHECKERR=0;fordirin$(SUBDIRS);do \ |
| 34 | +CHECKERR=0;fordirin$(SUBDIRS);do \ |
41 | 35 | $(MAKE) -C$$dir$@|| CHECKERR=$$?;\
|
42 | 36 | done;\
|
43 | 37 | exit$$CHECKERR
|
|