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