r2784: *** 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.15 2002/09/20 04:51:14 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 SUBDIRS:=
17
18 include ../Makefile.common
19
20 .PHONY: distclean
21 distclean: clean
22
23 # GCC Section
24 CC=gcc
25 SHARED_CC_OPT=-fPIC -DPIC
26
27 SHARED_LD_OPT=-shared  # For Linux (ALL) and FreeBSD (ACL)
28
29 # For MacOSX (ACL)
30 # cc -dynamic -c c-test-fns.c -o foo.o
31 # ld -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress -o 
32 # c-test-fns.dylib foo.o
33
34 # Use these for Sun's C compiler and Solaris (ACL)
35 #CC=cc
36 #SHARED_CC_OPT=-KPIC
37 #SHARED_LD_OPT=-G
38
39
40 # Nothing to configure beyond this point
41
42 base=c-test-fns
43 source=$(base).c
44 object=$(base).o
45 shared_lib=$(base).so
46
47 .PHONY: all
48 all: $(shared_lib)
49
50 $(shared_lib): $(source) Makefile
51         $(CC) ${SHARED_CC_OPT} -c $(source) -o $(object)
52         gcc ${SHARED_LD_OPT} $(object) -o $(shared_lib)
53         rm $(object)
54