Automated commit for upstream build of version 4.1.1
[clsql/s11.git] / uffi / Makefile
blobc1af3f8f6760770b16bdf95da5ac05b45a1618d7
1 #!/usr/bin/make
2 # FILE IDENTIFICATION
4 # Name: Makefile
5 # Purpose: Makefile for CLSQL UFFI interface
6 # Programer: Kevin M. Rosenberg
7 # Date Started: Mar 2002
9 # CVS Id: $Id$
11 # This file, part of CLSQL, is Copyright (c) 2002-2006 by Kevin M. Rosenberg
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.
17 SUBDIRS=
19 include ../Makefile.common
21 base=clsql_uffi
22 source=$(base).c
23 object=$(base).o
24 shared_lib=$(base).so
26 .PHONY: all
27 all: $(shared_lib)
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)
56 .PHONY: distclean
57 distclean: clean
58 rm -f $(base).dylib $(base).dylib $(base).so $(base).o