r1759: *** 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.7 2002/04/07 08:48:54 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 # These variables are correct for GCC
20 CC=gcc
21 SHARED_CC_OPT=-fPIC -DPIC
22 SHARED_LD_OPT=-shared
23 LD=gcc
24
25 # Use these for Sun's C compiler and Solaris (ACL)
26 #CC=cc
27 #SHARED_CC_OPT=-KPIC
28 #SHARED_LD_OPT=-G
29 #LD=ld
30
31 # Set to the directory where you have installed mysql's library
32 #MYSQL_DIR=/opt/mysql
33 #MYSQL_LIB=$(MYSQL_DIR)/lib/mysql
34 MYSQL_DIR=/usr
35 MYSQL_LIB=$(MYSQL_DIR)/lib
36
37 MYSQL_LIB_FILE=$(MYSQL_LIB)/libmysqlclient.so
38 MYSQL_INCLUDE=$(MYSQL_DIR)/include/mysql
39
40
41 # Nothing to configure beyond this point
42
43 base=clsql-mysql
44 source=$(base).c
45 object=$(base).o
46 shared_lib=$(base).so
47
48 .PHONY: all clean distclean
49
50 all: $(shared_lib)
51
52 $(shared_lib): $(source) Makefile $(MYSQL_LIB_FILE)
53         $(CC) ${SHARED_CC_OPT} -I $(MYSQL_INCLUDE) -c $(source) -o $(object)
54         $(LD) ${SHARED_LD_OPT} $(object) $(MYSQL_LIB_FILE) -o $(shared_lib)
55         @rm $(object)
56
57 clean:
58         @rm -f $(object) $(shared_lib) *~
59
60 distclean: clean
61