r1714: *** 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.4 2002/04/01 17:16:15 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
21
22 SHARED_LD_OPT=-shared  # For Linux
23 #SHARED_LD_OPT=-r # For FreeBSD and Solaris
24
25 # If you are using Solaris with Sun's CC, these are the correct values
26 # for creating a shared library
27 #CC=cc
28 #SHARED_CC_OPT=-KPIC
29 #SHARED_LD_OPT=-G
30
31
32 base=c-test-fns
33
34 # Nothing to configure beyond this point
35 source=$(base).c
36 object=$(base).o
37 shared_lib=$(base).so
38 static_lib=$(base).a
39
40 all: $(shared_lib) $(static_lib)
41
42
43 $(shared_lib): $(source)
44         $(CC) ${SHARED_CC_OPT} -c $(source) -o $(object)
45         ld ${SHARED_LD_OPT} $(object) -o $(shared_lib)
46         $(AR) r $(static_lib) $(object)
47         rm $(object)
48
49 $(static_lib): $(source)
50         ${CC} -c $(source) -o $(object)
51         $(AR) r $(static_lib) $(object)
52         rm $(object)
53
54 clean:
55         rm -f $(object) $(static_lib) $(shared_lib)
56
57 realclean: clean
58         rm -f *~