r1724: *** 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.6 2002/04/03 00:31:32 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)
41
42 $(shared_lib): $(source)
43         $(CC) ${SHARED_CC_OPT} -c $(source) -o $(object)
44         ld ${SHARED_LD_OPT} $(object) -o $(shared_lib)
45         $(AR) r $(static_lib) $(object)
46         rm $(object)
47
48 $(static_lib): $(source)
49         ${CC} -c $(source) -o $(object)
50         $(AR) r $(static_lib) $(object)
51         rm $(object)
52
53 clean:
54         rm -f $(object) $(static_lib) $(shared_lib)
55
56 realclean: clean
57         rm -f *~