Merge pull request #132 from nielsAD/master
[libffi.git] / Makefile.am
index d25aebd..1dcdc81 100644 (file)
@@ -6,7 +6,7 @@ ACLOCAL_AMFLAGS = -I m4
 
 SUBDIRS = include testsuite man
 
-EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host      \
+EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj                     \
         src/aarch64/ffi.c src/aarch64/ffitarget.h src/aarch64/sysv.S   \
         src/alpha/ffi.c src/alpha/osf.S                        \
         src/alpha/ffitarget.h src/arc/ffi.c src/arc/arcompact.S        \
@@ -48,10 +48,9 @@ EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host    \
         ChangeLog.libffi m4/libtool.m4 m4/lt~obsolete.m4               \
         m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4                  \
         m4/ltversion.m4 src/arm/gentramp.sh src/debug.c msvcc.sh       \
-        generate-ios-source-and-headers.py                             \
-        generate-osx-source-and-headers.py                             \
+        generate-darwin-source-and-headers.py                          \
         libffi.xcodeproj/project.pbxproj src/arm/trampoline.S          \
-        libtool-ldflags
+        libtool-ldflags ChangeLog.libffi-3.1
 
 info_TEXINFOS = doc/libffi.texi
 
@@ -65,39 +64,39 @@ info_TEXINFOS = doc/libffi.texi
 # values defined in terms of make variables, as is the case for CC and
 # friends when we are called from the top level Makefile.
 AM_MAKEFLAGS = \
-       "AR_FLAGS=$(AR_FLAGS)" \
-       "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
-       "CFLAGS=$(CFLAGS)" \
-       "CXXFLAGS=$(CXXFLAGS)" \
-       "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
-       "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
-       "INSTALL=$(INSTALL)" \
-       "INSTALL_DATA=$(INSTALL_DATA)" \
-       "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
-       "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
-       "JC1FLAGS=$(JC1FLAGS)" \
-       "LDFLAGS=$(LDFLAGS)" \
-       "LIBCFLAGS=$(LIBCFLAGS)" \
-       "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
-       "MAKE=$(MAKE)" \
-       "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
-       "PICFLAG=$(PICFLAG)" \
-       "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
-       "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
-       "SHELL=$(SHELL)" \
-       "exec_prefix=$(exec_prefix)" \
-       "infodir=$(infodir)" \
-       "libdir=$(libdir)" \
-       "mandir=$(mandir)" \
-       "prefix=$(prefix)" \
-       "AR=$(AR)" \
-       "AS=$(AS)" \
-       "CC=$(CC)" \
-       "CXX=$(CXX)" \
-       "LD=$(LD)" \
-       "NM=$(NM)" \
-       "RANLIB=$(RANLIB)" \
-       "DESTDIR=$(DESTDIR)"
+       'AR_FLAGS=$(AR_FLAGS)' \
+       'CC_FOR_BUILD=$(CC_FOR_BUILD)' \
+       'CFLAGS=$(CFLAGS)' \
+       'CXXFLAGS=$(CXXFLAGS)' \
+       'CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)' \
+       'CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)' \
+       'INSTALL=$(INSTALL)' \
+       'INSTALL_DATA=$(INSTALL_DATA)' \
+       'INSTALL_PROGRAM=$(INSTALL_PROGRAM)' \
+       'INSTALL_SCRIPT=$(INSTALL_SCRIPT)' \
+       'JC1FLAGS=$(JC1FLAGS)' \
+       'LDFLAGS=$(LDFLAGS)' \
+       'LIBCFLAGS=$(LIBCFLAGS)' \
+       'LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)' \
+       'MAKE=$(MAKE)' \
+       'MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)' \
+       'PICFLAG=$(PICFLAG)' \
+       'PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)' \
+       'RUNTESTFLAGS=$(RUNTESTFLAGS)' \
+       'SHELL=$(SHELL)' \
+       'exec_prefix=$(exec_prefix)' \
+       'infodir=$(infodir)' \
+       'libdir=$(libdir)' \
+       'mandir=$(mandir)' \
+       'prefix=$(prefix)' \
+       'AR=$(AR)' \
+       'AS=$(AS)' \
+       'CC=$(CC)' \
+       'CXX=$(CXX)' \
+       'LD=$(LD)' \
+       'NM=$(NM)' \
+       'RANLIB=$(RANLIB)' \
+       'DESTDIR=$(DESTDIR)'
 
 # Subdir rules rely on $(FLAGS_TO_PASS)
 FLAGS_TO_PASS = $(AM_MAKEFLAGS)
@@ -126,10 +125,10 @@ if BFIN
 nodist_libffi_la_SOURCES += src/bfin/ffi.c src/bfin/sysv.S
 endif
 if X86
-nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/sysv.S
+nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/sysv.S src/x86/win32.S
 endif
 if X86_FREEBSD
-nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/freebsd.S
+nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/freebsd.S src/x86/win32.S
 endif
 if X86_WIN32
 nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/win32.S
@@ -139,6 +138,9 @@ nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/win64.S
 endif
 if X86_DARWIN
 nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/darwin.S src/x86/ffi64.c src/x86/darwin64.S
+if X86_DARWIN32
+nodist_libffi_la_SOURCES += src/x86/win32.S
+endif
 endif
 if SPARC
 nodist_libffi_la_SOURCES += src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S
@@ -236,8 +238,17 @@ nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
 
 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/libtool-ldflags $(LDFLAGS))
 
+AM_CFLAGS =
+if FFI_DEBUG
+# Build debug. Define FFI_DEBUG on the commandline so that, when building with
+# MSVC, it can link against the debug CRT.
+AM_CFLAGS += -DFFI_DEBUG
+endif
+
 libffi_la_LDFLAGS = -no-undefined -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) $(AM_LTLDFLAGS)
 
 AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
 AM_CCASFLAGS = $(AM_CPPFLAGS)
 
+dist-hook:
+       if [ -d $(top_srcdir)/.git ] ; then (cd $(top_srcdir); git log --no-decorate) ; else echo 'See git log for history.' ; fi > $(distdir)/ChangeLog