forked from infusion/udf_infusion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
30 lines (22 loc) · 858 Bytes
/
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
.PHONY: help build install load unload uninstall all
CFLAGS=$(shell mysql_config --cflags)
LIBS=$(shell mysql_config --libs)
PLUGINDIR=$(shell mysql_config --variable=plugindir)
help:
@echo "make (build|install|load|uninstall)"
@echo " - build : build the .so file"
@echo " - install : copy the .so to the ${PLUGINDIR}"
@echo " - load : make the library available in mysql runtime"
@echo " - unload : remove the library from mysql runtime"
@echo " - uninstall : remove the library from ${PLUGINDIR}"
build:
gcc ${CFLAGS} -fPIC -shared -o udf_infusion.so udf_infusion.c
install:
mv udf_infusion.so ${PLUGINDIR}
load: build install
gawk -f db.awk -v drop=0 < udf_infusion.c | /usr/bin/mysql -f
unload:
rm -f ${PLUGINDIR}/udf_infusion.so
uninstall: unload
gawk -f db.awk -v drop=1 < udf_infusion.c | /usr/bin/mysql -f
all: load