File: Makefile

package info (click to toggle)
hypopg 1.4.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 464 kB
  • sloc: ansic: 2,338; sql: 357; makefile: 66; python: 51; sh: 2
file content (62 lines) | stat: -rw-r--r-- 1,765 bytes parent folder | download | duplicates (3)
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
51
52
53
54
55
56
57
58
59
60
61
62
EXTENSION = hypopg
EXTVERSION   = $(shell grep default_version $(EXTENSION).control | sed -e "s/default_version[[:space:]]*=[[:space:]]*'\([^']*\)'/\1/")
TESTS        = $(wildcard test/sql/*.sql)

# More test can be added later, after including pgxs
REGRESS      = hypopg

REGRESS_OPTS = --inputdir=test

PG_CONFIG ?= pg_config

MODULE_big = hypopg

OBJS = hypopg.o \
       hypopg_index.o \
       import/hypopg_import.o \
       import/hypopg_import_index.o

all:

release-zip: all
	git archive --format zip --prefix=hypopg-${EXTVERSION}/ --output ./hypopg-${EXTVERSION}.zip HEAD
	unzip ./hypopg-$(EXTVERSION).zip
	rm ./hypopg-$(EXTVERSION).zip
	rm ./hypopg-$(EXTVERSION)/.gitignore
	rm -rf ./hypopg-$(EXTVERSION)/docs/
	rm ./hypopg-$(EXTVERSION)/typedefs.list
	rm ./hypopg-$(EXTVERSION)/TODO.md
	sed -i -e "s/__VERSION__/$(EXTVERSION)/g"  ./hypopg-$(EXTVERSION)/META.json
	zip -r ./hypopg-$(EXTVERSION).zip ./hypopg-$(EXTVERSION)/
	rm -rf ./hypopg-$(EXTVERSION)


DATA = $(wildcard *--*.sql)
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)

ifneq ($(MAJORVERSION),$(filter $(MAJORVERSION), 9.2 9.3 9.4))
	REGRESS += hypo_brin
endif

ifeq ($(MAJORVERSION),10)
	REGRESS += hypo_index_part_10
endif

ifneq ($(MAJORVERSION),$(filter $(MAJORVERSION), 9.2 9.3 9.4 9.5 9.6 10))
	REGRESS += hypo_index_part hypo_include
endif

ifneq ($(MAJORVERSION),$(filter $(MAJORVERSION), 9.2 9.3 9.4 9.5 9.6))
	REGRESS += hypo_hash
endif

REGRESS += hypo_hide_index

DEBUILD_ROOT = /tmp/$(EXTENSION)

deb: release-zip
	mkdir -p $(DEBUILD_ROOT) && rm -rf $(DEBUILD_ROOT)/*
	unzip ./${EXTENSION}-$(EXTVERSION).zip -d $(DEBUILD_ROOT)
	cd $(DEBUILD_ROOT)/${EXTENSION}-$(EXTVERSION) && make -f debian/rules orig
	cd $(DEBUILD_ROOT)/${EXTENSION}-$(EXTVERSION) && debuild -us -uc -sa