-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (50 loc) · 1.64 KB
/
Makefile
File metadata and controls
61 lines (50 loc) · 1.64 KB
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
#-------------------------------------------------------------------------
#
# Makefile
# Mailefile for building ORC FDW
#
# 2020, Hamid Quddus Akhtar.
#
# This file uses pg_config/pgxs to build ORC FDW.
#
# Running REGRESSION:
# - Set "ORC_FDW_DIR" to ORC FDW source folder
#
# Copyright (c) 2020, Highgo Software Inc.
#
# IDENTIFICATION
# Makefile
#
#-------------------------------------------------------------------------
MODULE_big = orc_fdw
PGFILEDESC = "orc_fdw - foreign data wrapper for Apache ORC"
# Makefile variables
FDW_SRC_DIR := ${CURDIR}
EXTENSION = orc_fdw
OBJS = src/orc_interface.o src/orc_deparse.o src/orc_wrapper.o src/orc_fdw.o
DATA = orc_fdw--1.1.0.sql orc_fdw--1.0.0--1.1.0.sql orc_fdw--1.0.0.sql
REGRESS = create_table import_schema misc select joins
EXTRA_CLEAN = src/*.gcda src/*.gcno
PG_CPPFLAGS = -Iinclude
SHLIB_LINK = -lm -lstdc++
SHLIB_LINK += -L${FDW_SRC_DIR}/lib -lorc
SHLIB_LINK += -Wl,-rpath '${FDW_SRC_DIR}/lib'
PG_CONFIG ?= pg_config
# orc_impl.cpp requires C++ 11.
override PG_CXXFLAGS += -std=c++11 -O3 -Iinclude
PGXS := $(shell $(PG_CONFIG) --pgxs)
# Pass CCFLAGS (when defined) to both C and C++ compilers.
ifdef CCFLAGS
override PG_CXXFLAGS += $(CCFLAGS)
override PG_CFLAGS += $(CCFLAGS)
endif
include $(PGXS)
# XXX: Need to explicitly pass -fPIC (or equivalent) to C++ as servers
# prior to 11 do not automatically pass it
ifeq ($(shell test $(VERSION_NUM) -lt 110000; echo $$?), 0)
override CXXFLAGS += $(CFLAGS_SL)
endif
# XXX: src/Makefile.global omits passng CXX and CPP FLAGS when building
# bytecode from C++. Let's pass these here
%.bc : %.cpp
$(COMPILE.cxx.bc) $(CXXFLAGS) $(CPPFLAGS) -o $@ $<