forked from citusdata/citus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.global.in
76 lines (65 loc) · 2.9 KB
/
Makefile.global.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# -*-makefile-*-
# @configure_input@
# Makefile.global.in - Makefile to be included by all submakes
#
# This file is converted by configure into an actual Makefile,
# replacing the @varname@ placeholders by actual values.
#
# This files is intended to contain infrastructure needed by several
# makefiles, particulary central handling of compilation flags and
# rules.
citus_abs_srcdir:=@abs_top_srcdir@/${citus_subdir}
citus_abs_top_srcdir:=@abs_top_srcdir@
postgres_abs_srcdir:=@POSTGRES_SRCDIR@
postgres_abs_builddir:=@POSTGRES_BUILDDIR@
PG_CONFIG:=@PG_CONFIG@
PGXS:=$(shell $(PG_CONFIG) --pgxs)
# Support for VPATH builds (i.e. builds from outside the source tree)
vpath_build=@vpath_build@
ifeq ($(vpath_build),yes)
override VPATH:=$(citus_abs_srcdir)
USE_VPATH:=$(VPATH)
citus_top_srcdir:=$(citus_abs_top_srcdir)
override srcdir=$(VPATH)
else
citus_top_srcdir:=$(citus_top_builddir)
endif
# Citus is built using PostgreSQL's pgxs
USE_PGXS=1
include $(PGXS)
# Remake Makefile.global from Makefile.global.in if the latter
# changed. In order to trigger this rule, the including file must
# write `include $(citus_top_builddir)/Makefile.global', not some
# shortcut thereof. This makes it less likely to accidentally run
# with some outdated Makefile.global.
# Make internally restarts whenever included Makefiles are
# regenerated.
$(citus_top_builddir)/Makefile.global: $(citus_abs_top_srcdir)/configure $(citus_top_builddir)/Makefile.global.in $(citus_top_builddir)/config.status
cd @abs_top_builddir@ && ./config.status Makefile.global
# Ensure configuration is generated by the most recent configure,
# useful for longer existing build directories.
$(citus_top_builddir)/config.status: $(citus_abs_top_srcdir)/configure $(citus_abs_top_srcdir)/src/backend/distributed/citus.control
cd @abs_top_builddir@ && ./config.status --recheck && ./config.status
# Regenerate configure if configure.in changed
$(citus_abs_top_srcdir)/configure: $(citus_abs_top_srcdir)/configure.in
cd ${citus_abs_top_srcdir} && ./autogen.sh
# If specified via configure, replace the default compiler. Normally
# we'll build with the one postgres was built with. But it's useful to
# be able to use a different one, especially when building against
# distribution packages.
ifneq (@CC@,)
override CC=@CC@
endif
# If detected by our configure script, override the FLEX postgres
# detected. That allows to compile citus against a postgres which was
# built without flex available (possible because generated files are
# included)
ifneq (@FLEX@,)
override FLEX=@FLEX@
endif
# Add options passed to configure or computed therein, to CFLAGS/CPPFLAGS/...
override CFLAGS += @CFLAGS@ @CITUS_CFLAGS@
override CPPFLAGS := @CPPFLAGS@ -I '${citus_abs_top_srcdir}/src/include' -I'${citus_top_builddir}/src/include' $(CPPFLAGS)
override LDFLAGS += @LDFLAGS@ @CITUS_LDFLAGS@
# optional file with user defined, additional, rules
-include ${citus_abs_srcdir}/src/Makefile.custom