OSDN Git Service

Change copyright year to 2019
[pghintplan/pg_hint_plan.git] / Makefile
1 #
2 # pg_hint_plan: Makefile
3 #
4 # Copyright (c) 2012-2019, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
5 #
6
7 MODULES = pg_hint_plan
8 HINTPLANVER = 1.3.2
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-W 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.3.2.sql pg_hint_plan--1.3.0--1.3.1.sql \
18         pg_hint_plan--1.3.1--1.3.2.sql
19
20 EXTRA_CLEAN = sql/ut-fdw.sql expected/ut-fdw.out RPMS
21
22 PG_CONFIG = pg_config
23 PGXS := $(shell $(PG_CONFIG) --pgxs)
24 include $(PGXS)
25
26 STARBALL10 = pg_hint_plan10-$(HINTPLANVER).tar.gz
27 STARBALLS = $(STARBALL10)
28
29 TARSOURCES = Makefile *.c  *.h COPYRIGHT* \
30         pg_hint_plan--*.sql \
31         pg_hint_plan.control \
32         doc/* expected/*.out sql/*.sql sql/maskout.sh \
33         data/data.csv input/*.source output/*.source SPECS/*.spec
34
35 LDFLAGS+=-Wl,--build-id
36
37 installcheck: $(REGRESSION_EXPECTED)
38
39 rpms: rpm10
40
41 # pg_hint_plan.c includes core.c and make_join_rel.c
42 pg_hint_plan.o: core.c make_join_rel.c # pg_stat_statements.c
43
44 $(STARBALLS): $(TARSOURCES)
45         if [ -h $(subst .tar.gz,,$@) ]; then rm $(subst .tar.gz,,$@); fi
46         if [ -e $(subst .tar.gz,,$@) ]; then \
47           echo "$(subst .tar.gz,,$@) is not a symlink. Stop."; \
48           exit 1; \
49         fi
50         ln -s . $(subst .tar.gz,,$@)
51         tar -chzf $@ $(addprefix $(subst .tar.gz,,$@)/, $^)
52         rm $(subst .tar.gz,,$@)
53
54 rpm10: $(STARBALL10)
55         MAKE_ROOT=`pwd` rpmbuild -bb SPECS/pg_hint_plan10.spec
56
57