add ffi_get_struct_offsets
[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                      \
10         ChangeLog.libffi ChangeLog.libffi-3.1                           \
11         m4/libtool.m4 m4/lt~obsolete.m4                                 \
12          m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4                  \
13          m4/ltversion.m4 src/debug.c msvcc.sh                           \
14         generate-darwin-source-and-headers.py                           \
15         libffi.xcodeproj/project.pbxproj                                \
16         libtool-ldflags
17
18
19 info_TEXINFOS =
20 if BUILD_DOCS
21 #info_TEXINFOS += doc/libffi.texi
22 endif
23
24 ## ################################################################
25
26 ##
27 ## This section is for make and multilib madness.
28 ##
29
30 # Work around what appears to be a GNU make bug handling MAKEFLAGS
31 # values defined in terms of make variables, as is the case for CC and
32 # friends when we are called from the top level Makefile.
33 AM_MAKEFLAGS = \
34         'AR_FLAGS=$(AR_FLAGS)' \
35         'CC_FOR_BUILD=$(CC_FOR_BUILD)' \
36         'CFLAGS=$(CFLAGS)' \
37         'CXXFLAGS=$(CXXFLAGS)' \
38         'CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)' \
39         'CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)' \
40         'INSTALL=$(INSTALL)' \
41         'INSTALL_DATA=$(INSTALL_DATA)' \
42         'INSTALL_PROGRAM=$(INSTALL_PROGRAM)' \
43         'INSTALL_SCRIPT=$(INSTALL_SCRIPT)' \
44         'JC1FLAGS=$(JC1FLAGS)' \
45         'LDFLAGS=$(LDFLAGS)' \
46         'LIBCFLAGS=$(LIBCFLAGS)' \
47         'LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)' \
48         'MAKE=$(MAKE)' \
49         'MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)' \
50         'PICFLAG=$(PICFLAG)' \
51         'PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)' \
52         'RUNTESTFLAGS=$(RUNTESTFLAGS)' \
53         'SHELL=$(SHELL)' \
54         'exec_prefix=$(exec_prefix)' \
55         'infodir=$(infodir)' \
56         'libdir=$(libdir)' \
57         'mandir=$(mandir)' \
58         'prefix=$(prefix)' \
59         'AR=$(AR)' \
60         'AS=$(AS)' \
61         'CC=$(CC)' \
62         'CXX=$(CXX)' \
63         'LD=$(LD)' \
64         'NM=$(NM)' \
65         'RANLIB=$(RANLIB)' \
66         'DESTDIR=$(DESTDIR)'
67
68 # Subdir rules rely on $(FLAGS_TO_PASS)
69 FLAGS_TO_PASS = $(AM_MAKEFLAGS)
70
71 MAKEOVERRIDES=
72
73 pkgconfigdir = $(libdir)/pkgconfig
74 pkgconfig_DATA = libffi.pc
75
76 toolexeclib_LTLIBRARIES = libffi.la
77 noinst_LTLIBRARIES = libffi_convenience.la
78
79 libffi_la_SOURCES = src/prep_cif.c src/types.c \
80                 src/raw_api.c src/java_raw_api.c src/closures.c
81
82 if FFI_DEBUG
83 libffi_la_SOURCES += src/debug.c
84 endif
85
86 noinst_HEADERS = \
87         src/aarch64/ffitarget.h src/aarch64/internal.h                  \
88         src/alpha/ffitarget.h src/alpha/internal.h                      \
89         src/arc/ffitarget.h                                             \
90         src/arm/ffitarget.h src/arm/internal.h                          \
91         src/avr32/ffitarget.h                                           \
92         src/bfin/ffitarget.h                                            \
93         src/cris/ffitarget.h                                            \
94         src/frv/ffitarget.h                                             \
95         src/ia64/ffitarget.h src/ia64/ia64_flags.h                      \
96         src/m32r/ffitarget.h                                            \
97         src/m68k/ffitarget.h                                            \
98         src/m88k/ffitarget.h                                            \
99         src/metag/ffitarget.h                                           \
100         src/microblaze/ffitarget.h                                      \
101         src/mips/ffitarget.h                                            \
102         src/moxie/ffitarget.h                                           \
103         src/nios2/ffitarget.h                                           \
104         src/or1k/ffitarget.h                                            \
105         src/pa/ffitarget.h                                              \
106         src/powerpc/ffitarget.h src/powerpc/asm.h src/powerpc/ffi_powerpc.h \
107         src/s390/ffitarget.h                                            \
108         src/sh/ffitarget.h                                              \
109         src/sh64/ffitarget.h                                            \
110         src/sparc/ffitarget.h src/sparc/internal.h                      \
111         src/tile/ffitarget.h                                            \
112         src/vax/ffitarget.h                                             \
113         src/x86/ffitarget.h src/x86/internal.h src/x86/internal64.h     \
114         src/xtensa/ffitarget.h                                          \
115         src/dlmalloc.c
116
117 EXTRA_libffi_la_SOURCES = \
118         src/aarch64/ffi.c src/aarch64/sysv.S                            \
119         src/alpha/ffi.c src/alpha/osf.S                                 \
120         src/arc/ffi.c src/arc/arcompact.S                               \
121         src/arm/ffi.c src/arm/sysv.S                                    \
122         src/avr32/ffi.c src/avr32/sysv.S                                \
123         src/bfin/ffi.c src/bfin/sysv.S                                  \
124         src/cris/ffi.c src/cris/sysv.S                                  \
125         src/frv/ffi.c src/frv/eabi.S                                    \
126         src/ia64/ffi.c src/ia64/unix.S                                  \
127         src/m32r/ffi.c src/m32r/sysv.S                                  \
128         src/m68k/ffi.c src/m68k/sysv.S                                  \
129         src/m88k/ffi.c src/m88k/obsd.S                                  \
130         src/metag/ffi.c src/metag/sysv.S                                \
131         src/microblaze/ffi.c src/microblaze/sysv.S                      \
132         src/mips/ffi.c src/mips/o32.S src/mips/n32.S                    \
133         src/moxie/ffi.c src/moxie/eabi.S                                \
134         src/nios2/ffi.c src/nios2/sysv.S                                \
135         src/or1k/ffi.c src/or1k/sysv.S                                  \
136         src/pa/ffi.c src/pa/linux.S src/pa/hpux32.S                     \
137         src/powerpc/ffi.c src/powerpc/ffi_sysv.c src/powerpc/ffi_linux64.c \
138          src/powerpc/sysv.S src/powerpc/linux64.S                       \
139          src/powerpc/linux64_closure.S src/powerpc/ppc_closure.S        \
140          src/powerpc/aix.S src/powerpc/darwin.S src/powerpc/aix_closure.S \
141          src/powerpc/darwin_closure.S src/powerpc/ffi_darwin.c          \
142         src/s390/ffi.c src/s390/sysv.S                                  \
143         src/sh/ffi.c src/sh/sysv.S                                      \
144         src/sh64/ffi.c src/sh64/sysv.S                                  \
145         src/sparc/ffi.c src/sparc/ffi64.c src/sparc/v8.S src/sparc/v9.S \
146         src/tile/ffi.c src/tile/tile.S                                  \
147         src/vax/ffi.c src/vax/elfbsd.S                                  \
148         src/x86/ffi.c src/x86/sysv.S                                    \
149          src/x86/ffiw64.c src/x86/win64.S                               \
150          src/x86/ffi64.c src/x86/unix64.S                               \
151         src/xtensa/ffi.c src/xtensa/sysv.S
152
153 TARGET_OBJ = @TARGET_OBJ@
154 libffi_la_LIBADD = $(TARGET_OBJ)
155 libffi_la_DEPENDENCIES = $(TARGET_OBJ)
156
157 libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
158 EXTRA_libffi_convenience_la_SOURCES = $(EXTRA_libffi_la_SOURCES)
159 libffi_convenience_la_LIBADD = $(libffi_la_LIBADD)
160 libffi_convenience_la_DEPENDENCIES = $(libffi_la_DEPENDENCIES)
161 nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
162
163 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/libtool-ldflags $(LDFLAGS))
164
165 AM_CFLAGS =
166 if FFI_DEBUG
167 # Build debug. Define FFI_DEBUG on the commandline so that, when building with
168 # MSVC, it can link against the debug CRT.
169 AM_CFLAGS += -DFFI_DEBUG
170 endif
171
172 libffi_la_LDFLAGS = -no-undefined -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) $(AM_LTLDFLAGS)
173
174 AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
175 AM_CCASFLAGS = $(AM_CPPFLAGS)
176
177 dist-hook:
178         if [ -d $(top_srcdir)/.git ] ; then (cd $(top_srcdir); git log --no-decorate) ; else echo 'See git log for history.' ; fi > $(distdir)/ChangeLog