2 # pg_hint_plan: Makefile
4 # Copyright (c) 2012-2018, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
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
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
14 REGRESS_OPTS = --encoding=UTF8
16 EXTENSION = pg_hint_plan
17 DATA = pg_hint_plan--1.2.4.sql pg_hint_plan--1.2.3--1.2.4.sql \
18 pg_hint_plan--1.2.2--1.2.3.sql pg_hint_plan--1.2.1--1.2.2.sql \
19 pg_hint_plan--1.2.0--1.2.1.sql pg_hint_plan--1.1.3--1.2.0.sql
21 EXTRA_CLEAN = sql/ut-fdw.sql expected/ut-fdw.out RPMS
24 PGXS := $(shell $(PG_CONFIG) --pgxs)
27 STARBALL96 = pg_hint_plan96-$(HINTPLANVER).tar.gz
28 STARBALLS = $(STARBALL96)
30 TARSOURCES = Makefile *.c *.h COPYRIGHT* \
32 pg_hint_plan.control \
33 doc/* expected/*.out sql/*.sql sql/maskout.sh \
34 data/data.csv input/*.source output/*.source SPECS/*.spec
36 LDFLAGS+=-Wl,--build-id
38 installcheck: $(REGRESSION_EXPECTED)
42 # pg_hint_plan.c includes core.c and make_join_rel.c
43 pg_hint_plan.o: core.c make_join_rel.c # pg_stat_statements.c
45 $(STARBALLS): $(TARSOURCES)
46 if [ -h $(subst .tar.gz,,$@) ]; then rm $(subst .tar.gz,,$@); fi
47 if [ -e $(subst .tar.gz,,$@) ]; then \
48 echo "$(subst .tar.gz,,$@) is not a symlink. Stop."; \
51 ln -s . $(subst .tar.gz,,$@)
52 tar -chzf $@ $(addprefix $(subst .tar.gz,,$@)/, $^)
53 rm $(subst .tar.gz,,$@)
56 MAKE_ROOT=`pwd` rpmbuild -bb SPECS/pg_hint_plan96.spec