r1726: *** empty log message ***
[uffi.git] / examples / Makefile
1 # FILE IDENTIFICATION
2
3 #  Name:         Makefile
4 #  Purpose:      Makefile for UFFI examples
5 #  Programer:    Kevin M. Rosenberg
6 #  Date Started: Mar 2002
7 #
8 #  CVS Id:   $Id: Makefile,v 1.7 2002/04/03 00:57:48 kevin Exp $
9 #
10 # This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
11 #
12 # UFFI users are granted the rights to distribute and use this software
13 # as governed by the terms of the Lisp Lesser GNU Public License
14 # (http://opensource.franz.com/preamble.html), also known as the LLGPL.
15
16 AR=ar
17
18 # These variables are correct for GCC
19 CC=gcc
20 #SHARED_CC_OPT=-fPIC # For Linux (ACL) and all platfroms (CMUCL)
21 SHARED_CC_OPT=-fPIC -DPIC # For FreeBSD (ACL)
22
23 #SHARED_LD_OPT=-shared  # For Linux
24 #SHARED_LD_OPT=-r # For Linux and Solaris (CMUCL)
25 SHARED_LD_OPT=-Bshareable -Bdynamic  # For FreeBSD (ACL)
26
27 # If you are using Solaris with Sun's CC, these are the correct values
28 # for creating a shared library
29 #CC=cc
30 #SHARED_CC_OPT=-KPIC
31 #SHARED_LD_OPT=-G
32
33
34 base=c-test-fns
35
36 # Nothing to configure beyond this point
37 source=$(base).c
38 object=$(base).o
39 shared_lib=$(base).so
40 static_lib=$(base).a
41
42 all: $(shared_lib) $(static_lib)
43
44 $(shared_lib): $(source)
45         $(CC) ${SHARED_CC_OPT} -c $(source) -o $(object)
46         ld ${SHARED_LD_OPT} $(object) -o $(shared_lib)
47         $(AR) r $(static_lib) $(object)
48         rm $(object)
49
50 $(static_lib): $(source)
51         ${CC} -c -fpic $(source) -o $(object)
52         $(AR) r $(static_lib) $(object)
53         rm $(object)
54
55 clean:
56         rm -f $(object) $(static_lib) $(shared_lib)
57
58 realclean: clean
59         rm -f *~