5 # Purpose: Makefile for CLSQL MySQL interface
6 # Programer: Kevin M. Rosenberg
7 # Date Started: Mar 2002
9 # This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
11 # CLSQL users are granted the rights to distribute and use this software
12 # as governed by the terms of the Lisp Lesser GNU Public License
13 # (http://opensource.franz.com/preamble.html), also known as the LLGPL.
17 include ../Makefile.common
23 shared64_lib=$(base)64.so
29 CFLAGS=-I /usr/local/include/mysql -I /usr/include/mysql -I /sw/include/mysql -I /opt/local/include/mysql -I /opt/local/include/mysql5/mysql -I /usr/local/mysql/include
30 LDFLAGS=-L/usr/local/lib64/mysql -L/usr/local/mysql/lib32 -L/usr/local/lib/mysql -L/usr/lib/mysql -L/sw/lib -L/opt/local/lib/mysql -L/opt/local/lib/mysql5/mysql -L/usr/local/mysql/lib -L/usr/lib/gcc/i686-pc-cygwin/3.4.4 -lmysqlclient -lz -lc
32 CFLAGS32=-I /usr/local/include/mysql -I /usr/include/mysql -I /sw/include/mysql -I /opt/local/include/mysql -I /opt/local/include/mysql5/mysql -I /usr/local/mysql/include -m32
33 LDFLAGS32=-L/lib32 -L/usr/lib32 -melf_i386 -lmysqlclient -lz -lc
35 ifneq ($(OS_CYGWIN),0)
36 CFLAGS=-I /cygdrive/c/Program\ Files/MySQL/MySQL\ Server\ 5.0/include
37 LDFLAGS=-L/usr/local/lib64/mysql -L/usr/local/lib/mysql -L/usr/lib/mysql -L/sw/lib -L/opt/local/lib/mysql -L/usr/lib/gcc/i686-pc-cygwin/3.4.4 -lmysqlclient -lpthread -lz -lm -lgcc -lc
40 $(shared_lib): $(source) Makefile
42 gcc $(CFLAGS) -c -D_BSD -D_NO_PROTO -D_NONSTD_TYPES -D_MBI=void $(source)
43 make_shared $(LDFLAGS) -o $(shared_lib) $(object)
46 cc $(CFLAGS) -KPIC -c $(source) -o $(object)
47 cc -G $(object) $(LDFLAGS) -o $(shared_lib)
49 ifneq ($(OS_DARWIN),0)
50 cc $(CFLAGS) -dynamic -c $(source) -o $(object)
51 ld -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress -o $(base).dylib $(object)
52 ld -bundle /usr/lib/bundle1.o $(LDFLAGS) -flat_namespace -undefined suppress /usr/lib/libz.dylib -o z.dylib
54 ifneq ($(OS_CYGWIN),0)
55 gcc $(CFLAGS) -DWIN32 -c $(source) -o $(object)
56 ld -shared -soname=$(base) $(object) $(LDFLAGS) -o $(shared_lib)
58 ifneq ($(OS_LINUX64),0)
59 gcc $(CFLAGS) -fPIC -c $(source) -o $(object)
60 ld -shared -soname=$(base) $(object) $(LDFLAGS) -o $(shared64_lib)
62 @echo "Ensure that you have multiarch i386 build tools and libraries if you want to build 32-bit library"
63 -gcc $(CFLAGS32) -fPIC -c $(source) -o $(object)
64 -ld -shared -soname=$(base) $(object) $(LDFLAGS32) -o $(shared_lib)
66 gcc $(CFLAGS) -fPIC -c $(source) -o $(object)
67 ld -shared -soname=$(base) $(object) $(LDFLAGS) -o $(shared_lib)
77 rm -f $(base).dylib $(base).dylib $(base).so $(base).o