summaryrefslogtreecommitdiff
path: root/epglv/Makefile
blob: b9af7b610d2e07e4297647f8c801e8e6e624ad5e (plain)
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
#
# Makefile
#
# See the README file for copyright information and how to reach the author.
#

include ../Make.config

ARCH := $(shell getconf LONG_BIT)

ifneq (,$(findstring "arm", $(shell uname -m)))
	CPP_FLAGS_32 := -m32
	CPP_FLAGS_64 := -m64
endif

CPP_FLAGS := $(CPP_FLAGS_$(ARCH)) -Wall \
	-fPIC \
	$(shell $(SQLCFG) --libs) \
	$(shell $(SQLCFG) --include) \
	-DMYSQL_DYNAMIC_PLUGIN \
	-DDEBUG_MYSQL=0

CC := gcc

MYSQL_PLGDIR := $(shell $(SQLCFG) --plugindir)
TARGET  = mysqlepglv.so
OBJS    = src/epglvbase.o src/epglv.o

all: $(TARGET)

$(TARGET): $(OBJS)
	$(CC) $(CPP_FLAGS) -pipe -O3 -shared -o $(TARGET) $(OBJS)

install: $(TARGET)
	strip $(TARGET)
	if ! test -f $(DESTDIR)/$(MYSQL_PLGDIR)/$(TARGET); then \
	   install -D --mode=644 -t $(DESTDIR)/$(MYSQL_PLGDIR) $(TARGET); \
	fi

forceinstall: $(TARGET)
	strip $(TARGET)
	install -D --mode=644 -t $(DESTDIR)/$(MYSQL_PLGDIR) $(TARGET); \
	$(_BINDEST)/epgd-import-epglv

clean:
	-rm -f $(TARGET) src/*.o src/*~ *~

%.o: %.c
src/%.o: src/%.c
	$(CC) -c $(CPP_FLAGS) -pipe -O3 -shared $< -o $@

#--------------------------------------------------------
# dependencies
#--------------------------------------------------------

src/epglvbase.o  : src/epglvbase.c  src/epglv.h
src/epglv.o      : src/epglv.c      src/epglv.h