Add iOS support
[libffi.git] / Makefile.am
1 ## Process this with automake to create Makefile.in
2
3 AUTOMAKE_OPTIONS = foreign subdir-objects
4
5 SUBDIRS = include testsuite man
6
7 EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host \
8         src/alpha/ffi.c src/alpha/osf.S src/alpha/ffitarget.h \
9         src/arm/ffi.c src/arm/sysv.S src/arm/trampoline.S src/arm/ffitarget.h \
10         src/avr32/ffi.c src/avr32/sysv.S src/avr32/ffitarget.h \
11         src/cris/ffi.c src/cris/sysv.S src/cris/ffitarget.h \
12         src/ia64/ffi.c src/ia64/ffitarget.h src/ia64/ia64_flags.h \
13         src/ia64/unix.S \
14         src/mips/ffi.c src/mips/n32.S src/mips/o32.S \
15         src/mips/ffitarget.h \
16         src/m32r/ffi.c src/m32r/sysv.S src/m32r/ffitarget.h \
17         src/m68k/ffi.c src/m68k/sysv.S src/m68k/ffitarget.h \
18         src/powerpc/ffi.c src/powerpc/sysv.S \
19         src/powerpc/linux64.S src/powerpc/linux64_closure.S \
20         src/powerpc/ppc_closure.S src/powerpc/asm.h \
21         src/powerpc/aix.S src/powerpc/darwin.S \
22         src/powerpc/aix_closure.S src/powerpc/darwin_closure.S \
23         src/powerpc/ffi_darwin.c src/powerpc/ffitarget.h \
24         src/s390/ffi.c src/s390/sysv.S src/s390/ffitarget.h \
25         src/sh/ffi.c src/sh/sysv.S src/sh/ffitarget.h \
26         src/sh64/ffi.c src/sh64/sysv.S src/sh64/ffitarget.h \
27         src/sparc/v8.S src/sparc/v9.S src/sparc/ffitarget.h \
28         src/sparc/ffi.c src/x86/darwin64.S \
29         src/x86/ffi.c src/x86/sysv.S src/x86/win32.S src/x86/win64.S \
30         src/x86/darwin.S src/x86/freebsd.S \
31         src/x86/ffi64.c src/x86/unix64.S src/x86/ffitarget.h \
32         src/pa/ffitarget.h src/pa/ffi.c src/pa/linux.S src/pa/hpux32.S \
33         src/frv/ffi.c src/frv/eabi.S src/frv/ffitarget.h \
34         src/dlmalloc.c \
35         src/moxie/ffi.c src/moxie/eabi.S \
36         libtool-version ChangeLog.libffi m4/libtool.m4 \
37         m4/lt~obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4
38
39 info_TEXINFOS = doc/libffi.texi
40
41 ## ################################################################
42
43 ##
44 ## This section is for make and multilib madness.
45 ##
46
47 # Work around what appears to be a GNU make bug handling MAKEFLAGS
48 # values defined in terms of make variables, as is the case for CC and
49 # friends when we are called from the top level Makefile.
50 AM_MAKEFLAGS = \
51         "AR_FLAGS=$(AR_FLAGS)" \
52         "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
53         "CFLAGS=$(CFLAGS)" \
54         "CXXFLAGS=$(CXXFLAGS)" \
55         "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
56         "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
57         "INSTALL=$(INSTALL)" \
58         "INSTALL_DATA=$(INSTALL_DATA)" \
59         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
60         "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
61         "JC1FLAGS=$(JC1FLAGS)" \
62         "LDFLAGS=$(LDFLAGS)" \
63         "LIBCFLAGS=$(LIBCFLAGS)" \
64         "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
65         "MAKE=$(MAKE)" \
66         "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
67         "PICFLAG=$(PICFLAG)" \
68         "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
69         "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
70         "SHELL=$(SHELL)" \
71         "exec_prefix=$(exec_prefix)" \
72         "infodir=$(infodir)" \
73         "libdir=$(libdir)" \
74         "mandir=$(mandir)" \
75         "prefix=$(prefix)" \
76         "AR=$(AR)" \
77         "AS=$(AS)" \
78         "CC=$(CC)" \
79         "CXX=$(CXX)" \
80         "LD=$(LD)" \
81         "NM=$(NM)" \
82         "RANLIB=$(RANLIB)" \
83         "DESTDIR=$(DESTDIR)"
84
85 MAKEOVERRIDES=
86
87 ACLOCAL_AMFLAGS=$(ACLOCAL_AMFLAGS) -I m4
88
89 lib_LTLIBRARIES = libffi.la
90 noinst_LTLIBRARIES = libffi_convenience.la
91
92 libffi_la_SOURCES = src/debug.c src/prep_cif.c src/types.c \
93                 src/raw_api.c src/java_raw_api.c src/closures.c
94
95 pkgconfigdir = $(libdir)/pkgconfig
96 pkgconfig_DATA = libffi.pc
97
98 nodist_libffi_la_SOURCES =
99
100 if MIPS
101 nodist_libffi_la_SOURCES += src/mips/ffi.c src/mips/o32.S src/mips/n32.S
102 endif
103 if X86
104 nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/sysv.S
105 endif
106 if X86_FREEBSD
107 nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/freebsd.S
108 endif
109 if X86_WIN32
110 nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/win32.S
111 endif
112 if X86_WIN64
113 nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/win64.S
114 endif
115 if X86_DARWIN
116 nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/darwin.S src/x86/ffi64.c src/x86/darwin64.S
117 endif
118 if SPARC
119 nodist_libffi_la_SOURCES += src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S
120 endif
121 if ALPHA
122 nodist_libffi_la_SOURCES += src/alpha/ffi.c src/alpha/osf.S
123 endif
124 if IA64
125 nodist_libffi_la_SOURCES += src/ia64/ffi.c src/ia64/unix.S
126 endif
127 if M32R
128 nodist_libffi_la_SOURCES += src/m32r/sysv.S src/m32r/ffi.c
129 endif
130 if M68K
131 nodist_libffi_la_SOURCES += src/m68k/ffi.c src/m68k/sysv.S
132 endif
133 if POWERPC
134 nodist_libffi_la_SOURCES += src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S src/powerpc/linux64.S src/powerpc/linux64_closure.S
135 endif
136 if POWERPC_AIX
137 nodist_libffi_la_SOURCES += src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S
138 endif
139 if POWERPC_DARWIN
140 nodist_libffi_la_SOURCES += src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S
141 endif
142 if POWERPC_FREEBSD
143 nodist_libffi_la_SOURCES += src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S
144 endif
145 if ARM
146 nodist_libffi_la_SOURCES += src/arm/sysv.S src/arm/ffi.c
147 if FFI_EXEC_TRAMPOLINE_TABLE
148 nodist_libffi_la_SOURCES += src/arm/trampoline.S
149 endif
150 endif
151 if AVR32
152 nodist_libffi_la_SOURCES += src/avr32/sysv.S src/avr32/ffi.c
153 endif
154 if LIBFFI_CRIS
155 nodist_libffi_la_SOURCES += src/cris/sysv.S src/cris/ffi.c
156 endif
157 if FRV
158 nodist_libffi_la_SOURCES += src/frv/eabi.S src/frv/ffi.c
159 endif
160 if S390
161 nodist_libffi_la_SOURCES += src/s390/sysv.S src/s390/ffi.c
162 endif
163 if X86_64
164 nodist_libffi_la_SOURCES += src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
165 endif
166 if SH
167 nodist_libffi_la_SOURCES += src/sh/sysv.S src/sh/ffi.c
168 endif
169 if SH64
170 nodist_libffi_la_SOURCES += src/sh64/sysv.S src/sh64/ffi.c
171 endif
172 if PA_LINUX
173 nodist_libffi_la_SOURCES += src/pa/linux.S src/pa/ffi.c
174 endif
175 if PA_HPUX
176 nodist_libffi_la_SOURCES += src/pa/hpux32.S src/pa/ffi.c
177 endif
178
179 libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
180 nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
181
182 AM_CFLAGS = -Wall -g -fexceptions
183 if FFI_DEBUG
184 # Build debug. Define FFI_DEBUG on the commandline so that, when building with
185 # MSVC, it can link against the debug CRT.
186 AM_CFLAGS += -DFFI_DEBUG
187 else
188 # Build opt.
189 AM_CFLAGS += -O2
190 endif
191
192 libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) $(AM_LTLDFLAGS)
193
194 AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
195 AM_CCASFLAGS = $(AM_CPPFLAGS)
196
197 # No install-html or install-pdf support in automake yet
198 .PHONY: install-html install-pdf
199 install-html:
200 install-pdf: