db_mysql: install shared *.sql files
[sip-router] / modules / db_mysql / Makefile
1 # $Id$
2 #
3 # WARNING: do not run this directly, it should be run by the master Makefile
4
5 include ../../Makefile.defs
6 auto_gen=
7 NAME=db_mysql.so
8
9 # mysql.h locations (freebsd,openbsd  solaris)
10 DEFS +=-DSER_MOD_INTERFACE -I$(LOCALBASE)/include -I$(LOCALBASE)/include/mysql \
11                 -I$(LOCALBASE)/mysql/include \
12                 -I/usr/include/mysql
13
14 # libmysqlclient locations on RH/Suse, Solaris /OpenBSD, FreeBSD
15 # (Debian does the right thing and puts it in /usr/lib)
16 LIBS=-L/usr/lib/mysql -L$(LOCALBASE)/lib -L$(LOCALBASE)/lib/mysql \
17                 -L$(LOCALBASE)/mysql/lib/mysql/ \
18                 -L$(LOCALBASE)/mysql/lib \
19                 -L/usr/lib64/mysql \
20                 -lmysqlclient -lz
21
22 SERLIBPATH=../../lib
23 SER_LIBS=$(SERLIBPATH)/srdb2/srdb2 $(SERLIBPATH)/srdb1/srdb1
24 MOD_INSTALL_SHARE= ../../scripts/mysql/my_create.sql \
25                                    ../../scripts/mysql/my_data.sql   \
26                                    ../../scripts/mysql/my_drop.sql
27
28 install-mysql-script: $(bin_prefix)/$(bin_dir)
29         sed -e "s#^DEFAULT_SCRIPT_DIR.*#DEFAULT_SCRIPT_DIR=\"$(share_prefix)/$(share_dir)\"#g" \
30         < ../../scripts/mysql/$(SCR_NAME)_mysql.sh > \
31         $(bin_prefix)/$(bin_dir)/$(MAIN_NAME)_mysql.sh
32         chmod 755 $(bin_prefix)/$(bin_dir)/$(MAIN_NAME)_mysql.sh
33
34 install-scripts: install-mysql-script
35
36 include ../../Makefile.modules