-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (48 loc) · 1.94 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
ifeq ($(SCIDB),)
X := $(shell which scidb 2>/dev/null)
ifneq ($(X),)
X := $(shell dirname ${X})
SCIDB := $(shell dirname ${X})
endif
$(info SciDB installed at $(SCIDB))
endif
# A development environment will have SCIDB_VER defined, and SCIDB
# will not be in the same place... but the 3rd party directory *will*
# be, so build it using SCIDB_VER .
ifeq ($(SCIDB_VER),)
SCIDB_3RDPARTY = $(SCIDB)
else
SCIDB_3RDPARTY = /opt/scidb/$(SCIDB_VER)
endif
# A better way to set the 3rdparty prefix path that does not assume an
# absolute path...
ifeq ($(SCIDB_THIRDPARTY_PREFIX),)
SCIDB_THIRDPARTY_PREFIX := $(SCIDB_3RDPARTY)
endif
INSTALL_DIR = $(SCIDB)/lib/scidb/plugins
# Include the OPTIMIZED flags for non-debug use
OPTIMIZED=-O2 -DNDEBUG
DEBUG=-g -ggdb3
CFLAGS = -pedantic -W -Wextra -Wall -Wno-variadic-macros -Wno-strict-aliasing \
-Wno-long-long -Wno-unused-parameter -fPIC -D_STDC_FORMAT_MACROS \
-Wno-system-headers -isystem $(OPTIMIZED) -D_STDC_LIMIT_MACROS -std=c99
CCFLAGS = -pedantic -W -Wextra -Wall -Wno-variadic-macros -Wno-strict-aliasing \
-Wno-long-long -Wno-unused-parameter -fPIC $(OPTIMIZED)
INC = -I. -DPROJECT_ROOT="\"$(SCIDB)\"" -I"$(SCIDB_THIRDPARTY_PREFIX)/3rdparty/boost/include/" \
-I"$(SCIDB)/include" -I./extern
LIBS = -shared -Wl,-soname,libcu.so -ldl -L. \
-L"$(SCIDB_THIRDPARTY_PREFIX)/3rdparty/boost/lib" -L"$(SCIDB)/lib" \
-Wl,-rpath,$(SCIDB)/lib:$(RPATH)
SRCS = Logicalcu.cpp \
Physicalcu.cpp
all: libcu.so
clean:
rm -rf *.so *.o
libcu.so: $(SRCS)
@if test ! -d "$(SCIDB)"; then echo "Error. Try:\n\nmake SCIDB=<PATH TO SCIDB INSTALL PATH>"; exit 1; fi
$(CXX) $(CCFLAGS) $(INC) -o Logicalcu.o -c Logicalcu.cpp
$(CXX) $(CCFLAGS) $(INC) -o Physicalcu.o -c Physicalcu.cpp
$(CXX) $(CCFLAGS) $(INC) -o libcu.so plugin.cpp Logicalcu.o Physicalcu.o $(LIBS)
@echo "Now copy libcu.so to $(INSTALL_DIR) on all your SciDB nodes, and restart SciDB."
test:
echo write me XXX