blob: 4fd6193d9b218cb736865961c7c9ced3a81d324e [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
Anthony Green6f734f82019-11-18 15:13:16 -050017EXTRA_DIST = LICENSE ChangeLog.old \
Richard Henderson5d69d572014-11-13 13:50:39 +010018 m4/libtool.m4 m4/lt~obsolete.m4 \
Anthony Green9c00a3f2012-10-12 16:46:06 -040019 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 \
Richard Hendersona4b785e2014-10-17 02:07:32 -040020 m4/ltversion.m4 src/debug.c msvcc.sh \
Richard Henderson5d69d572014-11-13 13:50:39 +010021 generate-darwin-source-and-headers.py \
22 libffi.xcodeproj/project.pbxproj \
Anthony Greenf3c27292018-03-23 11:47:29 -040023 libtool-ldflags libtool-version configure.host README.md \
Anthony Green8e3935f2019-11-22 12:42:26 -050024 libffi.map.in LICENSE-BUILDTOOLS msvc_build make_sunver.pl
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 Green981c32e2013-01-02 07:34:03 -050029# Subdir rules rely on $(FLAGS_TO_PASS)
30FLAGS_TO_PASS = $(AM_MAKEFLAGS)
31
Anthony Greenc6dddbd2009-10-04 08:11:33 -040032MAKEOVERRIDES=
33
Richard Henderson5d69d572014-11-13 13:50:39 +010034pkgconfigdir = $(libdir)/pkgconfig
35pkgconfig_DATA = libffi.pc
36
Anthony Green981c32e2013-01-02 07:34:03 -050037toolexeclib_LTLIBRARIES = libffi.la
Anthony Greenc6dddbd2009-10-04 08:11:33 -040038noinst_LTLIBRARIES = libffi_convenience.la
Anthony Greenf88118b2013-07-02 15:51:27 -040039
40libffi_la_SOURCES = src/prep_cif.c src/types.c \
41 src/raw_api.c src/java_raw_api.c src/closures.c
Anthony Greenc6dddbd2009-10-04 08:11:33 -040042
Anthony Green6a6e7f82011-11-12 16:20:42 -050043if FFI_DEBUG
Richard Henderson5d69d572014-11-13 13:50:39 +010044libffi_la_SOURCES += src/debug.c
Anthony Green6a6e7f82011-11-12 16:20:42 -050045endif
46
Richard Henderson5d69d572014-11-13 13:50:39 +010047noinst_HEADERS = \
48 src/aarch64/ffitarget.h src/aarch64/internal.h \
49 src/alpha/ffitarget.h src/alpha/internal.h \
50 src/arc/ffitarget.h \
51 src/arm/ffitarget.h src/arm/internal.h \
52 src/avr32/ffitarget.h \
53 src/bfin/ffitarget.h \
54 src/cris/ffitarget.h \
55 src/frv/ffitarget.h \
56 src/ia64/ffitarget.h src/ia64/ia64_flags.h \
57 src/m32r/ffitarget.h \
58 src/m68k/ffitarget.h \
59 src/m88k/ffitarget.h \
60 src/metag/ffitarget.h \
61 src/microblaze/ffitarget.h \
62 src/mips/ffitarget.h \
63 src/moxie/ffitarget.h \
64 src/nios2/ffitarget.h \
65 src/or1k/ffitarget.h \
66 src/pa/ffitarget.h \
67 src/powerpc/ffitarget.h src/powerpc/asm.h src/powerpc/ffi_powerpc.h \
Stef O'Rear3840d492018-03-11 05:55:15 -070068 src/riscv/ffitarget.h \
Sergei Trofimovichcd5e9f82017-11-05 13:56:42 +000069 src/s390/ffitarget.h src/s390/internal.h \
Richard Henderson5d69d572014-11-13 13:50:39 +010070 src/sh/ffitarget.h \
71 src/sh64/ffitarget.h \
72 src/sparc/ffitarget.h src/sparc/internal.h \
73 src/tile/ffitarget.h \
74 src/vax/ffitarget.h \
Moritz Angermann4c6aa782017-10-01 11:32:41 +080075 src/x86/ffitarget.h src/x86/internal.h src/x86/internal64.h src/x86/asmnames.h \
Richard Henderson5d69d572014-11-13 13:50:39 +010076 src/xtensa/ffitarget.h \
77 src/dlmalloc.c
78
Anthony Green1d605942019-10-24 05:25:11 -040079EXTRA_libffi_la_SOURCES = src/aarch64/ffi.c src/aarch64/sysv.S \
80 src/aarch64/win64_armasm.S src/alpha/ffi.c src/alpha/osf.S \
81 src/arc/ffi.c src/arc/arcompact.S src/arm/ffi.c \
82 src/arm/sysv.S src/arm/ffi.c src/arm/sysv_msvc_arm32.S \
83 src/avr32/ffi.c src/avr32/sysv.S src/bfin/ffi.c \
84 src/bfin/sysv.S src/cris/ffi.c src/cris/sysv.S src/frv/ffi.c \
85 src/frv/eabi.S src/ia64/ffi.c src/ia64/unix.S src/m32r/ffi.c \
86 src/m32r/sysv.S src/m68k/ffi.c src/m68k/sysv.S src/m88k/ffi.c \
87 src/m88k/obsd.S src/metag/ffi.c src/metag/sysv.S \
88 src/microblaze/ffi.c src/microblaze/sysv.S src/mips/ffi.c \
89 src/mips/o32.S src/mips/n32.S src/moxie/ffi.c \
90 src/moxie/eabi.S src/nios2/ffi.c src/nios2/sysv.S \
91 src/or1k/ffi.c src/or1k/sysv.S src/pa/ffi.c src/pa/linux.S \
92 src/pa/hpux32.S src/powerpc/ffi.c src/powerpc/ffi_sysv.c \
93 src/powerpc/ffi_linux64.c src/powerpc/sysv.S \
94 src/powerpc/linux64.S src/powerpc/linux64_closure.S \
95 src/powerpc/ppc_closure.S src/powerpc/aix.S \
96 src/powerpc/darwin.S src/powerpc/aix_closure.S \
97 src/powerpc/darwin_closure.S src/powerpc/ffi_darwin.c \
98 src/riscv/ffi.c src/riscv/sysv.S src/s390/ffi.c \
99 src/s390/sysv.S src/sh/ffi.c src/sh/sysv.S src/sh64/ffi.c \
100 src/sh64/sysv.S src/sparc/ffi.c src/sparc/ffi64.c \
101 src/sparc/v8.S src/sparc/v9.S src/tile/ffi.c src/tile/tile.S \
102 src/vax/ffi.c src/vax/elfbsd.S src/x86/ffi.c src/x86/sysv.S \
103 src/x86/ffiw64.c src/x86/win64.S src/x86/ffi64.c \
104 src/x86/unix64.S src/x86/sysv_intel.S src/x86/win64_intel.S \
Richard Henderson5d69d572014-11-13 13:50:39 +0100105 src/xtensa/ffi.c src/xtensa/sysv.S
106
107TARGET_OBJ = @TARGET_OBJ@
108libffi_la_LIBADD = $(TARGET_OBJ)
Anthony Greenc6dddbd2009-10-04 08:11:33 -0400109
110libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
Richard Henderson5d69d572014-11-13 13:50:39 +0100111EXTRA_libffi_convenience_la_SOURCES = $(EXTRA_libffi_la_SOURCES)
112libffi_convenience_la_LIBADD = $(libffi_la_LIBADD)
113libffi_convenience_la_DEPENDENCIES = $(libffi_la_DEPENDENCIES)
Anthony Greenc6dddbd2009-10-04 08:11:33 -0400114nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
115
Anthony Greenf308faf2013-02-11 14:25:13 -0500116LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/libtool-ldflags $(LDFLAGS))
Anthony Greenc6dddbd2009-10-04 08:11:33 -0400117
Anthony Greena04e30b2014-02-28 17:20:59 -0500118AM_CFLAGS =
119if FFI_DEBUG
120# Build debug. Define FFI_DEBUG on the commandline so that, when building with
121# MSVC, it can link against the debug CRT.
122AM_CFLAGS += -DFFI_DEBUG
123endif
124
Richard Hendersonc02c3412016-03-03 13:51:44 -0800125if LIBFFI_BUILD_VERSIONED_SHLIB
126if LIBFFI_BUILD_VERSIONED_SHLIB_GNU
127libffi_version_script = -Wl,--version-script,libffi.map
128libffi_version_dep = libffi.map
129endif
130if LIBFFI_BUILD_VERSIONED_SHLIB_SUN
131libffi_version_script = -Wl,-M,libffi.map-sun
132libffi_version_dep = libffi.map-sun
Anthony Greenca112532019-10-26 07:26:30 -0400133libffi.map-sun : libffi.map $(top_srcdir)/make_sunver.pl \
Richard Hendersonc02c3412016-03-03 13:51:44 -0800134 $(libffi_la_OBJECTS) $(libffi_la_LIBADD)
Anthony Greenca112532019-10-26 07:26:30 -0400135 perl $(top_srcdir)/make_sunver.pl libffi.map \
Richard Hendersonc02c3412016-03-03 13:51:44 -0800136 `echo $(libffi_la_OBJECTS) $(libffi_la_LIBADD) | \
137 sed 's,\([^/ ]*\)\.l\([ao]\),.libs/\1.\2,g'` \
138 > $@ || (rm -f $@ ; exit 1)
139endif
140else
141libffi_version_script =
142libffi_version_dep =
143endif
144libffi_version_info = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
145
146libffi.map: $(top_srcdir)/libffi.map.in
147 $(COMPILE) -D$(TARGET) -E -x assembler-with-cpp -o $@ $<
148
149libffi_la_LDFLAGS = -no-undefined $(libffi_version_info) $(libffi_version_script) $(LTLDFLAGS) $(AM_LTLDFLAGS)
150libffi_la_DEPENDENCIES = $(libffi_la_LIBADD) $(libffi_version_dep)
Anthony Greenc6dddbd2009-10-04 08:11:33 -0400151
Anthony Green981c32e2013-01-02 07:34:03 -0500152AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
153AM_CCASFLAGS = $(AM_CPPFLAGS)
Anthony Greenc6dddbd2009-10-04 08:11:33 -0400154
Josh Triplett1c68c072014-03-16 06:11:58 -0700155dist-hook:
Anthony Green8e3935f2019-11-22 12:42:26 -0500156 d=`(cd $(distdir); pwd)`; (cd doc; make pdf; cp *.pdf $$d/doc)
Anthony Green0c2251a2014-05-11 10:22:30 -0400157 if [ -d $(top_srcdir)/.git ] ; then (cd $(top_srcdir); git log --no-decorate) ; else echo 'See git log for history.' ; fi > $(distdir)/ChangeLog
Anthony Green90fb8972019-10-24 06:24:14 -0400158 s=`awk '/was released on/{ print NR; exit}' $(top_srcdir)/README.md`; tail -n +$$(($$s-1)) $(top_srcdir)/README.md > $(distdir)/README.md
Anthony Green8e3935f2019-11-22 12:42:26 -0500159