You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AQuery/Makefile

83 lines
2.8 KiB

3 years ago
OS_SUPPORT =
MonetDB_LIB =
MonetDB_INC =
Threading =
2 years ago
CXXFLAGS = --std=c++1z
OPTFLAGS = -O3
LINKFLAGS = -flto
2 years ago
SHAREDFLAGS = -shared -fPIC
LIBTOOL = $(shell $(CXX) --version | grep -q 'clang' && echo "libtool -static -o"|| echo "ar rcs")
USELIB_FLAG = $(shell $(CXX) --version | grep -q 'clang' && echo "-Wl,-force_load"|| echo "-Wl,--whole-archive")
LIBAQ_SRC = server/server.cpp server/monetdb_conn.cpp server/io.cpp
2 years ago
ifeq ($(PCH), 1)
PCHFLAGS = -include server/pch.hpp
2 years ago
else
PCHFLAGS =
2 years ago
endif
2 years ago
3 years ago
ifeq ($(OS),Windows_NT)
2 years ago
NULL_DEVICE = NUL
3 years ago
OS_SUPPORT += server/winhelper.cpp
MonetDB_LIB += msc-plugin/monetdbe.dll
MonetDB_INC += -Imonetdb/msvc
else
UNAME_S = $(shell uname -s)
UNAME_M = $(shell uname -m)
2 years ago
NULL_DEVICE = /dev/null
MonetDB_LIB =
ifeq ($(UNAME_S),Darwin)
MonetDB_LIB += -L$(shell brew --prefix monetdb)/lib
MonetDB_INC += -I$(shell brew --prefix monetdb)/include/monetdb
ifneq ($(UNAME_M),arm64)
OPTFLAGS += -march=native
endif
else
OPTFLAGS += -march=native
MonetDB_INC += -I/usr/local/include/monetdb -I/usr/include/monetdb
endif
MonetDB_LIB += -lmonetdbe
3 years ago
endif
ifeq ($(THREADING),1)
LIBAQ_SRC += server/threading.cpp
Threading += -DTHREADING
endif
info:
$(info $(OS_SUPPORT))
$(info $(OS))
$(info $(Threading))
$(info "test")
$(info $(LIBTOOL))
$(info $(MonetDB_INC))
$(info $(CXX))
pch:
$(CXX) -x c++-header server/pch.hpp $(MonetDB_INC) $(OPTFLAGS) $(CXXFLAGS) $(Threading)
libaquery.a:
$(CXX) -c $(PCHFLAGS) $(LIBAQ_SRC) $(MonetDB_INC) $(MonetDB_LIB) $(OS_SUPPORT) $(Threading) $(OPTFLAGS) $(LINKFLAGS) $(CXXFLAGS) &&\
$(LIBTOOL) libaquery.a *.o &&\
ranlib libaquery.a
3 years ago
server.bin:
$(CXX) $(LIBAQ_SRC) $(LINKFLAGS) $(OS_SUPPORT) $(Threading) $(MonetDB_INC) $(MonetDB_LIB) $(OPTFLAGS) $(CXXFLAGS) -o server.bin
launcher:
$(CXX) -D__AQ_BUILD_LAUNCHER__ $(LIBAQ_SRC) $(LINKFLAGS) $(OS_SUPPORT) $(Threading) $(MonetDB_INC) $(MonetDB_LIB) $(OPTFLAGS) $(CXXFLAGS) -o aq
3 years ago
server.so:
# $(CXX) server/server.cpp server/monetdb_conn.cpp -fPIC -shared $(OS_SUPPORT) monetdb/msvc/monetdbe.dll --std=c++1z -O3 -march=native -o server.so -I./monetdb/msvc
$(CXX) $(SHAREDFLAGS) $(PCHFLAGS) $(LIBAQ_SRC) $(OS_SUPPORT) $(Threading) $(MonetDB_INC) $(MonetDB_LIB) $(OPTFLAGS) $(LINKFLAGS) $(CXXFLAGS) -o server.so
server_uselib:
$(CXX) $(SHAREDFLAGS) $(USELIB_FLAG),libaquery.a $(MonetDB_LIB) $(OPTFLAGS) $(LINKFLAGS) $(CXXFLAGS) -o server.so
3 years ago
snippet:
$(CXX) $(SHAREDFLAGS) $(PCHFLAGS) out.cpp $(LIBAQ_SRC) $(MonetDB_INC) $(MonetDB_LIB) $(Threading) $(OPTFLAGS) $(LINKFLAGS) $(CXXFLAGS) -o dll.so
snippet_uselib:
$(CXX) $(SHAREDFLAGS) $(PCHFLAGS) out.cpp libaquery.a $(MonetDB_INC) $(Threading) $(MonetDB_LIB) $(OPTFLAGS) $(LINKFLAGS) $(CXXFLAGS) -o dll.so
2 years ago
docker:
docker build -t aquery .
3 years ago
clean:
2 years ago
rm *.shm *.o dll.so server.so server.bin -rf 2> $(NULL_DEVICE) || true