OSDN Git Service

Changed version to 1.1.7
[pghintplan/pg_hint_plan.git] / Makefile
1 #
2 # pg_hint_plan: Makefile
3 #
4 # Copyright (c) 2012-2018, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
5 #
6
7 MODULES = pg_hint_plan
8 HINTPLANVER = 1.1.7
9
10 REGRESS = init base_plan pg_hint_plan ut-init ut-A ut-S ut-J ut-L ut-G ut-R ut-fdw ut-T ut-fini
11
12 REGRESSION_EXPECTED = expected/init.out expected/base_plan.out expected/pg_hint_plan.out expected/ut-A.out expected/ut-S.out expected/ut-J.out expected/ut-L.out expected/ut-G.out
13
14 REGRESS_OPTS = --encoding=UTF8
15
16 EXTENSION = pg_hint_plan
17 DATA = pg_hint_plan--1.1.7.sql pg_hint_plan--1.1.6--1.1.7.sql \
18         pg_hint_plan--1.1.5--1.1.6.sql pg_hint_plan--1.1.4--1.1.5.sql \
19         pg_hint_plan--1.1.3--1.1.4.sql pg_hint_plan--1.1.2--1.1.3.sql
20
21 EXTRA_CLEAN = sql/ut-fdw.sql expected/ut-fdw.out
22
23 PG_CONFIG = pg_config
24 PGXS := $(shell $(PG_CONFIG) --pgxs)
25 include $(PGXS)
26
27 STARBALL = pg_dbms_stats-$(DBMSSTATSVER).tar.gz
28 STARBALL94 = pg_hint_plan94-$(HINTPLANVER).tar.gz
29 STARBALLS = $(STARBALL) $(STARBALL94)
30
31 TARSOURCES = Makefile *.c  *.h COPYRIGHT* \
32         pg_hint_plan--*.sql \
33         pg_hint_plan.control \
34         doc/* expected/*.out sql/*.sql sql/maskout.sh \
35         data/data.csv input/*.source output/*.source SPECS/*.spec
36
37 LDFLAGS+=-Wl,--build-id
38
39 installcheck: $(REGRESSION_EXPECTED)
40
41 rpms: rpm94
42
43 # pg_hint_plan.c includes core.c and make_join_rel.c
44 pg_hint_plan.o: core.c make_join_rel.c # pg_stat_statements.c
45
46 $(STARBALLS): $(TARSOURCES)
47         if [ -h $(subst .tar.gz,,$@) ]; then rm $(subst .tar.gz,,$@); fi
48         if [ -e $(subst .tar.gz,,$@) ]; then \
49           echo "$(subst .tar.gz,,$@) is not a symlink. Stop."; \
50           exit 1; \
51         fi
52         ln -s . $(subst .tar.gz,,$@)
53         tar -chzf $@ $(addprefix $(subst .tar.gz,,$@)/, $^)
54         rm $(subst .tar.gz,,$@)
55
56 rpm94: $(STARBALL94)
57         MAKE_ROOT=`pwd` rpmbuild -bb SPECS/pg_hint_plan94.spec
58
59