Update Makefile for new darwin scripts
[libffi.git] / Makefile.am
1 ## Process this with automake to create Makefile.in
2
3 AUTOMAKE_OPTIONS = foreign subdir-objects
4
5 ACLOCAL_AMFLAGS = -I m4
6
7 SUBDIRS = include testsuite man
8
9 EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host       \
10          src/aarch64/ffi.c src/aarch64/ffitarget.h src/aarch64/sysv.S   \
11          src/alpha/ffi.c src/alpha/osf.S                        \
12          src/alpha/ffitarget.h src/arc/ffi.c src/arc/arcompact.S        \
13          src/arc/ffitarget.h src/arm/ffi.c src/arm/sysv.S               \
14          src/arm/ffitarget.h src/avr32/ffi.c src/avr32/sysv.S           \
15          src/avr32/ffitarget.h src/cris/ffi.c src/cris/sysv.S           \
16          src/cris/ffitarget.h src/ia64/ffi.c src/ia64/ffitarget.h       \
17          src/ia64/ia64_flags.h src/ia64/unix.S src/mips/ffi.c           \
18          src/mips/n32.S src/mips/o32.S src/metag/ffi.c                  \
19          src/metag/ffitarget.h src/metag/sysv.S src/moxie/ffi.c         \
20          src/moxie/ffitarget.h src/moxie/eabi.S src/mips/ffitarget.h    \
21          src/m32r/ffi.c src/m32r/sysv.S src/m32r/ffitarget.h            \
22          src/m68k/ffi.c src/m68k/sysv.S src/m68k/ffitarget.h            \
23          src/m88k/ffi.c src/m88k/obsd.S src/m88k/ffitarget.h            \
24          src/microblaze/ffi.c src/microblaze/sysv.S                     \
25          src/microblaze/ffitarget.h                                     \
26          src/nios2/ffi.c src/nios2/ffitarget.h src/nios2/sysv.S         \
27          src/powerpc/ffi.c src/powerpc/ffi_powerpc.h                    \
28          src/powerpc/ffi_sysv.c src/powerpc/ffi_linux64.c               \
29          src/powerpc/sysv.S src/powerpc/linux64.S                       \
30          src/powerpc/linux64_closure.S src/powerpc/ppc_closure.S        \
31          src/powerpc/asm.h src/powerpc/aix.S src/powerpc/darwin.S       \
32          src/powerpc/aix_closure.S src/powerpc/darwin_closure.S         \
33          src/powerpc/ffi_darwin.c src/powerpc/ffitarget.h               \
34          src/s390/ffi.c src/s390/sysv.S src/s390/ffitarget.h            \
35          src/sh/ffi.c src/sh/sysv.S src/sh/ffitarget.h src/sh64/ffi.c   \
36          src/sh64/sysv.S src/sh64/ffitarget.h src/sparc/v8.S            \
37          src/sparc/v9.S src/sparc/ffitarget.h src/sparc/ffi.c           \
38          src/x86/darwin64.S src/x86/ffi.c src/x86/sysv.S                \
39          src/x86/win32.S src/x86/darwin.S src/x86/win64.S               \
40          src/x86/freebsd.S src/x86/ffi64.c src/x86/unix64.S             \
41          src/x86/ffitarget.h src/pa/ffitarget.h src/pa/ffi.c            \
42          src/pa/linux.S src/pa/hpux32.S src/frv/ffi.c src/bfin/ffi.c    \
43          src/bfin/ffitarget.h src/bfin/sysv.S src/frv/eabi.S            \
44          src/frv/ffitarget.h src/dlmalloc.c src/tile/ffi.c              \
45          src/tile/ffitarget.h src/tile/tile.S libtool-version           \
46          src/vax/ffi.c src/vax/ffitarget.h src/vax/elfbsd.S             \
47          src/xtensa/ffitarget.h src/xtensa/ffi.c src/xtensa/sysv.S      \
48          ChangeLog.libffi m4/libtool.m4 m4/lt~obsolete.m4               \
49          m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4                  \
50          m4/ltversion.m4 src/arm/gentramp.sh src/debug.c msvcc.sh       \
51          generate-darwin-source-and-headers.py                          \
52          libffi.xcodeproj/project.pbxproj src/arm/trampoline.S          \
53          libtool-ldflags
54
55 info_TEXINFOS = doc/libffi.texi
56
57 ## ################################################################
58
59 ##
60 ## This section is for make and multilib madness.
61 ##
62
63 # Work around what appears to be a GNU make bug handling MAKEFLAGS
64 # values defined in terms of make variables, as is the case for CC and
65 # friends when we are called from the top level Makefile.
66 AM_MAKEFLAGS = \
67         "AR_FLAGS=$(AR_FLAGS)" \
68         "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
69         "CFLAGS=$(CFLAGS)" \
70         "CXXFLAGS=$(CXXFLAGS)" \
71         "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
72         "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
73         "INSTALL=$(INSTALL)" \
74         "INSTALL_DATA=$(INSTALL_DATA)" \
75         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
76         "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
77         "JC1FLAGS=$(JC1FLAGS)" \
78         "LDFLAGS=$(LDFLAGS)" \
79         "LIBCFLAGS=$(LIBCFLAGS)" \
80         "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
81         "MAKE=$(MAKE)" \
82         "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
83         "PICFLAG=$(PICFLAG)" \
84         "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
85         "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
86         "SHELL=$(SHELL)" \
87         "exec_prefix=$(exec_prefix)" \
88         "infodir=$(infodir)" \
89         "libdir=$(libdir)" \
90         "mandir=$(mandir)" \
91         "prefix=$(prefix)" \
92         "AR=$(AR)" \
93         "AS=$(AS)" \
94         "CC=$(CC)" \
95         "CXX=$(CXX)" \
96         "LD=$(LD)" \
97         "NM=$(NM)" \
98         "RANLIB=$(RANLIB)" \
99         "DESTDIR=$(DESTDIR)"
100
101 # Subdir rules rely on $(FLAGS_TO_PASS)
102 FLAGS_TO_PASS = $(AM_MAKEFLAGS)
103
104 MAKEOVERRIDES=
105
106 toolexeclib_LTLIBRARIES = libffi.la
107 noinst_LTLIBRARIES = libffi_convenience.la
108
109 libffi_la_SOURCES = src/prep_cif.c src/types.c \
110                 src/raw_api.c src/java_raw_api.c src/closures.c
111
112 pkgconfigdir = $(libdir)/pkgconfig
113 pkgconfig_DATA = libffi.pc
114
115 nodist_libffi_la_SOURCES =
116
117 if FFI_DEBUG
118 nodist_libffi_la_SOURCES += src/debug.c
119 endif
120
121 if MIPS
122 nodist_libffi_la_SOURCES += src/mips/ffi.c src/mips/o32.S src/mips/n32.S
123 endif
124 if BFIN
125 nodist_libffi_la_SOURCES += src/bfin/ffi.c src/bfin/sysv.S
126 endif
127 if X86
128 nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/sysv.S
129 endif
130 if X86_FREEBSD
131 nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/freebsd.S
132 endif
133 if X86_WIN32
134 nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/win32.S
135 endif
136 if X86_WIN64
137 nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/win64.S
138 endif
139 if X86_DARWIN
140 nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/darwin.S src/x86/ffi64.c src/x86/darwin64.S
141 endif
142 if SPARC
143 nodist_libffi_la_SOURCES += src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S
144 endif
145 if ALPHA
146 nodist_libffi_la_SOURCES += src/alpha/ffi.c src/alpha/osf.S
147 endif
148 if IA64
149 nodist_libffi_la_SOURCES += src/ia64/ffi.c src/ia64/unix.S
150 endif
151 if M32R
152 nodist_libffi_la_SOURCES += src/m32r/sysv.S src/m32r/ffi.c
153 endif
154 if M68K
155 nodist_libffi_la_SOURCES += src/m68k/ffi.c src/m68k/sysv.S
156 endif
157 if M88K
158 nodist_libffi_la_SOURCES += src/m88k/ffi.c src/m88k/obsd.S
159 endif
160 if MOXIE
161 nodist_libffi_la_SOURCES += src/moxie/ffi.c src/moxie/eabi.S
162 endif
163 if MICROBLAZE
164 nodist_libffi_la_SOURCES += src/microblaze/ffi.c src/microblaze/sysv.S
165 endif
166 if NIOS2
167 nodist_libffi_la_SOURCES += src/nios2/sysv.S src/nios2/ffi.c
168 endif
169 if POWERPC
170 nodist_libffi_la_SOURCES += src/powerpc/ffi.c src/powerpc/ffi_sysv.c src/powerpc/ffi_linux64.c src/powerpc/sysv.S src/powerpc/ppc_closure.S src/powerpc/linux64.S src/powerpc/linux64_closure.S
171 endif
172 if POWERPC_AIX
173 nodist_libffi_la_SOURCES += src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S
174 endif
175 if POWERPC_DARWIN
176 nodist_libffi_la_SOURCES += src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S
177 endif
178 if POWERPC_FREEBSD
179 nodist_libffi_la_SOURCES += src/powerpc/ffi.c src/powerpc/ffi_sysv.c src/powerpc/sysv.S src/powerpc/ppc_closure.S
180 endif
181 if AARCH64
182 nodist_libffi_la_SOURCES += src/aarch64/sysv.S src/aarch64/ffi.c
183 endif
184 if ARC
185 nodist_libffi_la_SOURCES += src/arc/arcompact.S src/arc/ffi.c
186 endif
187 if ARM
188 nodist_libffi_la_SOURCES += src/arm/sysv.S src/arm/ffi.c
189 if FFI_EXEC_TRAMPOLINE_TABLE
190 nodist_libffi_la_SOURCES += src/arm/trampoline.S
191 endif
192 endif
193 if AVR32
194 nodist_libffi_la_SOURCES += src/avr32/sysv.S src/avr32/ffi.c
195 endif
196 if LIBFFI_CRIS
197 nodist_libffi_la_SOURCES += src/cris/sysv.S src/cris/ffi.c
198 endif
199 if FRV
200 nodist_libffi_la_SOURCES += src/frv/eabi.S src/frv/ffi.c
201 endif
202 if S390
203 nodist_libffi_la_SOURCES += src/s390/sysv.S src/s390/ffi.c
204 endif
205 if X86_64
206 nodist_libffi_la_SOURCES += src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
207 endif
208 if SH
209 nodist_libffi_la_SOURCES += src/sh/sysv.S src/sh/ffi.c
210 endif
211 if SH64
212 nodist_libffi_la_SOURCES += src/sh64/sysv.S src/sh64/ffi.c
213 endif
214 if PA_LINUX
215 nodist_libffi_la_SOURCES += src/pa/linux.S src/pa/ffi.c
216 endif
217 if PA_HPUX
218 nodist_libffi_la_SOURCES += src/pa/hpux32.S src/pa/ffi.c
219 endif
220 if TILE
221 nodist_libffi_la_SOURCES += src/tile/tile.S src/tile/ffi.c
222 endif
223 if XTENSA
224 nodist_libffi_la_SOURCES += src/xtensa/sysv.S src/xtensa/ffi.c
225 endif
226 if METAG
227 nodist_libffi_la_SOURCES += src/metag/sysv.S src/metag/ffi.c
228 endif
229 if VAX
230 nodist_libffi_la_SOURCES += src/vax/elfbsd.S src/vax/ffi.c
231 endif
232
233 libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
234 nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
235
236 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/libtool-ldflags $(LDFLAGS))
237
238 AM_CFLAGS =
239 if FFI_DEBUG
240 # Build debug. Define FFI_DEBUG on the commandline so that, when building with
241 # MSVC, it can link against the debug CRT.
242 AM_CFLAGS += -DFFI_DEBUG
243 endif
244
245 libffi_la_LDFLAGS = -no-undefined -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) $(AM_LTLDFLAGS)
246
247 AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
248 AM_CCASFLAGS = $(AM_CPPFLAGS)
249