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