r11058: 29 Aug 2006 Kevin Rosenberg <kevin@rosenberg.net>
[clsql.git] / uffi / Makefile
1 #!/usr/bin/make
2 # FILE IDENTIFICATION
3 #
4 #  Name:         Makefile
5 #  Purpose:      Makefile for CLSQL UFFI interface
6 #  Programer:    Kevin M. Rosenberg
7 #  Date Started: Mar 2002
8 #
9 #  CVS Id:   $Id$
10 #
11 # This file, part of CLSQL, is Copyright (c) 2002-2006 by Kevin M. Rosenberg
12 #
13 # CLSQL users are granted the rights to distribute and use this software
14 # as governed by the terms of the Lisp Lesser GNU Public License
15 # (http://opensource.franz.com/preamble.html), also known as the LLGPL.
16
17 SUBDIRS=
18
19 include ../Makefile.common
20
21 base=clsql_uffi
22 source=$(base).c
23 object=$(base).o
24 shared_lib=$(base).so
25
26 .PHONY: all
27 all: $(shared_lib)
28
29 $(shared_lib): $(source) Makefile
30 ifneq ($(OS_AIX),0)
31         gcc -c -D_BSD -D_NO_PROTO -D_NONSTD_TYPES -D_MBI=void $(source)
32         make_shared -o $(shared_lib) $(object)
33 else
34   ifneq ($(OS_SUNOS),0)
35         cc -KPIC -c $(source) -o $(object)
36         cc -G $(object) -o $(shared_lib)
37   else
38     ifneq ($(OS_DARWIN),0)
39         cc -dynamic -c $(source) -o $(object)
40         ld -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress -o $(base).dylib $(object)
41         ld -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress /usr/lib/libz.dylib -o z.dylib
42     else
43       ifneq ($(OS_CYGWIN),0)
44         gcc -c $(source) -o $(object)
45         ld -shared -soname=$(base) $(LDFLAGS) $(object) -o $(shared_lib)
46       else
47         gcc -fPIC -DPIC -c $(source) -o $(object)
48         ld -shared -soname=$(base) -lc $(object) -o $(shared_lib)
49       endif
50     endif
51   endif
52 endif
53         rm $(object)
54
55
56 .PHONY: distclean
57 distclean: clean
58         rm -f $(base).dylib $(base).dylib $(base).so $(base).o
59
60
61
62