blob: 512d53623eed5f8951a99971a2427d339761214c [file] [log] [blame]
Anthony Greenc6dddbd2009-10-04 08:11:33 -04001## Process this with automake to create Makefile.in
2
3AUTOMAKE_OPTIONS = foreign subdir-objects
Anthony Greenc6dddbd2009-10-04 08:11:33 -04004
Anthony Greened6ae952013-02-07 16:43:36 -05005ACLOCAL_AMFLAGS = -I m4
6
Anthony Greenc6dddbd2009-10-04 08:11:33 -04007SUBDIRS = include testsuite man
Tom Tromey6dd5fd52016-02-22 15:34:39 -07008if BUILD_DOCS
9## This hack is needed because it doesn't seem possible to make a
10## conditional info_TEXINFOS in Automake. At least Automake 1.14
11## either gives errors -- if this attempted in the most
12## straightforward way -- or simply unconditionally tries to build the
13## info file.
14SUBDIRS += doc
15endif
Anthony Greenc6dddbd2009-10-04 08:11:33 -040016
Josh Tripletta86bd312014-03-16 06:58:59 -070017EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj \
Richard Henderson5d69d572014-11-13 13:50:39 +010018 ChangeLog.libffi ChangeLog.libffi-3.1 \
19 m4/libtool.m4 m4/lt~obsolete.m4 \
Anthony Green9c00a3f2012-10-12 16:46:06 -040020 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 \
Richard Hendersona4b785e2014-10-17 02:07:32 -040021 m4/ltversion.m4 src/debug.c msvcc.sh \
Richard Henderson5d69d572014-11-13 13:50:39 +010022 generate-darwin-source-and-headers.py \
23 libffi.xcodeproj/project.pbxproj \
24 libtool-ldflags
Anthony Green3b7efa42011-08-15 13:25:13 -040025
Moritz Angermann6b6df1a2017-10-01 12:37:53 +080026# local.exp is generated by configure
Moritz Angermann6cf0dea2017-10-02 10:20:16 +080027DISTCLEANFILES = local.exp
Havard Grafffa7a2572015-05-12 10:45:13 +020028
Anthony Greenc6dddbd2009-10-04 08:11:33 -040029## ################################################################
30
31##
32## This section is for make and multilib madness.
33##
34
35# Work around what appears to be a GNU make bug handling MAKEFLAGS
36# values defined in terms of make variables, as is the case for CC and
37# friends when we are called from the top level Makefile.
38AM_MAKEFLAGS = \
Ryan VanderMeulen46c5d3c2014-03-16 21:16:08 -040039 'AR_FLAGS=$(AR_FLAGS)' \
40 'CC_FOR_BUILD=$(CC_FOR_BUILD)' \
41 'CFLAGS=$(CFLAGS)' \
42 'CXXFLAGS=$(CXXFLAGS)' \
43 'CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)' \
44 'CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)' \
45 'INSTALL=$(INSTALL)' \
46 'INSTALL_DATA=$(INSTALL_DATA)' \
47 'INSTALL_PROGRAM=$(INSTALL_PROGRAM)' \
48 'INSTALL_SCRIPT=$(INSTALL_SCRIPT)' \
49 'JC1FLAGS=$(JC1FLAGS)' \
50 'LDFLAGS=$(LDFLAGS)' \
51 'LIBCFLAGS=$(LIBCFLAGS)' \
52 'LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)' \
53 'MAKE=$(MAKE)' \
54 'MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)' \
55 'PICFLAG=$(PICFLAG)' \
56 'PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)' \
57 'RUNTESTFLAGS=$(RUNTESTFLAGS)' \
58 'SHELL=$(SHELL)' \
59 'exec_prefix=$(exec_prefix)' \
60 'infodir=$(infodir)' \
61 'libdir=$(libdir)' \
62 'mandir=$(mandir)' \
63 'prefix=$(prefix)' \
64 'AR=$(AR)' \
65 'AS=$(AS)' \
66 'CC=$(CC)' \
67 'CXX=$(CXX)' \
68 'LD=$(LD)' \
69 'NM=$(NM)' \
70 'RANLIB=$(RANLIB)' \
71 'DESTDIR=$(DESTDIR)'
Anthony Greenc6dddbd2009-10-04 08:11:33 -040072
Anthony Green981c32e2013-01-02 07:34:03 -050073# Subdir rules rely on $(FLAGS_TO_PASS)
74FLAGS_TO_PASS = $(AM_MAKEFLAGS)
75
Anthony Greenc6dddbd2009-10-04 08:11:33 -040076MAKEOVERRIDES=
77
Richard Henderson5d69d572014-11-13 13:50:39 +010078pkgconfigdir = $(libdir)/pkgconfig
79pkgconfig_DATA = libffi.pc
80
Anthony Green981c32e2013-01-02 07:34:03 -050081toolexeclib_LTLIBRARIES = libffi.la
Anthony Greenc6dddbd2009-10-04 08:11:33 -040082noinst_LTLIBRARIES = libffi_convenience.la
Anthony Greenf88118b2013-07-02 15:51:27 -040083
84libffi_la_SOURCES = src/prep_cif.c src/types.c \
85 src/raw_api.c src/java_raw_api.c src/closures.c
Anthony Greenc6dddbd2009-10-04 08:11:33 -040086
Anthony Green6a6e7f82011-11-12 16:20:42 -050087if FFI_DEBUG
Richard Henderson5d69d572014-11-13 13:50:39 +010088libffi_la_SOURCES += src/debug.c
Anthony Green6a6e7f82011-11-12 16:20:42 -050089endif
90
Richard Henderson5d69d572014-11-13 13:50:39 +010091noinst_HEADERS = \
92 src/aarch64/ffitarget.h src/aarch64/internal.h \
93 src/alpha/ffitarget.h src/alpha/internal.h \
94 src/arc/ffitarget.h \
95 src/arm/ffitarget.h src/arm/internal.h \
96 src/avr32/ffitarget.h \
97 src/bfin/ffitarget.h \
98 src/cris/ffitarget.h \
99 src/frv/ffitarget.h \
100 src/ia64/ffitarget.h src/ia64/ia64_flags.h \
101 src/m32r/ffitarget.h \
102 src/m68k/ffitarget.h \
103 src/m88k/ffitarget.h \
104 src/metag/ffitarget.h \
105 src/microblaze/ffitarget.h \
106 src/mips/ffitarget.h \
107 src/moxie/ffitarget.h \
108 src/nios2/ffitarget.h \
109 src/or1k/ffitarget.h \
110 src/pa/ffitarget.h \
111 src/powerpc/ffitarget.h src/powerpc/asm.h src/powerpc/ffi_powerpc.h \
112 src/s390/ffitarget.h \
113 src/sh/ffitarget.h \
114 src/sh64/ffitarget.h \
115 src/sparc/ffitarget.h src/sparc/internal.h \
116 src/tile/ffitarget.h \
117 src/vax/ffitarget.h \
118 src/x86/ffitarget.h src/x86/internal.h src/x86/internal64.h \
119 src/xtensa/ffitarget.h \
120 src/dlmalloc.c
121
122EXTRA_libffi_la_SOURCES = \
123 src/aarch64/ffi.c src/aarch64/sysv.S \
124 src/alpha/ffi.c src/alpha/osf.S \
125 src/arc/ffi.c src/arc/arcompact.S \
126 src/arm/ffi.c src/arm/sysv.S \
127 src/avr32/ffi.c src/avr32/sysv.S \
128 src/bfin/ffi.c src/bfin/sysv.S \
129 src/cris/ffi.c src/cris/sysv.S \
130 src/frv/ffi.c src/frv/eabi.S \
131 src/ia64/ffi.c src/ia64/unix.S \
132 src/m32r/ffi.c src/m32r/sysv.S \
133 src/m68k/ffi.c src/m68k/sysv.S \
134 src/m88k/ffi.c src/m88k/obsd.S \
135 src/metag/ffi.c src/metag/sysv.S \
136 src/microblaze/ffi.c src/microblaze/sysv.S \
137 src/mips/ffi.c src/mips/o32.S src/mips/n32.S \
138 src/moxie/ffi.c src/moxie/eabi.S \
139 src/nios2/ffi.c src/nios2/sysv.S \
140 src/or1k/ffi.c src/or1k/sysv.S \
141 src/pa/ffi.c src/pa/linux.S src/pa/hpux32.S \
142 src/powerpc/ffi.c src/powerpc/ffi_sysv.c src/powerpc/ffi_linux64.c \
143 src/powerpc/sysv.S src/powerpc/linux64.S \
144 src/powerpc/linux64_closure.S src/powerpc/ppc_closure.S \
145 src/powerpc/aix.S src/powerpc/darwin.S src/powerpc/aix_closure.S \
146 src/powerpc/darwin_closure.S src/powerpc/ffi_darwin.c \
147 src/s390/ffi.c src/s390/sysv.S \
148 src/sh/ffi.c src/sh/sysv.S \
149 src/sh64/ffi.c src/sh64/sysv.S \
150 src/sparc/ffi.c src/sparc/ffi64.c src/sparc/v8.S src/sparc/v9.S \
151 src/tile/ffi.c src/tile/tile.S \
152 src/vax/ffi.c src/vax/elfbsd.S \
153 src/x86/ffi.c src/x86/sysv.S \
154 src/x86/ffiw64.c src/x86/win64.S \
155 src/x86/ffi64.c src/x86/unix64.S \
Richard Henderson5d69d572014-11-13 13:50:39 +0100156 src/xtensa/ffi.c src/xtensa/sysv.S
157
158TARGET_OBJ = @TARGET_OBJ@
159libffi_la_LIBADD = $(TARGET_OBJ)
Anthony Greenc6dddbd2009-10-04 08:11:33 -0400160
161libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
Richard Henderson5d69d572014-11-13 13:50:39 +0100162EXTRA_libffi_convenience_la_SOURCES = $(EXTRA_libffi_la_SOURCES)
163libffi_convenience_la_LIBADD = $(libffi_la_LIBADD)
164libffi_convenience_la_DEPENDENCIES = $(libffi_la_DEPENDENCIES)
Anthony Greenc6dddbd2009-10-04 08:11:33 -0400165nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
166
Anthony Greenf308faf2013-02-11 14:25:13 -0500167LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/libtool-ldflags $(LDFLAGS))
Anthony Greenc6dddbd2009-10-04 08:11:33 -0400168
Anthony Greena04e30b2014-02-28 17:20:59 -0500169AM_CFLAGS =
170if FFI_DEBUG
171# Build debug. Define FFI_DEBUG on the commandline so that, when building with
172# MSVC, it can link against the debug CRT.
173AM_CFLAGS += -DFFI_DEBUG
174endif
175
Richard Hendersonc02c3412016-03-03 13:51:44 -0800176if LIBFFI_BUILD_VERSIONED_SHLIB
177if LIBFFI_BUILD_VERSIONED_SHLIB_GNU
178libffi_version_script = -Wl,--version-script,libffi.map
179libffi_version_dep = libffi.map
180endif
181if LIBFFI_BUILD_VERSIONED_SHLIB_SUN
182libffi_version_script = -Wl,-M,libffi.map-sun
183libffi_version_dep = libffi.map-sun
184libffi.map-sun : libffi.map $(top_srcdir)/../contrib/make_sunver.pl \
185 $(libffi_la_OBJECTS) $(libffi_la_LIBADD)
186 perl $(top_srcdir)/../contrib/make_sunver.pl libffi.map \
187 `echo $(libffi_la_OBJECTS) $(libffi_la_LIBADD) | \
188 sed 's,\([^/ ]*\)\.l\([ao]\),.libs/\1.\2,g'` \
189 > $@ || (rm -f $@ ; exit 1)
190endif
191else
192libffi_version_script =
193libffi_version_dep =
194endif
195libffi_version_info = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
196
197libffi.map: $(top_srcdir)/libffi.map.in
198 $(COMPILE) -D$(TARGET) -E -x assembler-with-cpp -o $@ $<
199
200libffi_la_LDFLAGS = -no-undefined $(libffi_version_info) $(libffi_version_script) $(LTLDFLAGS) $(AM_LTLDFLAGS)
201libffi_la_DEPENDENCIES = $(libffi_la_LIBADD) $(libffi_version_dep)
Anthony Greenc6dddbd2009-10-04 08:11:33 -0400202
Anthony Green981c32e2013-01-02 07:34:03 -0500203AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
204AM_CCASFLAGS = $(AM_CPPFLAGS)
Anthony Greenc6dddbd2009-10-04 08:11:33 -0400205
Josh Triplett1c68c072014-03-16 06:11:58 -0700206dist-hook:
Anthony Green0c2251a2014-05-11 10:22:30 -0400207 if [ -d $(top_srcdir)/.git ] ; then (cd $(top_srcdir); git log --no-decorate) ; else echo 'See git log for history.' ; fi > $(distdir)/ChangeLog