OSDN Git Service

Fix regtests. Drop 9.2 support, RPM automation
[pghintplan/pg_hint_plan.git] / Makefile
1 #
2 # pg_hint_plan: Makefile
3 #
4 # Copyright (c) 2012-2014, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
5 #
6
7 MODULES = pg_hint_plan
8 HINTPLANVER = 1.0.1
9 REGRESS = init base_plan pg_hint_plan ut-init ut-A ut-S ut-J ut-L ut-G ut-fdw ut-fini
10
11 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
12
13 REGRESS_OPTS = --encoding=UTF8
14
15 EXTENSION = pg_hint_plan
16 DATA = pg_hint_plan--1.0--1.0.1.sql pg_hint_plan--1.0.1.sql
17
18 EXTRA_CLEAN = core.c sql/ut-fdw.sql expected/ut-fdw.out $(REGRESSION_EXPECTED)
19
20 PG_CONFIG = pg_config
21 PGXS := $(shell $(PG_CONFIG) --pgxs)
22 include $(PGXS)
23
24 core.c: core-$(MAJORVERSION).c
25         cp core-$(MAJORVERSION).c core.c
26
27 $(REGRESSION_EXPECTED): %.out: %-$(MAJORVERSION).out
28         cp $< $@
29
30 STARBALL = pg_dbms_stats-$(DBMSSTATSVER).tar.gz
31 STARBALL91 = pg_hint_plan91-$(HINTPLANVER).tar.gz
32 STARBALLS = $(STARBALL) $(STARBALL91)
33
34 TARSOURCES = Makefile *.c  *.h \
35         pg_hint_plan--*.sql \
36         pg_hint_plan.control \
37         doc/* expected/*.out sql/*.sql \
38         input/*.source output/*.source SPECS/*.spec
39
40 installcheck: $(REGRESSION_EXPECTED)
41
42 rpms: rpm91
43
44 # pg_hint_plan.c includes core.c and make_join_rel.c
45 pg_hint_plan.o: core.c make_join_rel.c pg_stat_statements.c
46
47 $(STARBALLS): $(TARSOURCES)
48         if [ -h $(subst .tar.gz,,$@) ]; then rm $(subst .tar.gz,,$@); fi
49         if [ -e $(subst .tar.gz,,$@) ]; then \
50           echo "$(subst .tar.gz,,$@) is not a symlink. Stop."; \
51           exit 1; \
52         fi
53         ln -s . $(subst .tar.gz,,$@)
54         tar -chzf $@ $(addprefix $(subst .tar.gz,,$@)/, $^)
55         rm $(subst .tar.gz,,$@)
56
57 rpm91: $(STARBALL91)
58         MAKE_ROOT=`pwd` rpmbuild -bb SPECS/pg_hint_plan91.spec
59
60