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