OSDN Git Service

2002-09-10 Frank Ch. Eigler <fche@redhat.com>
[pf3gnuchains/gcc-fork.git] / libffi / Makefile.am
1 ## Process this with automake to create Makefile.in
2
3 AUTOMAKE_OPTIONS = cygnus
4
5 SUBDIRS = include
6
7 EXTRA_DIST = LICENSE ChangeLog.v1 src/mips/ffi.c src/mips/n32.S \
8                 src/mips/n32.s src/mips/o32.S src/mips/o32.s \
9                 src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S \
10                 src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \
11                 src/x86/ffi64.c src/x86/unix64.S \
12                 src/alpha/ffi.c src/alpha/osf.S \
13                 src/m68k/ffi.c src/m68k/sysv.S \
14                 src/powerpc/ffi.c src/powerpc/sysv.S \
15                 src/powerpc/ppc_closure.S src/powerpc/asm.h \
16                 src/powerpc/ffi_darwin.c \
17                 src/powerpc/darwin.S src/powerpc/aix.S \
18                 src/powerpc/darwin_closure.S src/powerpc/aix_closures.S \
19                 src/arm/ffi.c src/arm/sysv.S \
20                 src/s390/ffi.c src/s390/sysv.S \
21                 src/sh/ffi.c src/sh/sysv.S
22
23 VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@
24
25 ## ################################################################
26
27 ##
28 ## This section is for make and multilib madness.
29 ##
30
31 # Work around what appears to be a GNU make bug handling MAKEFLAGS
32 # values defined in terms of make variables, as is the case for CC and
33 # friends when we are called from the top level Makefile.
34 AM_MAKEFLAGS = \
35         "AR_FLAGS=$(AR_FLAGS)" \
36         "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
37         "CFLAGS=$(CFLAGS)" \
38         "CXXFLAGS=$(CXXFLAGS)" \
39         "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
40         "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
41         "INSTALL=$(INSTALL)" \
42         "INSTALL_DATA=$(INSTALL_DATA)" \
43         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
44         "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
45         "JC1FLAGS=$(JC1FLAGS)" \
46         "LDFLAGS=$(LDFLAGS)" \
47         "LIBCFLAGS=$(LIBCFLAGS)" \
48         "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
49         "MAKE=$(MAKE)" \
50         "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
51         "PICFLAG=$(PICFLAG)" \
52         "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
53         "SHELL=$(SHELL)" \
54         "exec_prefix=$(exec_prefix)" \
55         "infodir=$(infodir)" \
56         "libdir=$(libdir)" \
57         "prefix=$(prefix)" \
58         "AR=$(AR)" \
59         "AS=$(AS)" \
60         "CC=$(CC)" \
61         "CXX=$(CXX)" \
62         "LD=$(LD)" \
63         "LIBCFLAGS=$(LIBCFLAGS)" \
64         "NM=$(NM)" \
65         "PICFLAG=$(PICFLAG)" \
66         "RANLIB=$(RANLIB)" \
67         "DESTDIR=$(DESTDIR)"
68
69 MAKEOVERRIDES=
70
71 # Multilib support variables.
72 MULTISRCTOP =
73 MULTIBUILDTOP =
74 MULTIDIRS =
75 MULTISUBDIR =
76 MULTIDO = true
77 MULTICLEAN = true
78
79 ## Install a library built with a cross compiler in tooldir, not
80 ## libdir.
81 if USE_LIBDIR
82 toolexeclibdir = $(libdir)$(MULTISUBDIR)
83 else
84 toolexecdir = $(exec_prefix)/$(target_alias)
85 toolexeclibdir = $(toolexecdir)/lib$(MULTISUBDIR)
86 endif
87
88 toolexeclib_LTLIBRARIES = libffi.la
89 noinst_LTLIBRARIES = libffi_convenience.la
90
91 noinst_PROGRAMS = ffitest
92
93 ffitest_OBJECTS = ffitest.lo
94 ffitest_LDADD = libffi.la
95 ffitest_LDFLAGS = -shared-libgcc
96
97 TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S
98 TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S
99 TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s
100 TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S
101 TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.S
102 TARGET_SRC_SPARC = src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S
103 TARGET_SRC_ALPHA = src/alpha/ffi.c src/alpha/osf.S
104 TARGET_SRC_IA64 = src/ia64/ffi.c src/ia64/unix.S
105 TARGET_SRC_M68K = src/m68k/ffi.c src/m68k/sysv.S
106 TARGET_SRC_POWERPC = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S
107 TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closures.S
108 TARGET_SRC_POWERPC_DARWIN = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S
109 TARGET_SRC_ARM =  src/arm/sysv.S src/arm/ffi.c
110 TARGET_SRC_S390 =  src/s390/sysv.S src/s390/ffi.c
111 TARGET_SRC_X86_64 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
112 TARGET_SRC_SH =  src/sh/sysv.S src/sh/ffi.c
113
114 ##libffi_la_SOURCES = src/debug.c src/prep_cif.c src/types.c $(TARGET_SRC_@TARGET@)
115 ## Work around automake deficiency
116 libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c \
117                 src/raw_api.c src/java_raw_api.c
118 if MIPS_GCC
119 libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC)
120 libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC)
121 endif
122 if MIPS_LINUX
123 libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX)
124 libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX)
125 endif
126 if MIPS_SGI
127 libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI)
128 libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI)
129 endif
130 if X86
131 libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86)
132 libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86)
133 endif
134 if X86_WIN32
135 libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32)
136 libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32)
137 endif
138 if SPARC
139 libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SPARC)
140 libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SPARC)
141 endif
142 if ALPHA
143 libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ALPHA)
144 libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ALPHA)
145 endif
146 if IA64
147 libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_IA64)
148 libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_IA64)
149 endif
150 if M68K
151 libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_M68K)
152 libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_M68K)
153 endif
154 if POWERPC
155 libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC)
156 libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC)
157 endif
158 if POWERPC_AIX
159 libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_AIX)
160 libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_AIX)
161 endif
162 if POWERPC_DARWIN
163 libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_DARWIN)
164 libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_DARWIN)
165 endif
166 if ARM
167 libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ARM)
168 libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ARM)
169 endif
170 if S390
171 libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_S390)
172 libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_S390)
173 endif
174 if X86_64
175 libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64)
176 libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64)
177 endif
178 if SH
179 libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH)
180 libfficonvenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH)
181 endif
182
183 AM_CFLAGS = -fexceptions
184
185 libffi_la_LDFLAGS = -release $(VERSION) 
186
187 INCLUDES = -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
188
189 # Override these rules so that object files get put in the correct 
190 # subdirectories. 
191 .c.o:
192         $(LTCOMPILE) -c -o $@ $<
193
194 .s.o:
195         $(LTCOMPILE) -c -o $@ $<
196
197 .S.o:
198         $(LTCOMPILE) -c -o $@ $<
199
200 .c.lo:
201         $(LTCOMPILE) -c -o $@ $<
202
203 .s.lo:
204         $(LTCOMPILE) -c -o $@ $<
205
206 .S.lo:
207         $(LTCOMPILE) -c -o $@ $<
208
209 # Multilib support.
210 .PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \
211         maintainer-clean-multi
212
213 all-recursive: all-multi
214 install-recursive: install-multi
215 mostlyclean-recursive: mostlyclean-multi
216 clean-recursive: clean-multi
217 distclean-recursive: distclean-multi
218 maintainer-clean-recursive: maintainer-clean-multi
219
220 all-multi:
221         $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do
222 install-multi:
223         $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do
224 mostlyclean-multi:
225         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean
226 clean-multi:
227         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean
228 distclean-multi:
229         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean
230 maintainer-clean-multi:
231         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean
232
233
234 ## ################################################################
235