OSDN Git Service

* configure.in: Handle multilibs, support
[pf3gnuchains/gcc-fork.git] / libmudflap / Makefile.am
1 ## Makefile for the toplevel directory of the mudflap library.
2 ##
3 ## Copyright (C) 2002, 2003
4 ## Free Software Foundation, Inc.
5 ##
6
7 AUTOMAKE_OPTIONS = 1.3 foreign
8 MAINT_CHARSET = latin1
9 SUBDIRS = testsuite
10
11 AM_CFLAGS = -Wall
12
13 if LIBMUDFLAPTH
14 libmudflapth = libmudflapth.la
15 else
16 libmudflapth =
17 endif
18
19 toolexeclib_LTLIBRARIES = libmudflap.la $(libmudflapth)
20 include_HEADERS = mf-runtime.h
21
22 libmudflap_la_SOURCES = \
23         mf-runtime.c \
24         mf-heuristics.c
25
26 HOOK1OBJS = \
27  malloc-hook.lo \
28  free-hook.lo \
29  calloc-hook.lo \
30  realloc-hook.lo \
31  mmap-hook.lo \
32  munmap-hook.lo \
33  alloca-hook.lo
34
35 HOOK2OBJS = \
36  memcpy-hook.lo \
37  memmove-hook.lo \
38  memset-hook.lo \
39  memcmp-hook.lo \
40  memchr-hook.lo \
41  memrchr-hook.lo \
42  strcpy-hook.lo \
43  strncpy-hook.lo \
44  strcat-hook.lo \
45  strncat-hook.lo \
46  strcmp-hook.lo \
47  strcasecmp-hook.lo \
48  strncmp-hook.lo \
49  strncasecmp-hook.lo \
50  strdup-hook.lo \
51  strndup-hook.lo \
52  strchr-hook.lo \
53  strrchr-hook.lo \
54  strstr-hook.lo \
55  memmem-hook.lo \
56  strlen-hook.lo \
57  strnlen-hook.lo \
58  bzero-hook.lo \
59  bcopy-hook.lo \
60  bcmp-hook.lo \
61  index-hook.lo \
62  rindex-hook.lo \
63  asctime-hook.lo \
64  ctime-hook.lo \
65  gmtime-hook.lo \
66  localtime-hook.lo \
67  time-hook.lo \
68  strerror-hook.lo \
69  fopen-hook.lo \
70  fclose-hook.lo \
71  fread-hook.lo \
72  fwrite-hook.lo \
73  fgetc-hook.lo \
74  fgets-hook.lo \
75  getc-hook.lo \
76  gets-hook.lo \
77  ungetc-hook.lo \
78  fputc-hook.lo \
79  fputs-hook.lo \
80  putc-hook.lo \
81  puts-hook.lo \
82  clearerr-hook.lo \
83  feof-hook.lo \
84  ferror-hook.lo \
85  fileno-hook.lo \
86  printf-hook.lo \
87  fprintf-hook.lo \
88  sprintf-hook.lo \
89  snprintf-hook.lo \
90  vprintf-hook.lo \
91  vfprintf-hook.lo \
92  vsprintf-hook.lo \
93  vsnprintf-hook.lo \
94  access-hook.lo \
95  remove-hook.lo \
96  fflush-hook.lo \
97  fseek-hook.lo \
98  ftell-hook.lo \
99  rewind-hook.lo \
100  fgetpos-hook.lo \
101  fsetpos-hook.lo \
102  stat-hook.lo \
103  fstat-hook.lo \
104  lstat-hook.lo \
105  mkfifo-hook.lo \
106  setvbuf-hook.lo \
107  setbuf-hook.lo \
108  opendir-hook.lo \
109  closedir-hook.lo \
110  readdir-hook.lo \
111  recv-hook.lo \
112  recvfrom-hook.lo \
113  recvmsg-hook.lo \
114  send-hook.lo \
115  sendto-hook.lo \
116  sendmsg-hook.lo \
117  setsockopt-hook.lo \
118  getsockopt-hook.lo \
119  accept-hook.lo \
120  bind-hook.lo \
121  connect-hook.lo \
122  gethostname-hook.lo \
123  sethostname-hook.lo \
124  gethostbyname-hook.lo \
125  wait-hook.lo \
126  waitpid-hook.lo \
127  popen-hook.lo \
128  pclose-hook.lo \
129  execve-hook.lo \
130  execv-hook.lo \
131  execvp-hook.lo \
132  system-hook.lo \
133  dlopen-hook.lo \
134  dlerror-hook.lo \
135  dlsym-hook.lo \
136  dlclose-hook.lo \
137  fopen64-hook.lo \
138  stat64-hook.lo \
139  fseeko64-hook.lo \
140  ftello64-hook.lo \
141  semop-hook.lo \
142  semctl-hook.lo \
143  shmctl-hook.lo \
144  shmat-hook.lo \
145  shmdt-hook.lo
146 HOOK3OBJS = 
147
148 $(HOOK1OBJS): mf-hooks1.c mf-runtime.h mf-impl.h
149         hook=`basename $@ -hook.lo`; \
150         $(LTCOMPILE) -DWRAP_$$hook -c $(srcdir)/mf-hooks1.c -o $@
151 $(HOOK2OBJS): mf-hooks2.c mf-runtime.h mf-impl.h
152         hook=`basename $@ -hook.lo`; \
153         $(LTCOMPILE) -DWRAP_$$hook -c $(srcdir)/mf-hooks2.c -o $@
154 $(HOOK3OBJS): mf-hooks3.c mf-runtime.h mf-impl.h
155         hook=`basename $@ -hook.lo`; \
156         $(LTCOMPILE) -DWRAP_$$hook -c $(srcdir)/mf-hooks3.c -o $@
157
158 # Hook objects only for libmudflapth use 
159 PTHHOOK1OBJS= \
160  pth/malloc-hook.lo \
161  pth/free-hook.lo \
162  pth/calloc-hook.lo \
163  pth/realloc-hook.lo \
164  pth/mmap-hook.lo \
165  pth/munmap-hook.lo \
166  pth/alloca-hook.lo
167
168 PTHHOOK2OBJS= \
169  pth/memcpy-hook.lo \
170  pth/memmove-hook.lo \
171  pth/memset-hook.lo \
172  pth/memcmp-hook.lo \
173  pth/memchr-hook.lo \
174  pth/memrchr-hook.lo \
175  pth/strcpy-hook.lo \
176  pth/strncpy-hook.lo \
177  pth/strcat-hook.lo \
178  pth/strncat-hook.lo \
179  pth/strcmp-hook.lo \
180  pth/strcasecmp-hook.lo \
181  pth/strncmp-hook.lo \
182  pth/strncasecmp-hook.lo \
183  pth/strdup-hook.lo \
184  pth/strndup-hook.lo \
185  pth/strchr-hook.lo \
186  pth/strrchr-hook.lo \
187  pth/strstr-hook.lo \
188  pth/memmem-hook.lo \
189  pth/strlen-hook.lo \
190  pth/strnlen-hook.lo \
191  pth/bzero-hook.lo \
192  pth/bcopy-hook.lo \
193  pth/bcmp-hook.lo \
194  pth/index-hook.lo \
195  pth/rindex-hook.lo \
196  pth/asctime-hook.lo \
197  pth/ctime-hook.lo \
198  pth/gmtime-hook.lo \
199  pth/localtime-hook.lo \
200  pth/time-hook.lo \
201  pth/strerror-hook.lo \
202  pth/fopen-hook.lo \
203  pth/fclose-hook.lo \
204  pth/fread-hook.lo \
205  pth/fwrite-hook.lo \
206  pth/fgetc-hook.lo \
207  pth/fgets-hook.lo \
208  pth/getc-hook.lo \
209  pth/gets-hook.lo \
210  pth/ungetc-hook.lo \
211  pth/fputc-hook.lo \
212  pth/fputs-hook.lo \
213  pth/putc-hook.lo \
214  pth/puts-hook.lo \
215  pth/clearerr-hook.lo \
216  pth/feof-hook.lo \
217  pth/ferror-hook.lo \
218  pth/fileno-hook.lo \
219  pth/printf-hook.lo \
220  pth/fprintf-hook.lo \
221  pth/sprintf-hook.lo \
222  pth/snprintf-hook.lo \
223  pth/vprintf-hook.lo \
224  pth/vfprintf-hook.lo \
225  pth/vsprintf-hook.lo \
226  pth/vsnprintf-hook.lo \
227  pth/access-hook.lo \
228  pth/remove-hook.lo \
229  pth/fflush-hook.lo \
230  pth/fseek-hook.lo \
231  pth/ftell-hook.lo \
232  pth/rewind-hook.lo \
233  pth/fgetpos-hook.lo \
234  pth/fsetpos-hook.lo \
235  pth/stat-hook.lo \
236  pth/fstat-hook.lo \
237  pth/lstat-hook.lo \
238  pth/mkfifo-hook.lo \
239  pth/setvbuf-hook.lo \
240  pth/setbuf-hook.lo \
241  pth/opendir-hook.lo \
242  pth/closedir-hook.lo \
243  pth/readdir-hook.lo \
244  pth/recv-hook.lo \
245  pth/recvfrom-hook.lo \
246  pth/recvmsg-hook.lo \
247  pth/send-hook.lo \
248  pth/sendto-hook.lo \
249  pth/sendmsg-hook.lo \
250  pth/setsockopt-hook.lo \
251  pth/getsockopt-hook.lo \
252  pth/accept-hook.lo \
253  pth/bind-hook.lo \
254  pth/connect-hook.lo \
255  pth/gethostname-hook.lo \
256  pth/sethostname-hook.lo \
257  pth/gethostbyname-hook.lo \
258  pth/wait-hook.lo \
259  pth/waitpid-hook.lo \
260  pth/popen-hook.lo \
261  pth/pclose-hook.lo \
262  pth/execve-hook.lo \
263  pth/execv-hook.lo \
264  pth/execvp-hook.lo \
265  pth/system-hook.lo \
266  pth/dlopen-hook.lo \
267  pth/dlerror-hook.lo \
268  pth/dlsym-hook.lo \
269  pth/dlclose-hook.lo \
270  pth/fopen64-hook.lo \
271  pth/stat64-hook.lo \
272  pth/fseeko64-hook.lo \
273  pth/ftello64-hook.lo \
274  pth/semop-hook.lo \
275  pth/semctl-hook.lo \
276  pth/shmctl-hook.lo \
277  pth/shmat-hook.lo \
278  pth/shmdt-hook.lo
279
280 PTHHOOK3OBJS= \
281  pth/pthreadstuff-hook.lo
282
283
284 clean-local:
285         rm -f pth/*.o pth/*.lo
286
287 libmudflapth_la_SOURCES =
288 pth/mf-runtime.lo: mf-runtime.c mf-runtime.h mf-impl.h
289         $(LTCOMPILE) -DLIBMUDFLAPTH -c $(srcdir)/mf-runtime.c -o $@
290 pth/mf-heuristics.lo: mf-heuristics.c mf-runtime.h mf-impl.h
291         $(LTCOMPILE) -DLIBMUDFLAPTH -c $(srcdir)/mf-heuristics.c -o $@
292 $(PTHHOOK1OBJS): mf-hooks1.c mf-runtime.h mf-impl.h
293         hook=`basename $@ -hook.lo`; \
294         $(LTCOMPILE) -DLIBMUDFLAPTH -DWRAP_$$hook -c $(srcdir)/mf-hooks1.c -o $@
295 $(PTHHOOK2OBJS): mf-hooks2.c mf-runtime.h mf-impl.h
296         hook=`basename $@ -hook.lo`; \
297         $(LTCOMPILE) -DLIBMUDFLAPTH -DWRAP_$$hook -c $(srcdir)/mf-hooks2.c -o $@
298 $(PTHHOOK3OBJS): mf-hooks3.c mf-runtime.h mf-impl.h
299         hook=`basename $@ -hook.lo`; \
300         $(LTCOMPILE) -DLIBMUDFLAPTH -DWRAP_$$hook -c $(srcdir)/mf-hooks3.c -o $@
301
302 libmudflap_la_LIBADD = $(HOOK1OBJS) $(HOOK2OBJS) $(HOOK3OBJS)
303 libmudflap_la_DEPENDENCIES = $(libmudflap_la_LIBADD)
304
305 libmudflapth_la_LIBADD = pth/mf-runtime.lo pth/mf-heuristics.lo \
306         $(PTHHOOK1OBJS) $(PTHHOOK2OBJS) $(PTHHOOK3OBJS)
307 libmudflapth_la_DEPENDENCIES = $(libmudflapth_la_LIBADD)
308
309
310
311 # XXX hack alert
312 # From libffi/Makefile.am
313
314 # Work around what appears to be a GNU make bug handling MAKEFLAGS
315 # values defined in terms of make variables, as is the case for CC and
316 # friends when we are called from the top level Makefile.
317 AM_MAKEFLAGS = \
318         "AR_FLAGS=$(AR_FLAGS)" \
319         "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
320         "CFLAGS=$(CFLAGS)" \
321         "CXXFLAGS=$(CXXFLAGS)" \
322         "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
323         "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
324         "INSTALL=$(INSTALL)" \
325         "INSTALL_DATA=$(INSTALL_DATA)" \
326         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
327         "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
328         "JC1FLAGS=$(JC1FLAGS)" \
329         "LDFLAGS=$(LDFLAGS)" \
330         "LIBCFLAGS=$(LIBCFLAGS)" \
331         "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
332         "MAKE=$(MAKE)" \
333         "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
334         "PICFLAG=$(PICFLAG)" \
335         "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
336         "SHELL=$(SHELL)" \
337         "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
338         "exec_prefix=$(exec_prefix)" \
339         "infodir=$(infodir)" \
340         "libdir=$(libdir)" \
341         "prefix=$(prefix)" \
342         "AR=$(AR)" \
343         "AS=$(AS)" \
344         "CC=$(CC)" \
345         "CXX=$(CXX)" \
346         "LD=$(LD)" \
347         "LIBCFLAGS=$(LIBCFLAGS)" \
348         "NM=$(NM)" \
349         "PICFLAG=$(PICFLAG)" \
350         "RANLIB=$(RANLIB)" \
351         "DESTDIR=$(DESTDIR)"
352
353 MAKEOVERRIDES=
354
355 # Multilib support variables.
356 MULTISRCTOP =
357 MULTIBUILDTOP =
358 MULTIDIRS =
359 MULTISUBDIR =
360 MULTIDO = true
361 MULTICLEAN = true
362
363 # Multilib support.
364 .PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \
365         maintainer-clean-multi
366
367 all-recursive: all-multi
368 install-recursive: install-multi
369 mostlyclean-recursive: mostlyclean-multi
370 clean-recursive: clean-multi
371 distclean-recursive: distclean-multi
372 maintainer-clean-recursive: maintainer-clean-multi
373
374 all-multi:
375         : $(MAKE) ; exec $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do
376 install-multi:
377         $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do
378 mostlyclean-multi:
379         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean
380 clean-multi:
381         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean
382 distclean-multi:
383         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean
384 maintainer-clean-multi:
385         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean
386
387
388 ## ################################################################
389