09e6e396ecca354baed697be2baca658c00e70b6
[uffi.git] / tests / 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$
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         rm -f $(base).dylib $(base).dylib $(base).so $(base).o
23
24 base=uffi-c-test-lib
25 source=$(base).c
26 object=$(base).o
27 shared_lib=$(base).so
28
29 .PHONY: all
30 all: 
31         echo "you need to specify a platform"
32
33 linux: $(source) Makefile
34         gcc -fPIC -DPIC -c $(source) -o $(object)
35         gcc -shared $(object) -o $(shared_lib)
36         #gcc -shared -Wl,-soname,uffi-c-test-lib $(object) -o $(shared_lib)
37         rm $(object)
38
39 mac:
40         cc -dynamic -c $(source) -o $(object)
41         ld -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress -o $(base).dylib $(object)
42         ld -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress /usr/lib/libz.dylib -o z.dylib
43
44 mac-alt:
45         gcc -bundle -c $(source) -o $(base).bundle
46         ld -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress /usr/lib/libz.dylib -o z.bundle
47
48 solaris:
49         cc -KPIC -c $(source) -o $(object)
50         cc -G $(object) -o $(shared_lib)
51
52 aix-acl:
53         gcc -c -D_BSD -D_NO_PROTO -D_NONSTD_TYPES -D_MBI=void $(source)
54         make_shared -o $(shared_lib) $(object)