r1729: *** empty log message ***
[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.4 2002/04/03 04:06:05 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 CC=gcc
22 SHARED_CC_OPT=-fPIC -DPIC
23
24 #SHARED_LD_OPT=-r # For FreeBSD and Solaris (CMUCL)
25 SHARED_LD_OPT=-Bshareable -Bdynamic  # For Linux (ALL) and FreeBSD (ACL)
26
27 # Use these for Sun's C compiler and Solaris (ACL)
28 #CC=cc
29 #SHARED_CC_OPT=-KPIC
30 #SHARED_LD_OPT=-G
31
32
33 # Set to the directory where you have installed mysql's library
34 MYSQL_DIR=/opt/mysql
35 #MYSQL_DIR=/usr
36
37 MYSQL_LIB=$(MYSQL_DIR)/lib/mysql
38 MYSQL_LIB_FILE=$(MYSQL_LIB)/libmysqlclient.so
39 MYSQL_INCLUDE=$(MYSQL_DIR)/include/mysql
40
41
42 # Nothing to configure beyond this point
43
44 base=clsql-mysql
45 source=$(base).c
46 object=$(base).o
47 shared_lib=$(base).so
48
49 all: $(shared_lib)
50
51 $(shared_lib): $(source) Makefile $(MYSQL_LIB_FILE)
52         $(CC) ${SHARED_CC_OPT} -I $(MYSQL_INCLUDE) -c $(source) -o $(object)
53         ld ${SHARED_LD_OPT} $(object) $(MYSQL_LIB_FILE) -o $(shared_lib)
54         rm $(object)
55
56 clean:
57         rm -f $(object) $(shared_lib)
58
59 realclean: clean
60         rm -f *~
61