5 # Purpose: Makefile for CLSQL UFFI interface
6 # Programer: Kevin M. Rosenberg
7 # Date Started: Mar 2002
9 # This file, part of CLSQL, is Copyright (c) 2002-2006 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
26 ifneq ($(OS_DPKG_BUILDFLAGS),0)
27 CFLAGS:=$(CFLAGS) $(shell dpkg-buildflags --get CFLAGS)
28 LDFLAGS:=$(LDFLAGS) $(shell DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie dpkg-buildflags --get LDFLAGS | sed "s/-Wl\|,/ /ig")
35 $(shared_lib): $(source) Makefile
37 gcc -c -D_BSD -D_NO_PROTO -D_NONSTD_TYPES -D_MBI=void $(source)
38 make_shared -o $(shared_lib) $(object)
41 cc -KPIC -c $(source) -o $(object)
42 cc -G $(object) -o $(shared_lib)
44 ifneq ($(OS_DARWIN64),0)
45 cc -arch x86_64 -arch i386 -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress $(source) -o $(dylib)
46 cc -arch x86_64 -arch i386 -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress /usr/lib/libz.dylib -o z.dylib
48 ifneq ($(OS_DARWIN),0)
49 cc -arch i386 -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress $(source) -o $(dylib)
50 cc -arch i386 -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress /usr/lib/libz.dylib -o z.dylib
52 ifneq ($(OS_CYGWIN),0)
53 gcc -c $(source) -o $(object)
54 ld -shared -soname=$(base) $(LDFLAGS) $(object) -o $(shared_lib)
56 ifneq ($(OS_LINUX64),0)
57 gcc $(CFLAGS) -fPIC -DPIC -c $(source) -o $(object)
58 gcc $(LDFLAGS) -fPIC -shared -Wl,-soname=$(base) -lc $(object) -o $(shared64_lib)
60 @echo "Ensure that you have multiarch i386 build tools if you want to build 32-bit library"
61 -gcc -m32 $(CFLAGS) -fPIC -DPIC -c $(source) -o $(object)
62 -gcc -m32 $(LDFLAGS) -fPIC -shared -Wl,-soname=$(base) -lc $(object) -o $(shared_lib)
64 gcc -fPIC -DPIC -c $(source) -o $(object)
65 ld -shared -soname=$(base) -lc $(object) -o $(shared_lib)
77 @rm -f $(dylib) $(shared_lib) $(shared64_lib) $(object) z.dylib