Commit the local DARCS CFFI repo, as well as update to today.
[CommonLispStat.git] / external / cffi.darcs / _darcs / pristine / tests / Makefile
blob469fcb9c107719670255c12e7004ae961e2b0f20
1 # -*- Mode: Makefile; tab-width: 3; indent-tabs-mode: t -*-
3 # Makefile --- Make targets for various tasks.
5 # Copyright (C) 2005, James Bielman <jamesjb@jamesjb.com>
7 # Permission is hereby granted, free of charge, to any person
8 # obtaining a copy of this software and associated documentation
9 # files (the "Software"), to deal in the Software without
10 # restriction, including without limitation the rights to use, copy,
11 # modify, merge, publish, distribute, sublicense, and/or sell copies
12 # of the Software, and to permit persons to whom the Software is
13 # furnished to do so, subject to the following conditions:
15 # The above copyright notice and this permission notice shall be
16 # included in all copies or substantial portions of the Software.
18 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22 # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23 # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 # DEALINGS IN THE SOFTWARE.
28 OSTYPE = $(shell uname)
30 CC := gcc
31 CFLAGS := -Wall -std=c99 -pedantic
32 SHLIB_CFLAGS := -shared
33 SHLIB_EXT := .so
35 ifneq ($(if $(findstring $(OSTYPE),Linux FreeBSD),OK), OK)
36 ifeq ($(OSTYPE), Darwin)
37 SHLIB_CFLAGS := -bundle
38 else
39 ifeq ($(OSTYPE), SunOS)
40 CFLAGS := -c -Wall -std=c99 -pedantic
41 else
42 # Let's assume this is win32
43 SHLIB_EXT := .dll
44 endif
45 endif
46 endif
48 ARCH = $(shell uname -m)
50 ifneq ($(ARCH), x86_64)
51 CFLAGS += -lm
52 endif
54 ifeq ($(ARCH), x86_64)
55 CFLAGS += -fPIC
56 endif
58 # Are all G5s ppc970s?
59 ifeq ($(ARCH), ppc970)
60 CFLAGS += -m64
61 endif
63 SHLIBS = libtest$(SHLIB_EXT) libtest2$(SHLIB_EXT)
65 ifeq ($(ARCH), x86_64)
66 SHLIBS += libtest32$(SHLIB_EXT) libtest2_32$(SHLIB_EXT)
67 endif
69 shlibs: $(SHLIBS)
71 libtest$(SHLIB_EXT): libtest.c
72 $(CC) -o $@ $(SHLIB_CFLAGS) $(CFLAGS) $<
74 libtest2$(SHLIB_EXT): libtest2.c
75 $(CC) -o $@ $(SHLIB_CFLAGS) $(CFLAGS) $<
77 ifeq ($(ARCH), x86_64)
78 libtest32$(SHLIB_EXT): libtest.c
79 $(CC) -m32 -o $@ $(SHLIB_CFLAGS) $(CFLAGS) $<
81 libtest2_32$(SHLIB_EXT): libtest2.c
82 $(CC) -m32 -o $@ $(SHLIB_CFLAGS) $(CFLAGS) $<
83 endif
85 clean:
86 rm -f *.so *.dylib *.dll *.bundle
88 # vim: ft=make ts=3 noet