Add missing zstd.h to coregrind Makefile.am noinst_HEADERS
[valgrind.git] / coregrind / Makefile.am
blob5491fc672609feb1ff289a06a2bdb52f307ff7f8
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_debuginfo/zstd.h              \
269         m_demangle/ansidecl.h   \
270         m_demangle/cp-demangle.h \
271         m_demangle/dyn-string.h \
272         m_demangle/demangle.h   \
273         m_demangle/safe-ctype.h \
274         m_demangle/vg_libciface.h \
275         m_extension/priv_extension.h \
276         m_extension/priv_types_n_macros.h \
277         m_gdbserver/regcache.h \
278         m_gdbserver/regdef.h \
279         m_gdbserver/server.h \
280         m_gdbserver/remote-utils-shared.h \
281         m_gdbserver/target.h \
282         m_gdbserver/valgrind_low.h \
283         m_gdbserver/gdb/signals.h \
284         m_scheduler/priv_sema.h \
285         m_scheduler/priv_sched-lock.h \
286         m_scheduler/priv_sched-lock-impl.h \
287         m_sigframe/priv_sigframe.h \
288         m_syswrap/priv_types_n_macros.h \
289         m_syswrap/priv_syswrap-generic.h \
290         m_syswrap/priv_syswrap-linux.h \
291         m_syswrap/priv_syswrap-linux-variants.h \
292         m_syswrap/priv_syswrap-freebsd.h \
293         m_syswrap/priv_syswrap-darwin.h \
294         m_syswrap/priv_syswrap-solaris.h \
295         m_syswrap/priv_syswrap-main.h \
296         m_syswrap/priv_syswrap-xen.h \
297         m_ume/priv_ume.h \
298         vgdb.h
300 #----------------------------------------------------------------------------
301 # libcoregrind-<platform>.a
302 #----------------------------------------------------------------------------
304 BUILT_SOURCES = $(mach_user_srcs)
305 CLEANFILES    = $(mach_user_srcs) $(mach_server_srcs) $(mach_hdrs)
307 pkglib_LIBRARIES  = libcoregrind-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a
308 if VGCONF_HAVE_PLATFORM_SEC
309 pkglib_LIBRARIES += libcoregrind-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a
310 endif
312 COREGRIND_SOURCES_COMMON = \
313         m_addrinfo.c \
314         m_cache.c \
315         m_commandline.c \
316         m_compiler.c \
317         m_clientstate.c \
318         m_cpuid.S \
319         m_deduppoolalloc.c \
320         m_debuglog.c \
321         m_errormgr.c \
322         m_execontext.c \
323         m_hashtable.c \
324         m_libcbase.c \
325         m_libcassert.c \
326         m_libcfile.c \
327         m_libcprint.c \
328         m_libcproc.c \
329         m_libcsignal.c \
330         m_machine.c \
331         m_mallocfree.c \
332         m_options.c \
333         m_oset.c \
334         m_pathscan.c \
335         m_poolalloc.c \
336         m_rangemap.c \
337         m_redir.c \
338         m_sbprofile.c \
339         m_seqmatch.c \
340         m_signals.c \
341         m_sparsewa.c \
342         m_stacktrace.c \
343         m_syscall.c \
344         m_threadstate.c \
345         m_tooliface.c \
346         m_trampoline.S \
347         m_translate.c \
348         m_transtab.c \
349         m_vki.c \
350         m_vkiscnums.c \
351         m_wordfm.c \
352         m_xarray.c \
353         m_xtree.c \
354         m_xtmemory.c \
355         m_aspacehl.c \
356         m_aspacemgr/aspacemgr-common.c \
357         m_aspacemgr/aspacemgr-linux.c \
358         m_aspacemgr/aspacemgr-segnames.c \
359         m_coredump/coredump-elf.c \
360         m_coredump/coredump-macho.c \
361         m_coredump/coredump-solaris.c \
362         m_debuginfo/misc.c \
363         m_debuginfo/d3basics.c \
364         m_debuginfo/debuginfo.c \
365         m_debuginfo/image.c \
366         m_debuginfo/minilzo-inl.c \
367         m_debuginfo/readdwarf.c \
368         m_debuginfo/readdwarf3.c \
369         m_debuginfo/readelf.c \
370         m_debuginfo/readexidx.c \
371         m_debuginfo/readmacho.c \
372         m_debuginfo/readpdb.c \
373         m_debuginfo/storage.c \
374         m_debuginfo/tinfl.c \
375         m_debuginfo/tytypes.c \
376         m_debuginfo/zstddeclib.c \
377         m_demangle/cp-demangle.c \
378         m_demangle/cplus-dem.c \
379         m_demangle/demangle.c \
380         m_demangle/dyn-string.c \
381         m_demangle/d-demangle.c \
382         m_demangle/rust-demangle.c \
383         m_demangle/safe-ctype.c \
384         m_dispatch/dispatch-x86-linux.S \
385         m_dispatch/dispatch-amd64-linux.S \
386         m_dispatch/dispatch-ppc32-linux.S \
387         m_dispatch/dispatch-ppc64be-linux.S \
388         m_dispatch/dispatch-ppc64le-linux.S \
389         m_dispatch/dispatch-arm-linux.S \
390         m_dispatch/dispatch-arm64-linux.S \
391         m_dispatch/dispatch-s390x-linux.S \
392         m_dispatch/dispatch-mips32-linux.S \
393         m_dispatch/dispatch-mips64-linux.S \
394         m_dispatch/dispatch-nanomips-linux.S \
395         m_dispatch/dispatch-x86-freebsd.S \
396         m_dispatch/dispatch-amd64-freebsd.S \
397         m_dispatch/dispatch-arm64-freebsd.S \
398         m_dispatch/dispatch-x86-darwin.S \
399         m_dispatch/dispatch-amd64-darwin.S \
400         m_dispatch/dispatch-x86-solaris.S \
401         m_dispatch/dispatch-amd64-solaris.S \
402         m_extension/extension-main.c \
403         m_extension/extension-s390x.c \
404         m_gdbserver/inferiors.c \
405         m_gdbserver/regcache.c \
406         m_gdbserver/remote-utils.c \
407         m_gdbserver/remote-utils-shared-gdbserver.c \
408         m_gdbserver/server.c \
409         m_gdbserver/signals.c \
410         m_gdbserver/target.c \
411         m_gdbserver/utils.c \
412         m_gdbserver/valgrind-low-x86.c \
413         m_gdbserver/valgrind-low-amd64.c \
414         m_gdbserver/valgrind-low-arm.c \
415         m_gdbserver/valgrind-low-arm64.c \
416         m_gdbserver/valgrind-low-ppc32.c \
417         m_gdbserver/valgrind-low-ppc64.c \
418         m_gdbserver/valgrind-low-s390x.c \
419         m_gdbserver/valgrind-low-mips32.c \
420         m_gdbserver/valgrind-low-mips64.c \
421         m_gdbserver/valgrind-low-nanomips.c \
422         m_gdbserver/version.c \
423         m_initimg/initimg-linux.c \
424         m_initimg/initimg-freebsd.c \
425         m_initimg/initimg-darwin.c \
426         m_initimg/initimg-solaris.c \
427         m_mach/mach_basics.c \
428         m_mach/mach_msg.c \
429         m_mach/mach_traps-x86-darwin.S \
430         m_mach/mach_traps-amd64-darwin.S \
431         m_replacemalloc/replacemalloc_core.c \
432         m_scheduler/sched-lock.c \
433         m_scheduler/sched-lock-generic.c \
434         m_scheduler/scheduler.c \
435         m_scheduler/sema.c \
436         m_sigframe/sigframe-common.c \
437         m_sigframe/sigframe-x86-linux.c \
438         m_sigframe/sigframe-amd64-linux.c \
439         m_sigframe/sigframe-x86-freebsd.c \
440         m_sigframe/sigframe-amd64-freebsd.c \
441         m_sigframe/sigframe-arm64-freebsd.c \
442         m_sigframe/sigframe-ppc32-linux.c \
443         m_sigframe/sigframe-ppc64-linux.c \
444         m_sigframe/sigframe-arm-linux.c \
445         m_sigframe/sigframe-arm64-linux.c \
446         m_sigframe/sigframe-s390x-linux.c \
447         m_sigframe/sigframe-mips32-linux.c \
448         m_sigframe/sigframe-mips64-linux.c \
449         m_sigframe/sigframe-nanomips-linux.c \
450         m_sigframe/sigframe-x86-darwin.c \
451         m_sigframe/sigframe-amd64-darwin.c \
452         m_sigframe/sigframe-solaris.c \
453         m_syswrap/syscall-x86-linux.S \
454         m_syswrap/syscall-amd64-linux.S \
455         m_syswrap/syscall-ppc32-linux.S \
456         m_syswrap/syscall-ppc64be-linux.S \
457         m_syswrap/syscall-ppc64le-linux.S \
458         m_syswrap/syscall-arm-linux.S \
459         m_syswrap/syscall-arm64-linux.S \
460         m_syswrap/syscall-s390x-linux.S \
461         m_syswrap/syscall-mips32-linux.S \
462         m_syswrap/syscall-mips64-linux.S \
463         m_syswrap/syscall-nanomips-linux.S \
464         m_syswrap/syscall-x86-freebsd.S \
465         m_syswrap/syscall-amd64-freebsd.S \
466         m_syswrap/syscall-arm64-freebsd.S \
467         m_syswrap/syscall-x86-darwin.S \
468         m_syswrap/syscall-amd64-darwin.S \
469         m_syswrap/syscall-x86-solaris.S \
470         m_syswrap/syscall-amd64-solaris.S \
471         m_syswrap/syswrap-main.c \
472         m_syswrap/syswrap-generic.c \
473         m_syswrap/syswrap-linux.c \
474         m_syswrap/syswrap-linux-variants.c \
475         m_syswrap/syswrap-freebsd.c \
476         m_syswrap/syswrap-darwin.c \
477         m_syswrap/syswrap-solaris.c \
478         m_syswrap/syswrap-x86-linux.c \
479         m_syswrap/syswrap-amd64-linux.c \
480         m_syswrap/syswrap-ppc32-linux.c \
481         m_syswrap/syswrap-ppc64-linux.c \
482         m_syswrap/syswrap-x86-freebsd.c \
483         m_syswrap/syswrap-amd64-freebsd.c \
484         m_syswrap/syswrap-arm64-freebsd.c \
485         m_syswrap/syswrap-arm-linux.c \
486         m_syswrap/syswrap-arm64-linux.c \
487         m_syswrap/syswrap-s390x-linux.c \
488         m_syswrap/syswrap-mips32-linux.c \
489         m_syswrap/syswrap-mips64-linux.c \
490         m_syswrap/syswrap-nanomips-linux.c \
491         m_syswrap/syswrap-x86-darwin.c \
492         m_syswrap/syswrap-amd64-darwin.c \
493         m_syswrap/syswrap-xen.c \
494         m_syswrap/syswrap-x86-solaris.c \
495         m_syswrap/syswrap-amd64-solaris.c \
496         m_ume/elf.c \
497         m_ume/macho.c \
498         m_ume/main.c \
499         m_ume/script.c
501 # The below files cannot be compiled with lto, otherwise that gives
502 # undefined symbols at link time. So, define a noinst library to
503 # build the needed .o with specific flags.
504 # These objects are added to the libcoregrind library.
505 NOLTO_COREGRIND_SOURCES_COMMON = \
506         m_libcsetjmp.c \
507         m_main.c \
508         m_stacks.c \
509         m_gdbserver/m_gdbserver.c
510 noinst_LIBRARIES = libnolto_coregrind-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a
511 libnolto_coregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
512     $(NOLTO_COREGRIND_SOURCES_COMMON)
513 libnolto_coregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CPPFLAGS = \
514     $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
515 libnolto_coregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CFLAGS = \
516     $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
517 libnolto_coregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CCASFLAGS = \
518     $(AM_CCASFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
520 if VGCONF_HAVE_PLATFORM_SEC
521 noinst_LIBRARIES += libnolto_coregrind-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a
522 libnolto_coregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES = \
523     $(NOLTO_COREGRIND_SOURCES_COMMON)
524 libnolto_coregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CPPFLAGS = \
525     $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
526 libnolto_coregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CFLAGS = \
527     $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
528 libnolto_coregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CCASFLAGS = \
529     $(AM_CCASFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
530 endif
533 libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
534     $(COREGRIND_SOURCES_COMMON)
535 nodist_libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
536     $(BUILT_SOURCES)
537 libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CPPFLAGS = \
538     $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
539 libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CFLAGS = $(LTO_CFLAGS) \
540     $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
541 libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CCASFLAGS = \
542     $(AM_CCASFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
543 if ENABLE_LINUX_TICKET_LOCK_PRIMARY
544 libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES += \
545     m_scheduler/ticket-lock-linux.c
546 libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CFLAGS += \
547     -DENABLE_LINUX_TICKET_LOCK
548 endif
549 libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_LIBADD = \
550     $(libnolto_coregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_OBJECTS)
551 libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_DEPENDENCIES = \
552     libnolto_coregrind-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a
554 if VGCONF_HAVE_PLATFORM_SEC
555 libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES = \
556     $(COREGRIND_SOURCES_COMMON)
557 nodist_libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES = \
558     $(BUILT_SOURCES)
559 libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CPPFLAGS = \
560     $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
561 libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CFLAGS =  $(LTO_CFLAGS) \
562     $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
563 libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CCASFLAGS = \
564     $(AM_CCASFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
565 if ENABLE_LINUX_TICKET_LOCK_SECONDARY
566 libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES += \
567     m_scheduler/ticket-lock-linux.c
568 libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CFLAGS += \
569     -DENABLE_LINUX_TICKET_LOCK
570 endif
571 libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_LIBADD = \
572     $(libnolto_coregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_OBJECTS)
573 libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_DEPENDENCIES = \
574     libnolto_coregrind-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a
575 endif
577 #----------------------------------------------------------------------------
578 # libgcc-sup-<platform>.a
579 # Special supplemental library for functions normally supplied by glibc
580 # used by libgcc.
581 #----------------------------------------------------------------------------
583 pkglib_LIBRARIES  += libgcc-sup-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a
584 if VGCONF_HAVE_PLATFORM_SEC
585 pkglib_LIBRARIES += libgcc-sup-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a
586 endif
588 libgcc_sup_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
589         m_libgcc_sup.c
590 libgcc_sup_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CPPFLAGS = \
591         $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
592 libgcc_sup_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CFLAGS = \
593         $(AM_CFLAGS_PSO_@VGCONF_PLATFORM_PRI_CAPS@)
594 if VGCONF_HAVE_PLATFORM_SEC
595 libgcc_sup_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES = \
596         m_libgcc_sup.c
597 libgcc_sup_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CPPFLAGS = \
598         $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
599 libgcc_sup_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CFLAGS = \
600         $(AM_CFLAGS_PSO_@VGCONF_PLATFORM_SEC_CAPS@)
601 endif
603 #----------------------------------------------------------------------------
604 # libreplacemalloc_toolpreload-<platform>.a
605 #----------------------------------------------------------------------------
607 pkglib_LIBRARIES += libreplacemalloc_toolpreload-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a
608 if VGCONF_HAVE_PLATFORM_SEC
609 pkglib_LIBRARIES += libreplacemalloc_toolpreload-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a
610 endif
612 libreplacemalloc_toolpreload_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
613         m_replacemalloc/vg_replace_malloc.c
614 libreplacemalloc_toolpreload_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CPPFLAGS = \
615         $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
616 libreplacemalloc_toolpreload_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CFLAGS = \
617         $(AM_CFLAGS_PSO_@VGCONF_PLATFORM_PRI_CAPS@)
618 if VGCONF_HAVE_PLATFORM_SEC
619 libreplacemalloc_toolpreload_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES = \
620         m_replacemalloc/vg_replace_malloc.c
621 libreplacemalloc_toolpreload_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CPPFLAGS = \
622         $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
623 libreplacemalloc_toolpreload_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CFLAGS = \
624         $(AM_CFLAGS_PSO_@VGCONF_PLATFORM_SEC_CAPS@)
625 endif
627 #----------------------------------------------------------------------------
628 # vgpreload_core-<platform>.a
629 #----------------------------------------------------------------------------
631 noinst_PROGRAMS  = vgpreload_core-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so
632 if VGCONF_HAVE_PLATFORM_SEC
633 noinst_PROGRAMS += vgpreload_core-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so
634 endif
636 if VGCONF_OS_IS_DARWIN
637 noinst_DSYMS = $(noinst_PROGRAMS)
638 endif
640 if GDBSCRIPTS
641   GDB_SCRIPTS_DIR=-DVG_GDBSCRIPTS_DIR="\"@VG_GDBSCRIPTS_DIR@\""
642 else
643   GDB_SCRIPTS_DIR=
644 endif
646 vgpreload_core_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_SOURCES = vg_preloaded.c
647 vgpreload_core_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CPPFLAGS = \
648         $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) $(GDB_SCRIPTS_DIR)
649 vgpreload_core_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CFLAGS = \
650         $(AM_CFLAGS_PSO_@VGCONF_PLATFORM_PRI_CAPS@)
651 vgpreload_core_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_LDFLAGS = \
652         $(PRELOAD_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
653 if VGCONF_HAVE_PLATFORM_SEC
654 vgpreload_core_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_SOURCES = vg_preloaded.c
655 vgpreload_core_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CPPFLAGS = \
656         $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) $(GDBSCRIPTS_DIR)
657 vgpreload_core_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CFLAGS = \
658         $(AM_CFLAGS_PSO_@VGCONF_PLATFORM_SEC_CAPS@)
659 vgpreload_core_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_LDFLAGS = \
660         $(PRELOAD_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
661 endif
663 if VGCONF_OS_IS_SOLARIS
664 # Give the vgpreload_core library a proper soname so it can be easily
665 # recognized during reading of debug information.
666 vgpreload_core_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_LDFLAGS += \
667         -Wl,-soname -Wl,vgpreload_core.so.0
668 if VGCONF_HAVE_PLATFORM_SEC
669 vgpreload_core_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_LDFLAGS += \
670         -Wl,-soname -Wl,vgpreload_core.so.0
671 endif
672 endif
674 #----------------------------------------------------------------------------
675 # gdbserver xml target descriptions
676 #----------------------------------------------------------------------------
678 GDBSERVER_XML_FILES = \
679         m_gdbserver/32bit-core-valgrind-s1.xml \
680         m_gdbserver/32bit-core-valgrind-s2.xml \
681         m_gdbserver/32bit-core.xml \
682         m_gdbserver/32bit-linux-valgrind-s1.xml \
683         m_gdbserver/32bit-linux-valgrind-s2.xml \
684         m_gdbserver/32bit-linux.xml \
685         m_gdbserver/32bit-sse-valgrind-s1.xml \
686         m_gdbserver/32bit-sse-valgrind-s2.xml \
687         m_gdbserver/32bit-sse.xml \
688         m_gdbserver/64bit-avx-valgrind-s2.xml \
689         m_gdbserver/64bit-avx-valgrind-s1.xml \
690         m_gdbserver/64bit-avx.xml \
691         m_gdbserver/64bit-core-valgrind-s1.xml \
692         m_gdbserver/64bit-core-valgrind-s2.xml \
693         m_gdbserver/64bit-core.xml \
694         m_gdbserver/64bit-linux-valgrind-s1.xml \
695         m_gdbserver/64bit-linux-valgrind-s2.xml \
696         m_gdbserver/64bit-linux.xml \
697         m_gdbserver/64bit-sse-valgrind-s1.xml \
698         m_gdbserver/64bit-sse-valgrind-s2.xml \
699         m_gdbserver/64bit-sse.xml \
700         m_gdbserver/amd64-avx-coresse-valgrind.xml \
701         m_gdbserver/amd64-avx-coresse.xml \
702         m_gdbserver/amd64-avx-linux-valgrind.xml \
703         m_gdbserver/amd64-avx-linux.xml \
704         m_gdbserver/amd64-coresse-valgrind.xml \
705         m_gdbserver/amd64-linux-valgrind.xml \
706         m_gdbserver/arm-core-valgrind-s1.xml \
707         m_gdbserver/arm-core-valgrind-s2.xml \
708         m_gdbserver/arm-core.xml \
709         m_gdbserver/arm-vfpv3-valgrind-s1.xml \
710         m_gdbserver/arm-vfpv3-valgrind-s2.xml \
711         m_gdbserver/arm-vfpv3.xml \
712         m_gdbserver/arm-with-vfpv3-valgrind.xml \
713         m_gdbserver/arm-with-vfpv3.xml \
714         m_gdbserver/i386-coresse-valgrind.xml \
715         m_gdbserver/i386-linux-valgrind.xml \
716         m_gdbserver/power64-core-valgrind-s1.xml \
717         m_gdbserver/power64-core-valgrind-s2.xml \
718         m_gdbserver/power64-core.xml \
719         m_gdbserver/power64-core2-valgrind-s1.xml \
720         m_gdbserver/power64-core2-valgrind-s2.xml \
721         m_gdbserver/power64-linux-valgrind-s1.xml \
722         m_gdbserver/power64-linux-valgrind-s2.xml \
723         m_gdbserver/power64-linux.xml \
724         m_gdbserver/power-altivec-valgrind-s1.xml \
725         m_gdbserver/power-altivec-valgrind-s2.xml \
726         m_gdbserver/power-altivec.xml \
727         m_gdbserver/power-vsx-valgrind-s1.xml \
728         m_gdbserver/power-vsx-valgrind-s2.xml \
729         m_gdbserver/power-vsx.xml \
730         m_gdbserver/power-core-valgrind-s1.xml \
731         m_gdbserver/power-core-valgrind-s2.xml \
732         m_gdbserver/power-core.xml \
733         m_gdbserver/power-fpu-valgrind-s1.xml \
734         m_gdbserver/power-fpu-valgrind-s2.xml \
735         m_gdbserver/power-fpu.xml \
736         m_gdbserver/power-linux-valgrind-s1.xml \
737         m_gdbserver/power-linux-valgrind-s2.xml \
738         m_gdbserver/power-linux.xml \
739         m_gdbserver/powerpc-altivec32l-valgrind.xml \
740         m_gdbserver/powerpc-altivec32l.xml \
741         m_gdbserver/powerpc-altivec64l-valgrind.xml \
742         m_gdbserver/powerpc-altivec64l.xml \
743         m_gdbserver/s390-acr-valgrind-s1.xml \
744         m_gdbserver/s390-acr-valgrind-s2.xml \
745         m_gdbserver/s390-acr.xml \
746         m_gdbserver/s390-fpr-valgrind-s1.xml \
747         m_gdbserver/s390-fpr-valgrind-s2.xml \
748         m_gdbserver/s390-fpr.xml \
749         m_gdbserver/s390x-core64-valgrind-s1.xml \
750         m_gdbserver/s390x-core64-valgrind-s2.xml \
751         m_gdbserver/s390x-core64.xml \
752         m_gdbserver/s390x-generic-valgrind.xml \
753         m_gdbserver/s390x-generic.xml \
754         m_gdbserver/s390x-linux64-valgrind-s1.xml \
755         m_gdbserver/s390x-linux64-valgrind-s2.xml \
756         m_gdbserver/s390x-linux64.xml \
757         m_gdbserver/s390-vx-valgrind-s1.xml \
758         m_gdbserver/s390-vx-valgrind-s2.xml \
759         m_gdbserver/s390-vx.xml \
760         m_gdbserver/s390x-vx-linux-valgrind.xml \
761         m_gdbserver/s390x-vx-linux.xml \
762         m_gdbserver/mips-cp0-valgrind-s1.xml \
763         m_gdbserver/mips-cp0-valgrind-s2.xml \
764         m_gdbserver/mips-cp0.xml \
765         m_gdbserver/mips-cpu-valgrind-s1.xml \
766         m_gdbserver/mips-cpu-valgrind-s2.xml \
767         m_gdbserver/mips-cpu.xml \
768         m_gdbserver/mips-linux.xml \
769         m_gdbserver/mips-linux-valgrind.xml \
770         m_gdbserver/mips-fpu-valgrind-s1.xml \
771         m_gdbserver/mips-fpu-valgrind-s2.xml \
772         m_gdbserver/mips-fpu.xml \
773         m_gdbserver/mips64-cp0-valgrind-s1.xml \
774         m_gdbserver/mips64-cp0-valgrind-s2.xml \
775         m_gdbserver/mips64-cp0.xml \
776         m_gdbserver/mips64-cpu-valgrind-s1.xml \
777         m_gdbserver/mips64-cpu-valgrind-s2.xml \
778         m_gdbserver/mips64-cpu.xml \
779         m_gdbserver/mips64-linux.xml \
780         m_gdbserver/mips64-linux-valgrind.xml \
781         m_gdbserver/mips64-fpu-valgrind-s1.xml \
782         m_gdbserver/mips64-fpu-valgrind-s2.xml \
783         m_gdbserver/mips64-fpu.xml
785 # so as to make sure these get copied into the install tree
786 vglibdir = $(pkglibexecdir)
787 vglib_DATA  = $(GDBSERVER_XML_FILES)
789 if GDBSCRIPTS
790 gdbscriptsdir = @VG_GDBSCRIPTS_DIR@
791 gdbscripts_DATA  = m_gdbserver/valgrind-monitor.py
792 gdbscripts_DATA += m_gdbserver/valgrind-monitor-def.py
793 endif
795 # so as to make sure these get copied into the tarball
796 EXTRA_DIST  += $(GDBSERVER_XML_FILES)
797 EXTRA_DIST  += m_gdbserver/valgrind-monitor.py
798 EXTRA_DIST  += m_gdbserver/valgrind-monitor-def.py
800 #----------------------------------------------------------------------------
801 # General stuff
802 #----------------------------------------------------------------------------
804 all-local: inplace-noinst_PROGRAMS inplace-noinst_DSYMS
805         mkdir -p $(inplacedir); \
806         for f in $(vglib_DATA); do \
807           rm -f $(inplacedir)/$$f; \
808           ln -f -s ../$(subdir)/$$f $(inplacedir); \
809         done
811 clean-local: clean-noinst_DSYMS
813 install-exec-local: install-noinst_PROGRAMS install-noinst_DSYMS
815 uninstall-local: uninstall-noinst_PROGRAMS uninstall-noinst_DSYMS
817 #----------------------------------------------------------------------------
818 # Darwin linker kludges
819 #----------------------------------------------------------------------------
821 if VGCONF_OS_IS_DARWIN
823 BUILT_SOURCES += fixup_macho_loadcmds
824 fixup_macho_loadcmds: fixup_macho_loadcmds.c
825         $(CC) -I$(top_srcdir) -I$(top_builddir) -g -Wall -o $@ $<
827 CLEANFILES += fixup_macho_loadcmds
829 endif
831 EXTRA_DIST += fixup_macho_loadcmds.c