OSDN Git Service

Update copyright year of files
[pghintplan/pg_hint_plan.git] / Makefile
1 #
2 # pg_hint_plan: Makefile
3 #
4 # Copyright (c) 2012-2021, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
5 #
6
7 MODULES = pg_hint_plan
8 HINTPLANVER = 1.4
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--*.sql
18
19 EXTRA_CLEAN = sql/ut-fdw.sql expected/ut-fdw.out RPMS
20
21 # Switch environment between standalone make and make check with
22 # EXTRA_INSTALL from PostgreSQL tree
23 # run the following command in the PG tree to run a regression test
24 # loading this module.
25 # $ make check EXTRA_INSTALL=<this directory> EXTRA_REGRESS_OPTS="--temp-config <this directory>/pg_hint_plan.conf"
26 ifeq ($(wildcard $(DESTDIR)/../src/Makefile.global),)
27 PG_CONFIG = pg_config
28 PGXS := $(shell $(PG_CONFIG) --pgxs)
29 include $(PGXS)
30 else
31 subdir = `pwd`
32 top_builddir = $(DESTDIR)/..
33 include $(DESTDIR)/../src/Makefile.global
34 include $(DESTDIR)/../contrib/contrib-global.mk
35 endif
36
37 STARBALL14 = pg_hint_plan14-$(HINTPLANVER).tar.gz
38 STARBALLS = $(STARBALL14)
39
40 TARSOURCES = Makefile *.c  *.h COPYRIGHT* \
41         pg_hint_plan--*.sql \
42         pg_hint_plan.control \
43         doc/* expected/*.out sql/*.sql sql/maskout.sh \
44         data/data.csv input/*.source output/*.source SPECS/*.spec
45
46 ifneq ($(shell uname), SunOS)
47 LDFLAGS+=-Wl,--build-id
48 endif
49
50 installcheck: $(REGRESSION_EXPECTED)
51
52 rpms: rpm14
53
54 # pg_hint_plan.c includes core.c and make_join_rel.c
55 pg_hint_plan.o: core.c make_join_rel.c # pg_stat_statements.c
56
57 $(STARBALLS): $(TARSOURCES)
58         if [ -h $(subst .tar.gz,,$@) ]; then rm $(subst .tar.gz,,$@); fi
59         if [ -e $(subst .tar.gz,,$@) ]; then \
60           echo "$(subst .tar.gz,,$@) is not a symlink. Stop."; \
61           exit 1; \
62         fi
63         ln -s . $(subst .tar.gz,,$@)
64         tar -chzf $@ $(addprefix $(subst .tar.gz,,$@)/, $^)
65         rm $(subst .tar.gz,,$@)
66
67 rpm14: $(STARBALL14)
68         MAKE_ROOT=`pwd` rpmbuild -bb SPECS/pg_hint_plan14.spec