r1715: *** 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.3 2002/04/01 17:33:49 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 AR=ar
20
21 # These variables are correct for GCC
22 # you'll need to modify these for other compilers
23 CC=gcc
24 SHARED_CC_OPT=-fpic
25
26 SHARED_LD_OPT=-shared # For Linux
27 #SHARED_LD_OPT=-r # For FreeBSD and Solaris
28
29 # If you are using Solaris, these are the correct values
30 # for creating a shared library
31 #CC=cc
32 #SHARED_CC_OPT=-KPIC
33 #SHARED_LD_OPT=-G
34
35 # Set to the directory where you have installed mysql's library
36 #MYSQL_DIR=/usr
37 MYSQL_DIR=/opt/mysql
38
39 MYSQL_LIB=$(MYSQL_DIR)/lib/mysql
40 MYSQL_LIB_FILE=$(MYSQL_LIB)/libmysqlclient.so
41 MYSQL_INCLUDE=$(MYSQL_DIR)/include/mysql
42
43 # Nothing to configure beyond this point
44
45 BASE=clsql-mysql
46 SRC=$(BASE).c
47 OBJECT=$(BASE).o
48 SHARED=$(BASE).so
49 STATIC=$(BASE).a
50
51 all: $(SHARED) $(STATIC)
52
53 $(SHARED): $(SRC) $(MYSQL_LIB_FILE)
54         $(CC) $(SHARED_CC_OPT) -I $(MYSQL_INCLUDE) -c $(SRC) -o $(OBJECT)
55         ld $(SHARED_LD_OPT) $(OBJECT) $(MYSQL_LIB_FILE) -o $(SHARED)
56         @rm $(OBJECT)
57
58 $(STATIC): $(SRC) $(MYSQL_LIB_FILE)
59         $(CC) -I $(MYSQL_INCLUDE) -c $(SRC) -o $(OBJECT)
60         $(AR) r $(STATIC) $(OBJECT)
61         @rm $(OBJECT)
62
63 clean:
64         rm -f $(SHARED) $(STATIC)
65
66 realclean: clean
67         rm -f *~
68