-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (20 loc) · 739 Bytes
/
Makefile
File metadata and controls
29 lines (20 loc) · 739 Bytes
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
# Makefile for MyVector plugin
# Get compiler and linker flags from the installed MySQL server
MYSQL_CXX_FLAGS ?= $(shell mysql_config --cxxflags 2>/dev/null || echo "-I/usr/include/mysql")
MYSQL_LDFLAGS ?= $(shell mysql_config --libs 2>/dev/null || echo "-lmysqlclient")
# Add local include directory for myvector headers
INCLUDE_FLAGS := -I./include
# Source files
SOURCES := $(wildcard src/*.cc)
OBJECTS := $(SOURCES:.cc=.o)
# Target shared library
TARGET := myvector.so
# Default target
all: $(TARGET)
$(TARGET): $(OBJECTS)
$(CXX) $(MYSQL_CXX_FLAGS) $(INCLUDE_FLAGS) -shared -o $@ $^ $(MYSQL_LDFLAGS)
%.o: %.cc
$(CXX) $(MYSQL_CXX_FLAGS) $(INCLUDE_FLAGS) -fPIC -c -o $@ $<
clean:
rm -f $(OBJECTS) $(TARGET)
.PHONY: all clean