FreeBSD procctl syscall: change arg name in error messages
[valgrind.git] / coregrind / Makefile.am
blobe3e31a73bd86eda61b17a4965521d61d78b17ccb
2 # Be very careful when renaming any files, targets, whatever, in this
3 # Makefile.  Various parts of the system rely on these names having
4 # particular forms.
6 include $(top_srcdir)/Makefile.all.am
8 #----------------------------------------------------------------------------
9 # Basics, flags
10 #----------------------------------------------------------------------------
12 AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@ += \
13         -I$(top_srcdir)/coregrind \
14         -DVG_LIBDIR="\"$(pkglibexecdir)"\" \
15         -DVG_PLATFORM="\"@VGCONF_ARCH_PRI@-@VGCONF_OS@\""
16 if VGCONF_HAVE_PLATFORM_SEC
17 AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@ += \
18         -I$(top_srcdir)/coregrind \
19         -DVG_LIBDIR="\"$(pkglibexecdir)"\" \
20         -DVG_PLATFORM="\"@VGCONF_ARCH_SEC@-@VGCONF_OS@\""
21 endif
24 EXTRA_DIST = \
25         m_debuginfo/README.txt \
26         m_gdbserver/README_DEVELOPERS \
27         docs/vgdb-manpage.xml
29 #----------------------------------------------------------------------------
30 # The launcher.  Built for the primary target only.
31 #----------------------------------------------------------------------------
33 bin_PROGRAMS = \
34         valgrind \
35         vgdb
37 if VGCONF_OS_IS_LINUX
38 valgrind_SOURCES = \
39         launcher-linux.c \
40         m_debuglog.c
41 endif
42 if VGCONF_OS_IS_DARWIN
43 valgrind_SOURCES = \
44         launcher-darwin.c \
45         m_debuglog.c
46 endif
47 if VGCONF_OS_IS_SOLARIS
48 valgrind_SOURCES = \
49         launcher-linux.c \
50         m_debuglog.c
51 endif
52 if VGCONF_OS_IS_FREEBSD
53 valgrind_SOURCES = \
54         launcher-freebsd.c \
55         m_debuglog.c
56 endif
58 # for valgrind coregrind building, use the LTO versions, in case they differ from non lto versions
59 AR = ${LTO_AR}
60 RANLIB = ${LTO_RANLIB}
62 valgrind_CPPFLAGS  = $(AM_CPPFLAGS_PRI)
63 valgrind_CFLAGS    = $(AM_CFLAGS_PRI) $(LTO_CFLAGS)
64 valgrind_CCASFLAGS = $(AM_CCASFLAGS_PRI)
65 valgrind_LDFLAGS   = $(AM_CFLAGS_PRI) @LIB_UBSAN@
66 # If there is no secondary platform, and the platforms include x86-darwin,
67 # then the primary platform must be x86-darwin.  Hence:
68 if ! VGCONF_HAVE_PLATFORM_SEC
69 if VGCONF_PLATFORMS_INCLUDE_X86_DARWIN
70 valgrind_LDFLAGS   += -Wl,-read_only_relocs -Wl,suppress
71 endif
72 endif
73 # On Android we must ask for non-executable stack, not sure why.
74 if VGCONF_PLATVARIANT_IS_ANDROID
75 valgrind_CFLAGS += -static
76 valgrind_LDFLAGS   += -Wl,-z,noexecstack
77 endif
78 if VGCONF_OS_IS_SOLARIS
79 valgrind_LDFLAGS   += -Wl,-M,/usr/lib/ld/map.noexstk
80 endif
83 vgdb_SOURCES = vgdb.c m_gdbserver/remote-utils-shared.c
84 if VGCONF_OS_IS_LINUX
85 if VGCONF_PLATVARIANT_IS_ANDROID
86 vgdb_SOURCES += vgdb-invoker-none.c
87 else
88 vgdb_SOURCES += vgdb-invoker-ptrace.c
89 endif
90 endif
91 if VGCONF_OS_IS_DARWIN
92 # Some darwin specific stuff is needed as ptrace is not
93 # fully supported on MacOS. Till we find someone courageous
94 # having access to Darwin, 'none' implementation is used.
95 vgdb_SOURCES += vgdb-invoker-none.c
96 endif
97 if VGCONF_OS_IS_SOLARIS
98 vgdb_SOURCES += vgdb-invoker-solaris.c
99 endif
100 if VGCONF_OS_IS_FREEBSD
101 vgdb_SOURCES += vgdb-invoker-freebsd.c
102 endif
104 vgdb_CPPFLAGS  = $(AM_CPPFLAGS_PRI) $(GDB_SCRIPTS_DIR)
105 vgdb_CFLAGS    = $(AM_CFLAGS_PRI) $(LTO_CFLAGS)
106 vgdb_CCASFLAGS = $(AM_CCASFLAGS_PRI)
107 vgdb_LDFLAGS   = $(AM_CFLAGS_PRI) @LIB_UBSAN@
108 if VGCONF_PLATVARIANT_IS_ANDROID
109 vgdb_CFLAGS    += -static
110 endif
111 if VGCONF_OS_IS_SOLARIS
112 vgdb_LDADD     = -lsocket
113 else
114 if !VGCONF_PLATVARIANT_IS_ANDROID
115 vgdb_LDADD     = -lpthread
116 endif
117 endif
118 # If there is no secondary platform, and the platforms include x86-darwin,
119 # then the primary platform must be x86-darwin.  Hence:
120 if ! VGCONF_HAVE_PLATFORM_SEC
121 if VGCONF_PLATFORMS_INCLUDE_X86_DARWIN
122 vgdb_LDFLAGS   += -Wl,-read_only_relocs -Wl,suppress
123 endif
124 endif
126 #----------------------------------------------------------------------------
127 # Darwin Mach stuff
128 #----------------------------------------------------------------------------
130 # Mach RPC interface definitions
131 # Here are some more .defs files that are not used, but could be in the
132 # future:
133 #       clock.defs \
134 #       clock_priv.defs \
135 #       clock_reply.defs \
136 #       exc.defs \
137 #       host_priv.defs \
138 #       host_security.defs \
139 #       ledger.defs \
140 #       lock_set.defs \
141 #       mach_host.defs \
142 #       mach_port.defs \
143 #       notify.defs \
144 #       processor.defs \
145 #       processor_set.defs \
147 mach_user_srcs =
148 mach_server_srcs =
149 mach_hdrs =
150 mach_defs =
151 if VGCONF_OS_IS_DARWIN
152 mach_user_srcs += \
153         m_mach/mach_vmUser.c \
154         m_mach/taskUser.c \
155         m_mach/thread_actUser.c \
156         m_mach/vm_mapUser.c
157 mach_server_srcs += \
158         m_mach/mach_vmServer.c \
159         m_mach/taskServer.c \
160         m_mach/thread_actServer.c \
161         m_mach/vm_mapServer.c
162 mach_hdrs += \
163         m_mach/mach_vm.h \
164         m_mach/task.h \
165         m_mach/thread_act.h \
166         m_mach/vm_map.h
167 mach_defs += \
168         @XCODE_DIR@/mach/mach_vm.defs \
169         @XCODE_DIR@/mach/task.defs \
170         @XCODE_DIR@/mach/thread_act.defs \
171         @XCODE_DIR@/mach/vm_map.defs
172 endif
174 # Be careful w.r.t. parallel builds.  See section 27.9 of the automake info
175 # page, "Handling Tools that Produce many Outputs".
176 $(abs_builddir)/m_mach: 
177         mkdir -p $@
178 $(mach_user_srcs): $(mach_defs) $(abs_builddir)/m_mach
179         (cd m_mach && mig $(mach_defs))
180 $(mach_hdrs): $(mach_defs) $(mach_user_srcs) $(abs_builddir)/m_mach
181         (cd m_mach && mig $(mach_defs))
183 #----------------------------------------------------------------------------
184 # Headers
185 #----------------------------------------------------------------------------
187 noinst_HEADERS = \
188         pub_core_addrinfo.h     \
189         pub_core_aspacehl.h     \
190         pub_core_aspacemgr.h    \
191         pub_core_basics.h       \
192         pub_core_basics_asm.h   \
193         pub_core_clientstate.h  \
194         pub_core_clreq.h        \
195         pub_core_commandline.h  \
196         pub_core_coredump.h     \
197         pub_core_cpuid.h        \
198         pub_core_deduppoolalloc.h \
199         pub_core_debuginfo.h    \
200         pub_core_debuglog.h     \
201         pub_core_demangle.h     \
202         pub_core_dispatch.h     \
203         pub_core_dispatch_asm.h \
204         pub_core_errormgr.h     \
205         pub_core_execontext.h   \
206         pub_core_extension.h    \
207         pub_core_gdbserver.h    \
208         pub_core_guest.h        \
209         pub_core_hashtable.h    \
210         pub_core_initimg.h      \
211         pub_core_inner.h        \
212         pub_core_libcbase.h     \
213         pub_core_libcassert.h   \
214         pub_core_libcfile.h     \
215         pub_core_libcprint.h    \
216         pub_core_libcproc.h     \
217         pub_core_libcsetjmp.h   \
218         pub_core_libcsignal.h   \
219         pub_core_mach.h         \
220         pub_core_machine.h      \
221         pub_core_mallocfree.h   \
222         pub_core_options.h      \
223         pub_core_oset.h         \
224         pub_core_pathscan.h     \
225         pub_core_poolalloc.h    \
226         pub_core_rangemap.h     \
227         pub_core_redir.h        \
228         pub_core_replacemalloc.h\
229         pub_core_sbprofile.h    \
230         pub_core_scheduler.h    \
231         pub_core_seqmatch.h     \
232         pub_core_sigframe.h     \
233         pub_core_signals.h      \
234         pub_core_sparsewa.h     \
235         pub_core_stacks.h       \
236         pub_core_stacktrace.h   \
237         pub_core_syscall.h      \
238         pub_core_syswrap.h      \
239         pub_core_threadstate.h  \
240         pub_core_tooliface.h    \
241         pub_core_trampoline.h   \
242         pub_core_translate.h    \
243         pub_core_transtab.h     \
244         pub_core_transtab_asm.h \
245         pub_core_ume.h          \
246         pub_core_vki.h          \
247         pub_core_vkiscnums.h    \
248         pub_core_vkiscnums_asm.h\
249         pub_core_wordfm.h       \
250         pub_core_xarray.h       \
251         pub_core_xtree.h        \
252         pub_core_xtmemory.h     \
253         m_aspacemgr/priv_aspacemgr.h \
254         m_debuginfo/priv_misc.h \
255         m_debuginfo/priv_storage.h      \
256         m_debuginfo/priv_tytypes.h      \
257         m_debuginfo/priv_readpdb.h      \
258         m_debuginfo/priv_d3basics.h     \
259         m_debuginfo/priv_readdwarf.h    \
260         m_debuginfo/priv_readdwarf3.h   \
261         m_debuginfo/priv_readelf.h      \
262         m_debuginfo/priv_readexidx.h    \
263         m_debuginfo/priv_readmacho.h    \
264         m_debuginfo/priv_image.h        \
265         m_debuginfo/lzoconf.h           \
266         m_debuginfo/lzodefs.h           \
267         m_debuginfo/minilzo.h           \
268         m_demangle/ansidecl.h   \
269         m_demangle/cp-demangle.h \
270         m_demangle/dyn-string.h \
271         m_demangle/demangle.h   \
272         m_demangle/safe-ctype.h \
273         m_demangle/vg_libciface.h \
274         m_extension/priv_extension.h \
275         m_extension/priv_types_n_macros.h \
276         m_gdbserver/regcache.h \
277         m_gdbserver/regdef.h \
278         m_gdbserver/server.h \
279         m_gdbserver/remote-utils-shared.h \
280         m_gdbserver/target.h \
281         m_gdbserver/valgrind_low.h \
282         m_gdbserver/gdb/signals.h \
283         m_scheduler/priv_sema.h \
284         m_scheduler/priv_sched-lock.h \
285         m_scheduler/priv_sched-lock-impl.h \
286         m_sigframe/priv_sigframe.h \
287         m_syswrap/priv_types_n_macros.h \
288         m_syswrap/priv_syswrap-generic.h \
289         m_syswrap/priv_syswrap-linux.h \
290         m_syswrap/priv_syswrap-linux-variants.h \
291         m_syswrap/priv_syswrap-freebsd.h \
292         m_syswrap/priv_syswrap-darwin.h \
293         m_syswrap/priv_syswrap-solaris.h \
294         m_syswrap/priv_syswrap-main.h \
295         m_syswrap/priv_syswrap-xen.h \
296         m_ume/priv_ume.h \
297         vgdb.h
299 #----------------------------------------------------------------------------
300 # libcoregrind-<platform>.a
301 #----------------------------------------------------------------------------
303 BUILT_SOURCES = $(mach_user_srcs)
304 CLEANFILES    = $(mach_user_srcs) $(mach_server_srcs) $(mach_hdrs)
306 pkglib_LIBRARIES  = libcoregrind-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a
307 if VGCONF_HAVE_PLATFORM_SEC
308 pkglib_LIBRARIES += libcoregrind-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a
309 endif
311 COREGRIND_SOURCES_COMMON = \
312         m_addrinfo.c \
313         m_cache.c \
314         m_commandline.c \
315         m_compiler.c \
316         m_clientstate.c \
317         m_cpuid.S \
318         m_deduppoolalloc.c \
319         m_debuglog.c \
320         m_errormgr.c \
321         m_execontext.c \
322         m_hashtable.c \
323         m_libcbase.c \
324         m_libcassert.c \
325         m_libcfile.c \
326         m_libcprint.c \
327         m_libcproc.c \
328         m_libcsignal.c \
329         m_machine.c \
330         m_mallocfree.c \
331         m_options.c \
332         m_oset.c \
333         m_pathscan.c \
334         m_poolalloc.c \
335         m_rangemap.c \
336         m_redir.c \
337         m_sbprofile.c \
338         m_seqmatch.c \
339         m_signals.c \
340         m_sparsewa.c \
341         m_stacktrace.c \
342         m_syscall.c \
343         m_threadstate.c \
344         m_tooliface.c \
345         m_trampoline.S \
346         m_translate.c \
347         m_transtab.c \
348         m_vki.c \
349         m_vkiscnums.c \
350         m_wordfm.c \
351         m_xarray.c \
352         m_xtree.c \
353         m_xtmemory.c \
354         m_aspacehl.c \
355         m_aspacemgr/aspacemgr-common.c \
356         m_aspacemgr/aspacemgr-linux.c \
357         m_aspacemgr/aspacemgr-segnames.c \
358         m_coredump/coredump-elf.c \
359         m_coredump/coredump-macho.c \
360         m_coredump/coredump-solaris.c \
361         m_debuginfo/misc.c \
362         m_debuginfo/d3basics.c \
363         m_debuginfo/debuginfo.c \
364         m_debuginfo/image.c \
365         m_debuginfo/minilzo-inl.c \
366         m_debuginfo/readdwarf.c \
367         m_debuginfo/readdwarf3.c \
368         m_debuginfo/readelf.c \
369         m_debuginfo/readexidx.c \
370         m_debuginfo/readmacho.c \
371         m_debuginfo/readpdb.c \
372         m_debuginfo/storage.c \
373         m_debuginfo/tinfl.c \
374         m_debuginfo/tytypes.c \
375         m_demangle/cp-demangle.c \
376         m_demangle/cplus-dem.c \
377         m_demangle/demangle.c \
378         m_demangle/dyn-string.c \
379         m_demangle/d-demangle.c \
380         m_demangle/rust-demangle.c \
381         m_demangle/safe-ctype.c \
382         m_dispatch/dispatch-x86-linux.S \
383         m_dispatch/dispatch-amd64-linux.S \
384         m_dispatch/dispatch-ppc32-linux.S \
385         m_dispatch/dispatch-ppc64be-linux.S \
386         m_dispatch/dispatch-ppc64le-linux.S \
387         m_dispatch/dispatch-arm-linux.S \
388         m_dispatch/dispatch-arm64-linux.S \
389         m_dispatch/dispatch-s390x-linux.S \
390         m_dispatch/dispatch-mips32-linux.S \
391         m_dispatch/dispatch-mips64-linux.S \
392         m_dispatch/dispatch-nanomips-linux.S \
393         m_dispatch/dispatch-x86-freebsd.S \
394         m_dispatch/dispatch-amd64-freebsd.S \
395         m_dispatch/dispatch-arm64-freebsd.S \
396         m_dispatch/dispatch-x86-darwin.S \
397         m_dispatch/dispatch-amd64-darwin.S \
398         m_dispatch/dispatch-x86-solaris.S \
399         m_dispatch/dispatch-amd64-solaris.S \
400         m_extension/extension-main.c \
401         m_extension/extension-s390x.c \
402         m_gdbserver/inferiors.c \
403         m_gdbserver/regcache.c \
404         m_gdbserver/remote-utils.c \
405         m_gdbserver/remote-utils-shared-gdbserver.c \
406         m_gdbserver/server.c \
407         m_gdbserver/signals.c \
408         m_gdbserver/target.c \
409         m_gdbserver/utils.c \
410         m_gdbserver/valgrind-low-x86.c \
411         m_gdbserver/valgrind-low-amd64.c \
412         m_gdbserver/valgrind-low-arm.c \
413         m_gdbserver/valgrind-low-arm64.c \
414         m_gdbserver/valgrind-low-ppc32.c \
415         m_gdbserver/valgrind-low-ppc64.c \
416         m_gdbserver/valgrind-low-s390x.c \
417         m_gdbserver/valgrind-low-mips32.c \
418         m_gdbserver/valgrind-low-mips64.c \
419         m_gdbserver/valgrind-low-nanomips.c \
420         m_gdbserver/version.c \
421         m_initimg/initimg-linux.c \
422         m_initimg/initimg-freebsd.c \
423         m_initimg/initimg-darwin.c \
424         m_initimg/initimg-solaris.c \
425         m_mach/mach_basics.c \
426         m_mach/mach_msg.c \
427         m_mach/mach_traps-x86-darwin.S \
428         m_mach/mach_traps-amd64-darwin.S \
429         m_replacemalloc/replacemalloc_core.c \
430         m_scheduler/sched-lock.c \
431         m_scheduler/sched-lock-generic.c \
432         m_scheduler/scheduler.c \
433         m_scheduler/sema.c \
434         m_sigframe/sigframe-common.c \
435         m_sigframe/sigframe-x86-linux.c \
436         m_sigframe/sigframe-amd64-linux.c \
437         m_sigframe/sigframe-x86-freebsd.c \
438         m_sigframe/sigframe-amd64-freebsd.c \
439         m_sigframe/sigframe-arm64-freebsd.c \
440         m_sigframe/sigframe-ppc32-linux.c \
441         m_sigframe/sigframe-ppc64-linux.c \
442         m_sigframe/sigframe-arm-linux.c \
443         m_sigframe/sigframe-arm64-linux.c \
444         m_sigframe/sigframe-s390x-linux.c \
445         m_sigframe/sigframe-mips32-linux.c \
446         m_sigframe/sigframe-mips64-linux.c \
447         m_sigframe/sigframe-nanomips-linux.c \
448         m_sigframe/sigframe-x86-darwin.c \
449         m_sigframe/sigframe-amd64-darwin.c \
450         m_sigframe/sigframe-solaris.c \
451         m_syswrap/syscall-x86-linux.S \
452         m_syswrap/syscall-amd64-linux.S \
453         m_syswrap/syscall-ppc32-linux.S \
454         m_syswrap/syscall-ppc64be-linux.S \
455         m_syswrap/syscall-ppc64le-linux.S \
456         m_syswrap/syscall-arm-linux.S \
457         m_syswrap/syscall-arm64-linux.S \
458         m_syswrap/syscall-s390x-linux.S \
459         m_syswrap/syscall-mips32-linux.S \
460         m_syswrap/syscall-mips64-linux.S \
461         m_syswrap/syscall-nanomips-linux.S \
462         m_syswrap/syscall-x86-freebsd.S \
463         m_syswrap/syscall-amd64-freebsd.S \
464         m_syswrap/syscall-arm64-freebsd.S \
465         m_syswrap/syscall-x86-darwin.S \
466         m_syswrap/syscall-amd64-darwin.S \
467         m_syswrap/syscall-x86-solaris.S \
468         m_syswrap/syscall-amd64-solaris.S \
469         m_syswrap/syswrap-main.c \
470         m_syswrap/syswrap-generic.c \
471         m_syswrap/syswrap-linux.c \
472         m_syswrap/syswrap-linux-variants.c \
473         m_syswrap/syswrap-freebsd.c \
474         m_syswrap/syswrap-darwin.c \
475         m_syswrap/syswrap-solaris.c \
476         m_syswrap/syswrap-x86-linux.c \
477         m_syswrap/syswrap-amd64-linux.c \
478         m_syswrap/syswrap-ppc32-linux.c \
479         m_syswrap/syswrap-ppc64-linux.c \
480         m_syswrap/syswrap-x86-freebsd.c \
481         m_syswrap/syswrap-amd64-freebsd.c \
482         m_syswrap/syswrap-arm64-freebsd.c \
483         m_syswrap/syswrap-arm-linux.c \
484         m_syswrap/syswrap-arm64-linux.c \
485         m_syswrap/syswrap-s390x-linux.c \
486         m_syswrap/syswrap-mips32-linux.c \
487         m_syswrap/syswrap-mips64-linux.c \
488         m_syswrap/syswrap-nanomips-linux.c \
489         m_syswrap/syswrap-x86-darwin.c \
490         m_syswrap/syswrap-amd64-darwin.c \
491         m_syswrap/syswrap-xen.c \
492         m_syswrap/syswrap-x86-solaris.c \
493         m_syswrap/syswrap-amd64-solaris.c \
494         m_ume/elf.c \
495         m_ume/macho.c \
496         m_ume/main.c \
497         m_ume/script.c
499 # The below files cannot be compiled with lto, otherwise that gives
500 # undefined symbols at link time. So, define a noinst library to
501 # build the needed .o with specific flags.
502 # These objects are added to the libcoregrind library.
503 NOLTO_COREGRIND_SOURCES_COMMON = \
504         m_libcsetjmp.c \
505         m_main.c \
506         m_stacks.c \
507         m_gdbserver/m_gdbserver.c
508 noinst_LIBRARIES = libnolto_coregrind-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a
509 libnolto_coregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
510     $(NOLTO_COREGRIND_SOURCES_COMMON)
511 libnolto_coregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CPPFLAGS = \
512     $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
513 libnolto_coregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CFLAGS = \
514     $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
515 libnolto_coregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CCASFLAGS = \
516     $(AM_CCASFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
518 if VGCONF_HAVE_PLATFORM_SEC
519 noinst_LIBRARIES += libnolto_coregrind-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a
520 libnolto_coregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES = \
521     $(NOLTO_COREGRIND_SOURCES_COMMON)
522 libnolto_coregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CPPFLAGS = \
523     $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
524 libnolto_coregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CFLAGS = \
525     $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
526 libnolto_coregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CCASFLAGS = \
527     $(AM_CCASFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
528 endif
531 libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
532     $(COREGRIND_SOURCES_COMMON)
533 nodist_libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
534     $(BUILT_SOURCES)
535 libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CPPFLAGS = \
536     $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
537 libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CFLAGS = $(LTO_CFLAGS) \
538     $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
539 libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CCASFLAGS = \
540     $(AM_CCASFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
541 if ENABLE_LINUX_TICKET_LOCK_PRIMARY
542 libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES += \
543     m_scheduler/ticket-lock-linux.c
544 libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CFLAGS += \
545     -DENABLE_LINUX_TICKET_LOCK
546 endif
547 libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_LIBADD = \
548     $(libnolto_coregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_OBJECTS)
549 libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_DEPENDENCIES = \
550     libnolto_coregrind-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a
552 if VGCONF_HAVE_PLATFORM_SEC
553 libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES = \
554     $(COREGRIND_SOURCES_COMMON)
555 nodist_libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES = \
556     $(BUILT_SOURCES)
557 libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CPPFLAGS = \
558     $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
559 libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CFLAGS =  $(LTO_CFLAGS) \
560     $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
561 libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CCASFLAGS = \
562     $(AM_CCASFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
563 if ENABLE_LINUX_TICKET_LOCK_SECONDARY
564 libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES += \
565     m_scheduler/ticket-lock-linux.c
566 libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CFLAGS += \
567     -DENABLE_LINUX_TICKET_LOCK
568 endif
569 libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_LIBADD = \
570     $(libnolto_coregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_OBJECTS)
571 libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_DEPENDENCIES = \
572     libnolto_coregrind-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a
573 endif
575 #----------------------------------------------------------------------------
576 # libgcc-sup-<platform>.a
577 # Special supplemental library for functions normally supplied by glibc
578 # used by libgcc.
579 #----------------------------------------------------------------------------
581 pkglib_LIBRARIES  += libgcc-sup-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a
582 if VGCONF_HAVE_PLATFORM_SEC
583 pkglib_LIBRARIES += libgcc-sup-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a
584 endif
586 libgcc_sup_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
587         m_libgcc_sup.c
588 libgcc_sup_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CPPFLAGS = \
589         $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
590 libgcc_sup_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CFLAGS = \
591         $(AM_CFLAGS_PSO_@VGCONF_PLATFORM_PRI_CAPS@)
592 if VGCONF_HAVE_PLATFORM_SEC
593 libgcc_sup_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES = \
594         m_libgcc_sup.c
595 libgcc_sup_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CPPFLAGS = \
596         $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
597 libgcc_sup_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CFLAGS = \
598         $(AM_CFLAGS_PSO_@VGCONF_PLATFORM_SEC_CAPS@)
599 endif
601 #----------------------------------------------------------------------------
602 # libreplacemalloc_toolpreload-<platform>.a
603 #----------------------------------------------------------------------------
605 pkglib_LIBRARIES += libreplacemalloc_toolpreload-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a
606 if VGCONF_HAVE_PLATFORM_SEC
607 pkglib_LIBRARIES += libreplacemalloc_toolpreload-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a
608 endif
610 libreplacemalloc_toolpreload_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
611         m_replacemalloc/vg_replace_malloc.c
612 libreplacemalloc_toolpreload_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CPPFLAGS = \
613         $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
614 libreplacemalloc_toolpreload_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CFLAGS = \
615         $(AM_CFLAGS_PSO_@VGCONF_PLATFORM_PRI_CAPS@)
616 if VGCONF_HAVE_PLATFORM_SEC
617 libreplacemalloc_toolpreload_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES = \
618         m_replacemalloc/vg_replace_malloc.c
619 libreplacemalloc_toolpreload_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CPPFLAGS = \
620         $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
621 libreplacemalloc_toolpreload_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CFLAGS = \
622         $(AM_CFLAGS_PSO_@VGCONF_PLATFORM_SEC_CAPS@)
623 endif
625 #----------------------------------------------------------------------------
626 # vgpreload_core-<platform>.a
627 #----------------------------------------------------------------------------
629 noinst_PROGRAMS  = vgpreload_core-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so
630 if VGCONF_HAVE_PLATFORM_SEC
631 noinst_PROGRAMS += vgpreload_core-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so
632 endif
634 if VGCONF_OS_IS_DARWIN
635 noinst_DSYMS = $(noinst_PROGRAMS)
636 endif
638 if GDBSCRIPTS
639   GDB_SCRIPTS_DIR=-DVG_GDBSCRIPTS_DIR="\"@VG_GDBSCRIPTS_DIR@\""
640 else
641   GDB_SCRIPTS_DIR=
642 endif
644 vgpreload_core_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_SOURCES = vg_preloaded.c
645 vgpreload_core_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CPPFLAGS = \
646         $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) $(GDB_SCRIPTS_DIR)
647 vgpreload_core_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CFLAGS = \
648         $(AM_CFLAGS_PSO_@VGCONF_PLATFORM_PRI_CAPS@)
649 vgpreload_core_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_LDFLAGS = \
650         $(PRELOAD_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
651 if VGCONF_HAVE_PLATFORM_SEC
652 vgpreload_core_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_SOURCES = vg_preloaded.c
653 vgpreload_core_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CPPFLAGS = \
654         $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) $(GDBSCRIPTS_DIR)
655 vgpreload_core_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CFLAGS = \
656         $(AM_CFLAGS_PSO_@VGCONF_PLATFORM_SEC_CAPS@)
657 vgpreload_core_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_LDFLAGS = \
658         $(PRELOAD_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
659 endif
661 if VGCONF_OS_IS_SOLARIS
662 # Give the vgpreload_core library a proper soname so it can be easily
663 # recognized during reading of debug information.
664 vgpreload_core_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_LDFLAGS += \
665         -Wl,-soname -Wl,vgpreload_core.so.0
666 if VGCONF_HAVE_PLATFORM_SEC
667 vgpreload_core_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_LDFLAGS += \
668         -Wl,-soname -Wl,vgpreload_core.so.0
669 endif
670 endif
672 #----------------------------------------------------------------------------
673 # gdbserver xml target descriptions
674 #----------------------------------------------------------------------------
676 GDBSERVER_XML_FILES = \
677         m_gdbserver/32bit-core-valgrind-s1.xml \
678         m_gdbserver/32bit-core-valgrind-s2.xml \
679         m_gdbserver/32bit-core.xml \
680         m_gdbserver/32bit-linux-valgrind-s1.xml \
681         m_gdbserver/32bit-linux-valgrind-s2.xml \
682         m_gdbserver/32bit-linux.xml \
683         m_gdbserver/32bit-sse-valgrind-s1.xml \
684         m_gdbserver/32bit-sse-valgrind-s2.xml \
685         m_gdbserver/32bit-sse.xml \
686         m_gdbserver/64bit-avx-valgrind-s2.xml \
687         m_gdbserver/64bit-avx-valgrind-s1.xml \
688         m_gdbserver/64bit-avx.xml \
689         m_gdbserver/64bit-core-valgrind-s1.xml \
690         m_gdbserver/64bit-core-valgrind-s2.xml \
691         m_gdbserver/64bit-core.xml \
692         m_gdbserver/64bit-linux-valgrind-s1.xml \
693         m_gdbserver/64bit-linux-valgrind-s2.xml \
694         m_gdbserver/64bit-linux.xml \
695         m_gdbserver/64bit-sse-valgrind-s1.xml \
696         m_gdbserver/64bit-sse-valgrind-s2.xml \
697         m_gdbserver/64bit-sse.xml \
698         m_gdbserver/amd64-avx-coresse-valgrind.xml \
699         m_gdbserver/amd64-avx-coresse.xml \
700         m_gdbserver/amd64-avx-linux-valgrind.xml \
701         m_gdbserver/amd64-avx-linux.xml \
702         m_gdbserver/amd64-coresse-valgrind.xml \
703         m_gdbserver/amd64-linux-valgrind.xml \
704         m_gdbserver/arm-core-valgrind-s1.xml \
705         m_gdbserver/arm-core-valgrind-s2.xml \
706         m_gdbserver/arm-core.xml \
707         m_gdbserver/arm-vfpv3-valgrind-s1.xml \
708         m_gdbserver/arm-vfpv3-valgrind-s2.xml \
709         m_gdbserver/arm-vfpv3.xml \
710         m_gdbserver/arm-with-vfpv3-valgrind.xml \
711         m_gdbserver/arm-with-vfpv3.xml \
712         m_gdbserver/i386-coresse-valgrind.xml \
713         m_gdbserver/i386-linux-valgrind.xml \
714         m_gdbserver/power64-core-valgrind-s1.xml \
715         m_gdbserver/power64-core-valgrind-s2.xml \
716         m_gdbserver/power64-core.xml \
717         m_gdbserver/power64-core2-valgrind-s1.xml \
718         m_gdbserver/power64-core2-valgrind-s2.xml \
719         m_gdbserver/power64-linux-valgrind-s1.xml \
720         m_gdbserver/power64-linux-valgrind-s2.xml \
721         m_gdbserver/power64-linux.xml \
722         m_gdbserver/power-altivec-valgrind-s1.xml \
723         m_gdbserver/power-altivec-valgrind-s2.xml \
724         m_gdbserver/power-altivec.xml \
725         m_gdbserver/power-vsx-valgrind-s1.xml \
726         m_gdbserver/power-vsx-valgrind-s2.xml \
727         m_gdbserver/power-vsx.xml \
728         m_gdbserver/power-core-valgrind-s1.xml \
729         m_gdbserver/power-core-valgrind-s2.xml \
730         m_gdbserver/power-core.xml \
731         m_gdbserver/power-fpu-valgrind-s1.xml \
732         m_gdbserver/power-fpu-valgrind-s2.xml \
733         m_gdbserver/power-fpu.xml \
734         m_gdbserver/power-linux-valgrind-s1.xml \
735         m_gdbserver/power-linux-valgrind-s2.xml \
736         m_gdbserver/power-linux.xml \
737         m_gdbserver/powerpc-altivec32l-valgrind.xml \
738         m_gdbserver/powerpc-altivec32l.xml \
739         m_gdbserver/powerpc-altivec64l-valgrind.xml \
740         m_gdbserver/powerpc-altivec64l.xml \
741         m_gdbserver/s390-acr-valgrind-s1.xml \
742         m_gdbserver/s390-acr-valgrind-s2.xml \
743         m_gdbserver/s390-acr.xml \
744         m_gdbserver/s390-fpr-valgrind-s1.xml \
745         m_gdbserver/s390-fpr-valgrind-s2.xml \
746         m_gdbserver/s390-fpr.xml \
747         m_gdbserver/s390x-core64-valgrind-s1.xml \
748         m_gdbserver/s390x-core64-valgrind-s2.xml \
749         m_gdbserver/s390x-core64.xml \
750         m_gdbserver/s390x-generic-valgrind.xml \
751         m_gdbserver/s390x-generic.xml \
752         m_gdbserver/s390x-linux64-valgrind-s1.xml \
753         m_gdbserver/s390x-linux64-valgrind-s2.xml \
754         m_gdbserver/s390x-linux64.xml \
755         m_gdbserver/s390-vx-valgrind-s1.xml \
756         m_gdbserver/s390-vx-valgrind-s2.xml \
757         m_gdbserver/s390-vx.xml \
758         m_gdbserver/s390x-vx-linux-valgrind.xml \
759         m_gdbserver/s390x-vx-linux.xml \
760         m_gdbserver/mips-cp0-valgrind-s1.xml \
761         m_gdbserver/mips-cp0-valgrind-s2.xml \
762         m_gdbserver/mips-cp0.xml \
763         m_gdbserver/mips-cpu-valgrind-s1.xml \
764         m_gdbserver/mips-cpu-valgrind-s2.xml \
765         m_gdbserver/mips-cpu.xml \
766         m_gdbserver/mips-linux.xml \
767         m_gdbserver/mips-linux-valgrind.xml \
768         m_gdbserver/mips-fpu-valgrind-s1.xml \
769         m_gdbserver/mips-fpu-valgrind-s2.xml \
770         m_gdbserver/mips-fpu.xml \
771         m_gdbserver/mips64-cp0-valgrind-s1.xml \
772         m_gdbserver/mips64-cp0-valgrind-s2.xml \
773         m_gdbserver/mips64-cp0.xml \
774         m_gdbserver/mips64-cpu-valgrind-s1.xml \
775         m_gdbserver/mips64-cpu-valgrind-s2.xml \
776         m_gdbserver/mips64-cpu.xml \
777         m_gdbserver/mips64-linux.xml \
778         m_gdbserver/mips64-linux-valgrind.xml \
779         m_gdbserver/mips64-fpu-valgrind-s1.xml \
780         m_gdbserver/mips64-fpu-valgrind-s2.xml \
781         m_gdbserver/mips64-fpu.xml
783 # so as to make sure these get copied into the install tree
784 vglibdir = $(pkglibexecdir)
785 vglib_DATA  = $(GDBSERVER_XML_FILES)
787 if GDBSCRIPTS
788 gdbscriptsdir = @VG_GDBSCRIPTS_DIR@
789 gdbscripts_DATA  = m_gdbserver/valgrind-monitor.py
790 gdbscripts_DATA += m_gdbserver/valgrind-monitor-def.py
791 endif
793 # so as to make sure these get copied into the tarball
794 EXTRA_DIST  += $(GDBSERVER_XML_FILES)
795 EXTRA_DIST  += m_gdbserver/valgrind-monitor.py
796 EXTRA_DIST  += m_gdbserver/valgrind-monitor-def.py
798 #----------------------------------------------------------------------------
799 # General stuff
800 #----------------------------------------------------------------------------
802 all-local: inplace-noinst_PROGRAMS inplace-noinst_DSYMS
803         mkdir -p $(inplacedir); \
804         for f in $(vglib_DATA); do \
805           rm -f $(inplacedir)/$$f; \
806           ln -f -s ../$(subdir)/$$f $(inplacedir); \
807         done
809 clean-local: clean-noinst_DSYMS
811 install-exec-local: install-noinst_PROGRAMS install-noinst_DSYMS
813 uninstall-local: uninstall-noinst_PROGRAMS uninstall-noinst_DSYMS
815 #----------------------------------------------------------------------------
816 # Darwin linker kludges
817 #----------------------------------------------------------------------------
819 if VGCONF_OS_IS_DARWIN
821 BUILT_SOURCES += fixup_macho_loadcmds
822 fixup_macho_loadcmds: fixup_macho_loadcmds.c
823         $(CC) -I$(top_srcdir) -I$(top_builddir) -g -Wall -o $@ $<
825 CLEANFILES += fixup_macho_loadcmds
827 endif
829 EXTRA_DIST += fixup_macho_loadcmds.c