r1708: *** 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.3 2002/03/31 23:05:07 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 # These variables are correct for GCC
17 # you'll need to modify these for other compilers
18 CC=gcc
19 SHARED_CC_OPT=-fpic
20 SHARED_LD_OPT=-shared
21 AR=ar
22
23 # If you are using Solaris, these are the correct values
24 # for creating a shared library
25 #CC=cc
26 #SHARED_CC_OPT=-KPIC
27 #SHARED_LD_OPT=-G
28
29
30 base=c-test-fns
31
32 # Nothing to configure beyond this point
33 source=$(base).c
34 object=$(base).o
35 shared_lib=$(base).so
36 static_lib=$(base).a
37
38 all: $(shared_lib) $(static_lib)
39
40
41 $(shared_lib): $(source)
42         $(CC) ${SHARED_CC_OPT} -c $(source) -o $(object)
43         ld ${SHARED_LD_OPT} $(object) -o $(shared_lib)
44         $(AR) r $(static_lib) $(object)
45         rm $(object)
46
47 $(static_lib): $(source)
48         ${CC} -c $(source) -o $(object)
49         $(AR) r $(static_lib) $(object)
50         rm $(object)
51
52 clean:
53         rm -f $(object) $(static_lib) $(shared_lib)
54
55 realclean: clean
56         rm -f *~