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