-
Notifications
You must be signed in to change notification settings - Fork 61
/
Makefile
executable file
·66 lines (51 loc) · 1.61 KB
/
Makefile
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
SWIG = swig -DSWIGWORDSIZE64
CXX = g++
ARCH = $(shell arch)
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S), Linux)
LDFLAGS = -Llibs -lpthread -lrt -lgridstore
endif
ifeq ($(UNAME_S), Darwin)
LDFLAGS = -lpthread -lgridstore -undefined dynamic_lookup
endif
CPPFLAGS = -fPIC -std=c++0x -g -O2
INCLUDES = -Iinclude -Isrc
PY_CFLAGS := $(shell python3-config --includes)
NUMPY_FLAGS := $(shell python3 -c "import site; print(site.getsitepackages()[0])")
INCLUDES_PYTHON = $(INCLUDES) \
${PY_CFLAGS} \
-I${NUMPY_FLAGS}/numpy/core/include
PROGRAM = _griddb_python.so
EXTRA = griddb_python.py griddb_python.pyc
SOURCES = src/TimeSeriesProperties.cpp \
src/ContainerInfo.cpp \
src/AggregationResult.cpp \
src/Container.cpp \
src/Store.cpp \
src/StoreFactory.cpp \
src/PartitionController.cpp \
src/Query.cpp \
src/QueryAnalysisEntry.cpp \
src/RowKeyPredicate.cpp \
src/RowList.cpp \
src/RowSet.cpp \
src/TimestampUtils.cpp \
src/Field.cpp \
src/Util.cpp
all: $(PROGRAM)
SWIG_DEF = src/griddb.i
SWIG_PYTHON_SOURCES = src/griddb_python.cxx
OBJS = $(SOURCES:.cpp=.o)
SWIG_PYTHON_OBJS = $(SWIG_PYTHON_SOURCES:.cxx=.o)
$(SWIG_PYTHON_SOURCES) : $(SWIG_DEF)
$(SWIG) -outdir . -o $@ -c++ -python $<
.cpp.o:
$(CXX) $(CPPFLAGS) -c -o $@ $(INCLUDES) $<
$(SWIG_PYTHON_OBJS): $(SWIG_PYTHON_SOURCES)
$(CXX) $(CPPFLAGS) -c -o $@ $(INCLUDES_PYTHON) $<
_griddb_python.so: $(OBJS) $(SWIG_PYTHON_OBJS)
$(CXX) -shared -o $@ $(OBJS) $(SWIG_PYTHON_OBJS) $(LDFLAGS)
clean:
rm -rf $(OBJS) $(SWIG_PYTHON_OBJS)
rm -rf $(SWIG_PYTHON_SOURCES)
rm -rf $(PROGRAM) $(EXTRA)