r1639: Initial revision
[clsql.git] / interfaces / mysql / Makefile
1 # -*- Mode: Makefile -*-
2 ###########################################################################
3 # FILE IDENTIFICATION
4
5 #  Name:         Makefile
6 #  Purpose:      Makefile for the CLSQL UFFI helper package
7 #  Programer:    Kevin M. Rosenberg
8 #  Date Started: Mar 2002
9 #
10 #  CVS Id:   $Id: Makefile,v 1.1 2002/03/23 14:04:52 kevin Exp $
11 #
12 # This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
13 #
14 # CLSQL users are granted the rights to distribute and use this software
15 # as governed by the terms of the Lisp Lesser GNU Public License
16 # (http://opensource.franz.com/preamble.html), also known as the LLGPL.
17 ###########################################################################
18
19
20 # These variables are correct for GCC
21 # you'll need to modify these for other compilers
22 CC=gcc
23 SHARED_CC_OPT=-fpic
24 SHARED_LD_OPT=-shared
25
26 # If you are using Solaris, these are the correct values
27 # for creating a shared library
28 #CC=cc
29 #SHARED_CC_OPT=-KPIC
30 #SHARED_LD_OPT=-G
31
32 # Set to the directory where you have installed mysql's library
33 #MYSQL_DIR=/usr
34 MYSQL_DIR=/opt/mysql
35
36 MYSQL_LIB=${MYSQL_DIR}/lib/mysql
37 MYSQL_LIB_FILE=${MYSQL_LIB}/libmysqlclient.so
38 MYSQL_INCLUDE=${MYSQL_DIR}/include/mysql
39
40 # Nothing to configure beyond this point
41
42 BASE=clsql-mysql
43 SRC=${BASE}.c
44 OBJECT=${BASE}.o
45 LIB=${BASE}.so
46
47 all: ${LIB}
48
49 ${LIB}: ${SRC} ${MYSQL_LIB_FILE}
50         ${CC} ${SHARED_CC_OPT} -I ${MYSQL_INCLUDE} -c ${SRC} -o ${OBJECT}
51         ld ${SHARED_LD_OPT} ${OBJECT} ${MYSQL_LIB_FILE} -o ${LIB}
52         @rm ${OBJECT}
53
54 clean:
55         rm -f ${LIB}
56
57 realclean: clean
58         rm -f *~
59