Remove source file added to EXTRA_DIST in error
[valgrind.git] / coregrind / Makefile.am
blob80115f21fedd71a2b38de56847cbef652d1807cd
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
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)
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_gdbserver.h    \
207         pub_core_guest.h        \
208         pub_core_hashtable.h    \
209         pub_core_initimg.h      \
210         pub_core_inner.h        \
211         pub_core_libcbase.h     \
212         pub_core_libcassert.h   \
213         pub_core_libcfile.h     \
214         pub_core_libcprint.h    \
215         pub_core_libcproc.h     \
216         pub_core_libcsetjmp.h   \
217         pub_core_libcsignal.h   \
218         pub_core_mach.h         \
219         pub_core_machine.h      \
220         pub_core_mallocfree.h   \
221         pub_core_options.h      \
222         pub_core_oset.h         \
223         pub_core_pathscan.h     \
224         pub_core_poolalloc.h    \
225         pub_core_rangemap.h     \
226         pub_core_redir.h        \
227         pub_core_replacemalloc.h\
228         pub_core_sbprofile.h    \
229         pub_core_scheduler.h    \
230         pub_core_seqmatch.h     \
231         pub_core_sigframe.h     \
232         pub_core_signals.h      \
233         pub_core_sparsewa.h     \
234         pub_core_stacks.h       \
235         pub_core_stacktrace.h   \
236         pub_core_syscall.h      \
237         pub_core_syswrap.h      \
238         pub_core_threadstate.h  \
239         pub_core_tooliface.h    \
240         pub_core_trampoline.h   \
241         pub_core_translate.h    \
242         pub_core_transtab.h     \
243         pub_core_transtab_asm.h \
244         pub_core_ume.h          \
245         pub_core_vki.h          \
246         pub_core_vkiscnums.h    \
247         pub_core_vkiscnums_asm.h\
248         pub_core_wordfm.h       \
249         pub_core_xarray.h       \
250         pub_core_xtree.h        \
251         pub_core_xtmemory.h     \
252         m_aspacemgr/priv_aspacemgr.h \
253         m_debuginfo/priv_misc.h \
254         m_debuginfo/priv_storage.h      \
255         m_debuginfo/priv_tytypes.h      \
256         m_debuginfo/priv_readpdb.h      \
257         m_debuginfo/priv_d3basics.h     \
258         m_debuginfo/priv_readdwarf.h    \
259         m_debuginfo/priv_readdwarf3.h   \
260         m_debuginfo/priv_readelf.h      \
261         m_debuginfo/priv_readexidx.h    \
262         m_debuginfo/priv_readmacho.h    \
263         m_debuginfo/priv_image.h        \
264         m_debuginfo/lzoconf.h           \
265         m_debuginfo/lzodefs.h           \
266         m_debuginfo/minilzo.h           \
267         m_demangle/ansidecl.h   \
268         m_demangle/cp-demangle.h \
269         m_demangle/dyn-string.h \
270         m_demangle/demangle.h   \
271         m_demangle/safe-ctype.h \
272         m_demangle/vg_libciface.h \
273         m_gdbserver/regcache.h \
274         m_gdbserver/regdef.h \
275         m_gdbserver/server.h \
276         m_gdbserver/target.h \
277         m_gdbserver/valgrind_low.h \
278         m_gdbserver/gdb/signals.h \
279         m_scheduler/priv_sema.h \
280         m_scheduler/priv_sched-lock.h \
281         m_scheduler/priv_sched-lock-impl.h \
282         m_sigframe/priv_sigframe.h \
283         m_syswrap/priv_types_n_macros.h \
284         m_syswrap/priv_syswrap-generic.h \
285         m_syswrap/priv_syswrap-linux.h \
286         m_syswrap/priv_syswrap-linux-variants.h \
287         m_syswrap/priv_syswrap-freebsd.h \
288         m_syswrap/priv_syswrap-darwin.h \
289         m_syswrap/priv_syswrap-solaris.h \
290         m_syswrap/priv_syswrap-main.h \
291         m_syswrap/priv_syswrap-xen.h \
292         m_ume/priv_ume.h \
293         vgdb.h
295 #----------------------------------------------------------------------------
296 # libcoregrind-<platform>.a
297 #----------------------------------------------------------------------------
299 BUILT_SOURCES = $(mach_user_srcs)
300 CLEANFILES    = $(mach_user_srcs) $(mach_server_srcs) $(mach_hdrs)
302 pkglib_LIBRARIES  = libcoregrind-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a
303 if VGCONF_HAVE_PLATFORM_SEC
304 pkglib_LIBRARIES += libcoregrind-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a
305 endif
307 COREGRIND_SOURCES_COMMON = \
308         m_addrinfo.c \
309         m_cache.c \
310         m_commandline.c \
311         m_compiler.c \
312         m_clientstate.c \
313         m_cpuid.S \
314         m_deduppoolalloc.c \
315         m_debuglog.c \
316         m_errormgr.c \
317         m_execontext.c \
318         m_hashtable.c \
319         m_libcbase.c \
320         m_libcassert.c \
321         m_libcfile.c \
322         m_libcprint.c \
323         m_libcproc.c \
324         m_libcsignal.c \
325         m_machine.c \
326         m_mallocfree.c \
327         m_options.c \
328         m_oset.c \
329         m_pathscan.c \
330         m_poolalloc.c \
331         m_rangemap.c \
332         m_redir.c \
333         m_sbprofile.c \
334         m_seqmatch.c \
335         m_signals.c \
336         m_sparsewa.c \
337         m_stacks.c \
338         m_stacktrace.c \
339         m_syscall.c \
340         m_threadstate.c \
341         m_tooliface.c \
342         m_trampoline.S \
343         m_translate.c \
344         m_transtab.c \
345         m_vki.c \
346         m_vkiscnums.c \
347         m_wordfm.c \
348         m_xarray.c \
349         m_xtree.c \
350         m_xtmemory.c \
351         m_aspacehl.c \
352         m_aspacemgr/aspacemgr-common.c \
353         m_aspacemgr/aspacemgr-linux.c \
354         m_aspacemgr/aspacemgr-segnames.c \
355         m_coredump/coredump-elf.c \
356         m_coredump/coredump-macho.c \
357         m_coredump/coredump-solaris.c \
358         m_debuginfo/misc.c \
359         m_debuginfo/d3basics.c \
360         m_debuginfo/debuginfo.c \
361         m_debuginfo/image.c \
362         m_debuginfo/minilzo-inl.c \
363         m_debuginfo/readdwarf.c \
364         m_debuginfo/readdwarf3.c \
365         m_debuginfo/readelf.c \
366         m_debuginfo/readexidx.c \
367         m_debuginfo/readmacho.c \
368         m_debuginfo/readpdb.c \
369         m_debuginfo/storage.c \
370         m_debuginfo/tinfl.c \
371         m_debuginfo/tytypes.c \
372         m_demangle/cp-demangle.c \
373         m_demangle/cplus-dem.c \
374         m_demangle/demangle.c \
375         m_demangle/dyn-string.c \
376         m_demangle/d-demangle.c \
377         m_demangle/rust-demangle.c \
378         m_demangle/safe-ctype.c \
379         m_dispatch/dispatch-x86-linux.S \
380         m_dispatch/dispatch-amd64-linux.S \
381         m_dispatch/dispatch-ppc32-linux.S \
382         m_dispatch/dispatch-ppc64be-linux.S \
383         m_dispatch/dispatch-ppc64le-linux.S \
384         m_dispatch/dispatch-arm-linux.S \
385         m_dispatch/dispatch-arm64-linux.S \
386         m_dispatch/dispatch-s390x-linux.S \
387         m_dispatch/dispatch-mips32-linux.S \
388         m_dispatch/dispatch-mips64-linux.S \
389         m_dispatch/dispatch-nanomips-linux.S \
390         m_dispatch/dispatch-x86-freebsd.S \
391         m_dispatch/dispatch-amd64-freebsd.S \
392         m_dispatch/dispatch-x86-darwin.S \
393         m_dispatch/dispatch-amd64-darwin.S \
394         m_dispatch/dispatch-x86-solaris.S \
395         m_dispatch/dispatch-amd64-solaris.S \
396         m_gdbserver/inferiors.c \
397         m_gdbserver/m_gdbserver.c \
398         m_gdbserver/regcache.c \
399         m_gdbserver/remote-utils.c \
400         m_gdbserver/server.c \
401         m_gdbserver/signals.c \
402         m_gdbserver/target.c \
403         m_gdbserver/utils.c \
404         m_gdbserver/valgrind-low-x86.c \
405         m_gdbserver/valgrind-low-amd64.c \
406         m_gdbserver/valgrind-low-arm.c \
407         m_gdbserver/valgrind-low-arm64.c \
408         m_gdbserver/valgrind-low-ppc32.c \
409         m_gdbserver/valgrind-low-ppc64.c \
410         m_gdbserver/valgrind-low-s390x.c \
411         m_gdbserver/valgrind-low-mips32.c \
412         m_gdbserver/valgrind-low-mips64.c \
413         m_gdbserver/valgrind-low-nanomips.c \
414         m_gdbserver/version.c \
415         m_initimg/initimg-linux.c \
416         m_initimg/initimg-freebsd.c \
417         m_initimg/initimg-darwin.c \
418         m_initimg/initimg-solaris.c \
419         m_mach/mach_basics.c \
420         m_mach/mach_msg.c \
421         m_mach/mach_traps-x86-darwin.S \
422         m_mach/mach_traps-amd64-darwin.S \
423         m_replacemalloc/replacemalloc_core.c \
424         m_scheduler/sched-lock.c \
425         m_scheduler/sched-lock-generic.c \
426         m_scheduler/scheduler.c \
427         m_scheduler/sema.c \
428         m_sigframe/sigframe-common.c \
429         m_sigframe/sigframe-x86-linux.c \
430         m_sigframe/sigframe-amd64-linux.c \
431         m_sigframe/sigframe-x86-freebsd.c \
432         m_sigframe/sigframe-amd64-freebsd.c \
433         m_sigframe/sigframe-ppc32-linux.c \
434         m_sigframe/sigframe-ppc64-linux.c \
435         m_sigframe/sigframe-arm-linux.c \
436         m_sigframe/sigframe-arm64-linux.c \
437         m_sigframe/sigframe-s390x-linux.c \
438         m_sigframe/sigframe-mips32-linux.c \
439         m_sigframe/sigframe-mips64-linux.c \
440         m_sigframe/sigframe-nanomips-linux.c \
441         m_sigframe/sigframe-x86-darwin.c \
442         m_sigframe/sigframe-amd64-darwin.c \
443         m_sigframe/sigframe-solaris.c \
444         m_syswrap/syscall-x86-linux.S \
445         m_syswrap/syscall-amd64-linux.S \
446         m_syswrap/syscall-ppc32-linux.S \
447         m_syswrap/syscall-ppc64be-linux.S \
448         m_syswrap/syscall-ppc64le-linux.S \
449         m_syswrap/syscall-arm-linux.S \
450         m_syswrap/syscall-arm64-linux.S \
451         m_syswrap/syscall-s390x-linux.S \
452         m_syswrap/syscall-mips32-linux.S \
453         m_syswrap/syscall-mips64-linux.S \
454         m_syswrap/syscall-nanomips-linux.S \
455         m_syswrap/syscall-x86-freebsd.S \
456         m_syswrap/syscall-amd64-freebsd.S \
457         m_syswrap/syscall-x86-darwin.S \
458         m_syswrap/syscall-amd64-darwin.S \
459         m_syswrap/syscall-x86-solaris.S \
460         m_syswrap/syscall-amd64-solaris.S \
461         m_syswrap/syswrap-main.c \
462         m_syswrap/syswrap-generic.c \
463         m_syswrap/syswrap-linux.c \
464         m_syswrap/syswrap-linux-variants.c \
465         m_syswrap/syswrap-freebsd.c \
466         m_syswrap/syswrap-darwin.c \
467         m_syswrap/syswrap-solaris.c \
468         m_syswrap/syswrap-x86-linux.c \
469         m_syswrap/syswrap-amd64-linux.c \
470         m_syswrap/syswrap-ppc32-linux.c \
471         m_syswrap/syswrap-ppc64-linux.c \
472         m_syswrap/syswrap-x86-freebsd.c \
473         m_syswrap/syswrap-amd64-freebsd.c \
474         m_syswrap/syswrap-arm-linux.c \
475         m_syswrap/syswrap-arm64-linux.c \
476         m_syswrap/syswrap-s390x-linux.c \
477         m_syswrap/syswrap-mips32-linux.c \
478         m_syswrap/syswrap-mips64-linux.c \
479         m_syswrap/syswrap-nanomips-linux.c \
480         m_syswrap/syswrap-x86-darwin.c \
481         m_syswrap/syswrap-amd64-darwin.c \
482         m_syswrap/syswrap-xen.c \
483         m_syswrap/syswrap-x86-solaris.c \
484         m_syswrap/syswrap-amd64-solaris.c \
485         m_ume/elf.c \
486         m_ume/macho.c \
487         m_ume/main.c \
488         m_ume/script.c
490 # The below files cannot be compiled with lto, otherwise that gives
491 # undefined symbols at link time. So, define a noinst library to
492 # build the needed .o with specific flags.
493 # These objects are added to the libcoregrind library.
494 NOLTO_COREGRIND_SOURCES_COMMON = \
495         m_libcsetjmp.c \
496         m_main.c
497 noinst_LIBRARIES = libnolto_coregrind-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a
498 libnolto_coregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
499     $(NOLTO_COREGRIND_SOURCES_COMMON)
500 libnolto_coregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CPPFLAGS = \
501     $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
502 libnolto_coregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CFLAGS = \
503     $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
504 libnolto_coregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CCASFLAGS = \
505     $(AM_CCASFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
507 if VGCONF_HAVE_PLATFORM_SEC
508 noinst_LIBRARIES += libnolto_coregrind-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a
509 libnolto_coregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES = \
510     $(NOLTO_COREGRIND_SOURCES_COMMON)
511 libnolto_coregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CPPFLAGS = \
512     $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
513 libnolto_coregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CFLAGS = \
514     $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
515 libnolto_coregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CCASFLAGS = \
516     $(AM_CCASFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
517 endif
520 libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
521     $(COREGRIND_SOURCES_COMMON)
522 nodist_libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
523     $(BUILT_SOURCES)
524 libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CPPFLAGS = \
525     $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
526 libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CFLAGS = $(LTO_CFLAGS) \
527     $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
528 libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CCASFLAGS = \
529     $(AM_CCASFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
530 if ENABLE_LINUX_TICKET_LOCK_PRIMARY
531 libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES += \
532     m_scheduler/ticket-lock-linux.c
533 libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CFLAGS += \
534     -DENABLE_LINUX_TICKET_LOCK
535 endif
536 libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_LIBADD = \
537     $(libnolto_coregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_OBJECTS)
538 libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_DEPENDENCIES = \
539     libnolto_coregrind-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a
541 if VGCONF_HAVE_PLATFORM_SEC
542 libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES = \
543     $(COREGRIND_SOURCES_COMMON)
544 nodist_libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES = \
545     $(BUILT_SOURCES)
546 libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CPPFLAGS = \
547     $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
548 libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CFLAGS =  $(LTO_CFLAGS) \
549     $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
550 libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CCASFLAGS = \
551     $(AM_CCASFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
552 if ENABLE_LINUX_TICKET_LOCK_SECONDARY
553 libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES += \
554     m_scheduler/ticket-lock-linux.c
555 libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CFLAGS += \
556     -DENABLE_LINUX_TICKET_LOCK
557 endif
558 libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_LIBADD = \
559     $(libnolto_coregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_OBJECTS)
560 libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_DEPENDENCIES = \
561     libnolto_coregrind-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a
562 endif
564 #----------------------------------------------------------------------------
565 # libgcc-sup-<platform>.a
566 # Special supplemental library for functions normally supplied by glibc
567 # used by libgcc.
568 #----------------------------------------------------------------------------
570 pkglib_LIBRARIES  += libgcc-sup-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a
571 if VGCONF_HAVE_PLATFORM_SEC
572 pkglib_LIBRARIES += libgcc-sup-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a
573 endif
575 libgcc_sup_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
576         m_libgcc_sup.c
577 libgcc_sup_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CPPFLAGS = \
578         $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
579 libgcc_sup_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CFLAGS = \
580         $(AM_CFLAGS_PSO_@VGCONF_PLATFORM_PRI_CAPS@)
581 if VGCONF_HAVE_PLATFORM_SEC
582 libgcc_sup_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES = \
583         m_libgcc_sup.c
584 libgcc_sup_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CPPFLAGS = \
585         $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
586 libgcc_sup_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CFLAGS = \
587         $(AM_CFLAGS_PSO_@VGCONF_PLATFORM_SEC_CAPS@)
588 endif
590 #----------------------------------------------------------------------------
591 # libreplacemalloc_toolpreload-<platform>.a
592 #----------------------------------------------------------------------------
594 pkglib_LIBRARIES += libreplacemalloc_toolpreload-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a
595 if VGCONF_HAVE_PLATFORM_SEC
596 pkglib_LIBRARIES += libreplacemalloc_toolpreload-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a
597 endif
599 libreplacemalloc_toolpreload_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
600         m_replacemalloc/vg_replace_malloc.c
601 libreplacemalloc_toolpreload_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CPPFLAGS = \
602         $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
603 libreplacemalloc_toolpreload_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CFLAGS = \
604         $(AM_CFLAGS_PSO_@VGCONF_PLATFORM_PRI_CAPS@)
605 if VGCONF_HAVE_PLATFORM_SEC
606 libreplacemalloc_toolpreload_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES = \
607         m_replacemalloc/vg_replace_malloc.c
608 libreplacemalloc_toolpreload_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CPPFLAGS = \
609         $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
610 libreplacemalloc_toolpreload_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CFLAGS = \
611         $(AM_CFLAGS_PSO_@VGCONF_PLATFORM_SEC_CAPS@)
612 endif
614 #----------------------------------------------------------------------------
615 # vgpreload_core-<platform>.a
616 #----------------------------------------------------------------------------
618 noinst_PROGRAMS  = vgpreload_core-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so
619 if VGCONF_HAVE_PLATFORM_SEC
620 noinst_PROGRAMS += vgpreload_core-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so
621 endif
623 if VGCONF_OS_IS_DARWIN
624 noinst_DSYMS = $(noinst_PROGRAMS)
625 endif
627 vgpreload_core_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_SOURCES = vg_preloaded.c
628 vgpreload_core_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CPPFLAGS = \
629         $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
630 vgpreload_core_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CFLAGS = \
631         $(AM_CFLAGS_PSO_@VGCONF_PLATFORM_PRI_CAPS@)
632 vgpreload_core_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_LDFLAGS = \
633         $(PRELOAD_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
634 if VGCONF_HAVE_PLATFORM_SEC
635 vgpreload_core_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_SOURCES = vg_preloaded.c
636 vgpreload_core_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CPPFLAGS = \
637         $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
638 vgpreload_core_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CFLAGS = \
639         $(AM_CFLAGS_PSO_@VGCONF_PLATFORM_SEC_CAPS@)
640 vgpreload_core_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_LDFLAGS = \
641         $(PRELOAD_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
642 endif
644 if VGCONF_OS_IS_SOLARIS
645 # Give the vgpreload_core library a proper soname so it can be easily
646 # recognized during reading of debug information.
647 vgpreload_core_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_LDFLAGS += \
648         -Wl,-soname -Wl,vgpreload_core.so.0
649 if VGCONF_HAVE_PLATFORM_SEC
650 vgpreload_core_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_LDFLAGS += \
651         -Wl,-soname -Wl,vgpreload_core.so.0
652 endif
653 endif
655 #----------------------------------------------------------------------------
656 # gdbserver xml target descriptions
657 #----------------------------------------------------------------------------
659 GDBSERVER_XML_FILES = \
660         m_gdbserver/32bit-core-valgrind-s1.xml \
661         m_gdbserver/32bit-core-valgrind-s2.xml \
662         m_gdbserver/32bit-core.xml \
663         m_gdbserver/32bit-linux-valgrind-s1.xml \
664         m_gdbserver/32bit-linux-valgrind-s2.xml \
665         m_gdbserver/32bit-linux.xml \
666         m_gdbserver/32bit-sse-valgrind-s1.xml \
667         m_gdbserver/32bit-sse-valgrind-s2.xml \
668         m_gdbserver/32bit-sse.xml \
669         m_gdbserver/64bit-avx-valgrind-s2.xml \
670         m_gdbserver/64bit-avx-valgrind-s1.xml \
671         m_gdbserver/64bit-avx.xml \
672         m_gdbserver/64bit-core-valgrind-s1.xml \
673         m_gdbserver/64bit-core-valgrind-s2.xml \
674         m_gdbserver/64bit-core.xml \
675         m_gdbserver/64bit-linux-valgrind-s1.xml \
676         m_gdbserver/64bit-linux-valgrind-s2.xml \
677         m_gdbserver/64bit-linux.xml \
678         m_gdbserver/64bit-sse-valgrind-s1.xml \
679         m_gdbserver/64bit-sse-valgrind-s2.xml \
680         m_gdbserver/64bit-sse.xml \
681         m_gdbserver/amd64-avx-coresse-valgrind.xml \
682         m_gdbserver/amd64-avx-coresse.xml \
683         m_gdbserver/amd64-avx-linux-valgrind.xml \
684         m_gdbserver/amd64-avx-linux.xml \
685         m_gdbserver/amd64-coresse-valgrind.xml \
686         m_gdbserver/amd64-linux-valgrind.xml \
687         m_gdbserver/arm-core-valgrind-s1.xml \
688         m_gdbserver/arm-core-valgrind-s2.xml \
689         m_gdbserver/arm-core.xml \
690         m_gdbserver/arm-vfpv3-valgrind-s1.xml \
691         m_gdbserver/arm-vfpv3-valgrind-s2.xml \
692         m_gdbserver/arm-vfpv3.xml \
693         m_gdbserver/arm-with-vfpv3-valgrind.xml \
694         m_gdbserver/arm-with-vfpv3.xml \
695         m_gdbserver/i386-coresse-valgrind.xml \
696         m_gdbserver/i386-linux-valgrind.xml \
697         m_gdbserver/power64-core-valgrind-s1.xml \
698         m_gdbserver/power64-core-valgrind-s2.xml \
699         m_gdbserver/power64-core.xml \
700         m_gdbserver/power64-core2-valgrind-s1.xml \
701         m_gdbserver/power64-core2-valgrind-s2.xml \
702         m_gdbserver/power64-linux-valgrind-s1.xml \
703         m_gdbserver/power64-linux-valgrind-s2.xml \
704         m_gdbserver/power64-linux.xml \
705         m_gdbserver/power-altivec-valgrind-s1.xml \
706         m_gdbserver/power-altivec-valgrind-s2.xml \
707         m_gdbserver/power-altivec.xml \
708         m_gdbserver/power-vsx-valgrind-s1.xml \
709         m_gdbserver/power-vsx-valgrind-s2.xml \
710         m_gdbserver/power-vsx.xml \
711         m_gdbserver/power-core-valgrind-s1.xml \
712         m_gdbserver/power-core-valgrind-s2.xml \
713         m_gdbserver/power-core.xml \
714         m_gdbserver/power-fpu-valgrind-s1.xml \
715         m_gdbserver/power-fpu-valgrind-s2.xml \
716         m_gdbserver/power-fpu.xml \
717         m_gdbserver/power-linux-valgrind-s1.xml \
718         m_gdbserver/power-linux-valgrind-s2.xml \
719         m_gdbserver/power-linux.xml \
720         m_gdbserver/powerpc-altivec32l-valgrind.xml \
721         m_gdbserver/powerpc-altivec32l.xml \
722         m_gdbserver/powerpc-altivec64l-valgrind.xml \
723         m_gdbserver/powerpc-altivec64l.xml \
724         m_gdbserver/s390-acr-valgrind-s1.xml \
725         m_gdbserver/s390-acr-valgrind-s2.xml \
726         m_gdbserver/s390-acr.xml \
727         m_gdbserver/s390-fpr-valgrind-s1.xml \
728         m_gdbserver/s390-fpr-valgrind-s2.xml \
729         m_gdbserver/s390-fpr.xml \
730         m_gdbserver/s390x-core64-valgrind-s1.xml \
731         m_gdbserver/s390x-core64-valgrind-s2.xml \
732         m_gdbserver/s390x-core64.xml \
733         m_gdbserver/s390x-generic-valgrind.xml \
734         m_gdbserver/s390x-generic.xml \
735         m_gdbserver/s390x-linux64-valgrind-s1.xml \
736         m_gdbserver/s390x-linux64-valgrind-s2.xml \
737         m_gdbserver/s390x-linux64.xml \
738         m_gdbserver/s390-vx-valgrind-s1.xml \
739         m_gdbserver/s390-vx-valgrind-s2.xml \
740         m_gdbserver/s390-vx.xml \
741         m_gdbserver/s390x-vx-linux-valgrind.xml \
742         m_gdbserver/s390x-vx-linux.xml \
743         m_gdbserver/mips-cp0-valgrind-s1.xml \
744         m_gdbserver/mips-cp0-valgrind-s2.xml \
745         m_gdbserver/mips-cp0.xml \
746         m_gdbserver/mips-cpu-valgrind-s1.xml \
747         m_gdbserver/mips-cpu-valgrind-s2.xml \
748         m_gdbserver/mips-cpu.xml \
749         m_gdbserver/mips-linux.xml \
750         m_gdbserver/mips-linux-valgrind.xml \
751         m_gdbserver/mips-fpu-valgrind-s1.xml \
752         m_gdbserver/mips-fpu-valgrind-s2.xml \
753         m_gdbserver/mips-fpu.xml \
754         m_gdbserver/mips64-cp0-valgrind-s1.xml \
755         m_gdbserver/mips64-cp0-valgrind-s2.xml \
756         m_gdbserver/mips64-cp0.xml \
757         m_gdbserver/mips64-cpu-valgrind-s1.xml \
758         m_gdbserver/mips64-cpu-valgrind-s2.xml \
759         m_gdbserver/mips64-cpu.xml \
760         m_gdbserver/mips64-linux.xml \
761         m_gdbserver/mips64-linux-valgrind.xml \
762         m_gdbserver/mips64-fpu-valgrind-s1.xml \
763         m_gdbserver/mips64-fpu-valgrind-s2.xml \
764         m_gdbserver/mips64-fpu.xml
766 # so as to make sure these get copied into the install tree
767 vglibdir = $(pkglibexecdir)
768 vglib_DATA  = $(GDBSERVER_XML_FILES)
769 vglib_DATA  += m_gdbserver/valgrind-monitor.py
770 vglib_DATA  += m_gdbserver/valgrind-monitor-def.py
772 # so as to make sure these get copied into the tarball
773 EXTRA_DIST  += $(GDBSERVER_XML_FILES)
774 EXTRA_DIST  += m_gdbserver/valgrind-monitor.py
775 EXTRA_DIST  += m_gdbserver/valgrind-monitor-def.py
777 #----------------------------------------------------------------------------
778 # General stuff
779 #----------------------------------------------------------------------------
781 all-local: inplace-noinst_PROGRAMS inplace-noinst_DSYMS
782         mkdir -p $(inplacedir); \
783         for f in $(vglib_DATA); do \
784           rm -f $(inplacedir)/$$f; \
785           ln -f -s ../$(subdir)/$$f $(inplacedir); \
786         done
788 clean-local: clean-noinst_DSYMS
790 install-exec-local: install-noinst_PROGRAMS install-noinst_DSYMS
792 uninstall-local: uninstall-noinst_PROGRAMS uninstall-noinst_DSYMS
794 #----------------------------------------------------------------------------
795 # Darwin linker kludges
796 #----------------------------------------------------------------------------
798 if VGCONF_OS_IS_DARWIN
800 BUILT_SOURCES += fixup_macho_loadcmds
801 fixup_macho_loadcmds: fixup_macho_loadcmds.c
802         $(CC) -I$(top_srcdir) -I$(top_builddir) -g -Wall -o $@ $<
804 CLEANFILES += fixup_macho_loadcmds
806 endif
808 EXTRA_DIST += fixup_macho_loadcmds.c