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