nethercote | 4388a40 | 2004-09-01 23:20:49 +0000 | [diff] [blame] | 1 | include $(top_srcdir)/Makefile.all.am |
| 2 | include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 3 | |
njn | 2521d32 | 2005-05-08 14:45:13 +0000 | [diff] [blame] | 4 | MODULES = \ |
njn | 2521d32 | 2005-05-08 14:45:13 +0000 | [diff] [blame] | 5 | m_aspacemgr \ |
njn | 36b66df | 2005-05-12 05:13:04 +0000 | [diff] [blame] | 6 | m_demangle \ |
| 7 | m_dispatch \ |
njn | 717cde5 | 2005-05-10 02:47:21 +0000 | [diff] [blame] | 8 | m_replacemalloc \ |
njn | 2521d32 | 2005-05-08 14:45:13 +0000 | [diff] [blame] | 9 | m_sigframe \ |
| 10 | m_syscalls |
| 11 | |
njn | a5f1bcd | 2004-11-27 16:47:42 +0000 | [diff] [blame] | 12 | ## When building, we are only interested in the current arch/OS/platform. |
| 13 | ## But when doing 'make dist', we are interested in every arch/OS/platform. |
| 14 | ## That's what DIST_SUBDIRS specifies. |
sewardj | 985fabb | 2005-04-24 14:18:14 +0000 | [diff] [blame] | 15 | SUBDIRS = \ |
njn | 2521d32 | 2005-05-08 14:45:13 +0000 | [diff] [blame] | 16 | $(VG_ARCH) $(VG_OS) $(VG_PLATFORM) \ |
| 17 | $(MODULES) . |
sewardj | 985fabb | 2005-04-24 14:18:14 +0000 | [diff] [blame] | 18 | |
| 19 | DIST_SUBDIRS = \ |
| 20 | $(VG_ARCH_ALL) $(VG_OS_ALL) $(VG_PLATFORM_ALL) \ |
njn | 2521d32 | 2005-05-08 14:45:13 +0000 | [diff] [blame] | 21 | $(MODULES) . |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 22 | |
njn | 44e1368 | 2005-05-10 04:56:56 +0000 | [diff] [blame] | 23 | AM_CPPFLAGS += -DVG_LIBDIR="\"$(valdir)"\" \ |
sewardj | bc7df20 | 2005-05-02 10:25:34 +0000 | [diff] [blame] | 24 | -DKICKSTART_BASE=@KICKSTART_BASE@ |
| 25 | |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 26 | AM_CFLAGS = $(WERROR) -Wmissing-prototypes -Winline -Wall -Wshadow -O -g @ARCH_CORE_AM_CFLAGS@ |
sewardj | 2a99cf6 | 2004-11-24 10:44:19 +0000 | [diff] [blame] | 27 | AM_CFLAGS += -fno-omit-frame-pointer |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 28 | |
| 29 | default.supp: $(SUPP_FILES) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 30 | |
fitzhardinge | 98abfc7 | 2003-12-16 02:05:15 +0000 | [diff] [blame] | 31 | bin_PROGRAMS = \ |
| 32 | valgrind |
| 33 | |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 34 | val_PROGRAMS = \ |
nethercote | 5f2ad77 | 2004-09-01 11:33:35 +0000 | [diff] [blame] | 35 | stage2 \ |
fitzhardinge | 98abfc7 | 2003-12-16 02:05:15 +0000 | [diff] [blame] | 36 | vg_inject.so |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 37 | |
nethercote | 799fb80 | 2004-10-20 18:40:40 +0000 | [diff] [blame] | 38 | noinst_HEADERS = \ |
| 39 | core.h \ |
| 40 | core_asm.h \ |
njn | 2521d32 | 2005-05-08 14:45:13 +0000 | [diff] [blame] | 41 | pub_core_aspacemgr.h \ |
| 42 | pub_core_debuglog.h \ |
njn | 44e1368 | 2005-05-10 04:56:56 +0000 | [diff] [blame] | 43 | pub_core_demangle.h \ |
njn | 36b66df | 2005-05-12 05:13:04 +0000 | [diff] [blame] | 44 | pub_core_dispatch.h \ |
njn | a733b5f | 2005-05-12 13:15:38 +0000 | [diff] [blame] | 45 | pub_core_dispatch_asm.h \ |
njn | d2b1711 | 2005-04-19 04:10:25 +0000 | [diff] [blame] | 46 | pub_core_errormgr.h \ |
njn | d01fef7 | 2005-03-25 23:35:48 +0000 | [diff] [blame] | 47 | pub_core_execontext.h \ |
njn | 717cde5 | 2005-05-10 02:47:21 +0000 | [diff] [blame] | 48 | pub_core_mallocfree.h \ |
| 49 | pub_core_replacemalloc.h\ |
sewardj | 1cf558c | 2005-04-25 01:36:56 +0000 | [diff] [blame] | 50 | pub_core_sigframe.h \ |
njn | 641d5cc | 2005-05-12 04:37:27 +0000 | [diff] [blame] | 51 | pub_core_skiplist.h \ |
njn | 2521d32 | 2005-05-08 14:45:13 +0000 | [diff] [blame] | 52 | pub_core_stacktrace.h \ |
| 53 | pub_core_syscalls.h \ |
njn | 43b9a8a | 2005-05-10 04:37:01 +0000 | [diff] [blame] | 54 | pub_core_tooliface.h \ |
njn | cf44351 | 2005-05-13 23:14:40 +0000 | [diff] [blame^] | 55 | pub_core_translate.h \ |
nethercote | 799fb80 | 2004-10-20 18:40:40 +0000 | [diff] [blame] | 56 | ume.h \ |
| 57 | vg_symtab2.h \ |
njn | 51d827b | 2005-05-09 01:02:08 +0000 | [diff] [blame] | 58 | vg_symtypes.h |
nethercote | 799fb80 | 2004-10-20 18:40:40 +0000 | [diff] [blame] | 59 | |
fitzhardinge | 98abfc7 | 2003-12-16 02:05:15 +0000 | [diff] [blame] | 60 | EXTRA_DIST = \ |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 61 | valgrind.vs \ |
njn | 51d827b | 2005-05-09 01:02:08 +0000 | [diff] [blame] | 62 | README_MODULES.txt |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 63 | |
fitzhardinge | 98abfc7 | 2003-12-16 02:05:15 +0000 | [diff] [blame] | 64 | valgrind_SOURCES = \ |
fitzhardinge | 98abfc7 | 2003-12-16 02:05:15 +0000 | [diff] [blame] | 65 | ume.c \ |
nethercote | 107e1c0 | 2004-10-13 17:55:31 +0000 | [diff] [blame] | 66 | \ |
| 67 | stage1.c \ |
sewardj | 1cf558c | 2005-04-25 01:36:56 +0000 | [diff] [blame] | 68 | m_debuglog.c \ |
nethercote | 107e1c0 | 2004-10-13 17:55:31 +0000 | [diff] [blame] | 69 | ${VG_ARCH}/jmp_with_stack.c |
fitzhardinge | 98abfc7 | 2003-12-16 02:05:15 +0000 | [diff] [blame] | 70 | valgrind_DEPENDENCIES = |
nethercote | c25c449 | 2004-10-18 11:52:17 +0000 | [diff] [blame] | 71 | valgrind_LDFLAGS=-static -g |
fitzhardinge | 98abfc7 | 2003-12-16 02:05:15 +0000 | [diff] [blame] | 72 | valgrind_LDADD= |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 73 | |
fitzhardinge | 98abfc7 | 2003-12-16 02:05:15 +0000 | [diff] [blame] | 74 | stage2_SOURCES = \ |
njn | 43b9a8a | 2005-05-10 04:37:01 +0000 | [diff] [blame] | 75 | m_debuglog.c \ |
sewardj | 267100d | 2005-04-24 12:33:12 +0000 | [diff] [blame] | 76 | m_errormgr.c \ |
| 77 | m_execontext.c \ |
njn | 717cde5 | 2005-05-10 02:47:21 +0000 | [diff] [blame] | 78 | m_mallocfree.c \ |
njn | 641d5cc | 2005-05-12 04:37:27 +0000 | [diff] [blame] | 79 | m_skiplist.c \ |
sewardj | 267100d | 2005-04-24 12:33:12 +0000 | [diff] [blame] | 80 | m_stacktrace.c \ |
njn | 43b9a8a | 2005-05-10 04:37:01 +0000 | [diff] [blame] | 81 | m_tooliface.c \ |
njn | 3cbfbc1 | 2005-05-13 23:11:40 +0000 | [diff] [blame] | 82 | m_translate.c \ |
fitzhardinge | 98abfc7 | 2003-12-16 02:05:15 +0000 | [diff] [blame] | 83 | ume.c \ |
fitzhardinge | 98abfc7 | 2003-12-16 02:05:15 +0000 | [diff] [blame] | 84 | \ |
sewardj | 2e93c50 | 2002-04-12 11:12:52 +0000 | [diff] [blame] | 85 | vg_scheduler.c \ |
njn | 3e88418 | 2003-04-15 13:03:23 +0000 | [diff] [blame] | 86 | vg_hashtable.c \ |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 87 | vg_main.c \ |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 88 | vg_messages.c \ |
| 89 | vg_mylibc.c \ |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 90 | vg_dummy_profile.c \ |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 91 | vg_signals.c \ |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 92 | vg_symtab2.c \ |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 93 | vg_threadmodel.c \ |
| 94 | vg_pthreadmodel.c \ |
| 95 | vg_redir.c \ |
njn | 7ea9adc | 2003-10-18 13:58:44 +0000 | [diff] [blame] | 96 | vg_dwarf.c \ |
| 97 | vg_stabs.c \ |
jsgf | cb1d1c0 | 2003-10-14 21:55:10 +0000 | [diff] [blame] | 98 | vg_symtypes.c \ |
nethercote | 986202f | 2004-10-19 13:48:06 +0000 | [diff] [blame] | 99 | vg_transtab.c |
nethercote | b77dee6 | 2004-11-16 17:13:24 +0000 | [diff] [blame] | 100 | |
nethercote | 8ff888f | 2004-11-17 17:11:45 +0000 | [diff] [blame] | 101 | ## libplatform.a must be before libarch.a and libos.a, it seems. |
nethercote | b77dee6 | 2004-11-16 17:13:24 +0000 | [diff] [blame] | 102 | stage2_extra= \ |
njn | 36b66df | 2005-05-12 05:13:04 +0000 | [diff] [blame] | 103 | m_dispatch/libdispatch.a \ |
njn | 44e1368 | 2005-05-10 04:56:56 +0000 | [diff] [blame] | 104 | m_demangle/libdemangle.a \ |
sewardj | 55f9d1a | 2005-04-25 11:11:44 +0000 | [diff] [blame] | 105 | m_aspacemgr/libaspacemgr.a \ |
njn | 2521d32 | 2005-05-08 14:45:13 +0000 | [diff] [blame] | 106 | m_sigframe/libsigframe.a \ |
| 107 | m_syscalls/libsyscalls.a \ |
nethercote | 8ff888f | 2004-11-17 17:11:45 +0000 | [diff] [blame] | 108 | ${VG_PLATFORM}/libplatform.a \ |
nethercote | b77dee6 | 2004-11-16 17:13:24 +0000 | [diff] [blame] | 109 | ${VG_ARCH}/libarch.a \ |
sewardj | 8b635a4 | 2004-11-22 19:01:47 +0000 | [diff] [blame] | 110 | ${VG_OS}/libos.a \ |
| 111 | @VEX_DIR@/libvex.a |
nethercote | b77dee6 | 2004-11-16 17:13:24 +0000 | [diff] [blame] | 112 | |
njn | 717cde5 | 2005-05-10 02:47:21 +0000 | [diff] [blame] | 113 | ## These ones must be linked in with the --whole-archive flag, because they |
| 114 | ## wouldn't get pulled into stage otherwise (because they contain symbols |
| 115 | ## only referred to by tool shared objects). |
| 116 | stage2_extra2 = \ |
| 117 | m_replacemalloc/libreplacemalloc_core.a |
| 118 | |
| 119 | ## Nb: older versions of automake don't seem to like having += within an |
| 120 | ## if-then-else, so we have to use these variables for the common parts. |
| 121 | st2_DEPS_common = \ |
| 122 | $(srcdir)/valgrind.vs \ |
| 123 | $(stage2_extra) \ |
| 124 | $(stage2_extra2) |
| 125 | |
| 126 | st2_LDFLAGS_common = \ |
| 127 | -Wl,--export-dynamic -g \ |
| 128 | -Wl,-version-script $(srcdir)/valgrind.vs |
| 129 | |
nethercote | f8fbaaa | 2004-10-25 17:59:43 +0000 | [diff] [blame] | 130 | if USE_PIE |
| 131 | stage2_CFLAGS = $(AM_CFLAGS) -fpie |
njn | 717cde5 | 2005-05-10 02:47:21 +0000 | [diff] [blame] | 132 | stage2_DEPENDENCIES = $(st2_DEPS_common) |
| 133 | stage2_LDFLAGS = \ |
| 134 | $(st2_LDFLAGS_common) \ |
| 135 | -Wl,--whole-archive $(stage2_extra2) -Wl,--no-whole-archive \ |
nethercote | c69863e | 2004-10-25 19:13:41 +0000 | [diff] [blame] | 136 | -pie |
nethercote | 7f39002 | 2004-10-25 17:18:24 +0000 | [diff] [blame] | 137 | else |
| 138 | stage2_CFLAGS = $(AM_CFLAGS) |
njn | 717cde5 | 2005-05-10 02:47:21 +0000 | [diff] [blame] | 139 | stage2_DEPENDENCIES = $(st2_DEPS_common) ${VG_ARCH}/stage2.lds |
| 140 | stage2_LDFLAGS = \ |
| 141 | $(st2_LDFLAGS_common) \ |
| 142 | -Wl,--whole-archive $(stage2_extra2) -Wl,--no-whole-archive \ |
nethercote | c69863e | 2004-10-25 19:13:41 +0000 | [diff] [blame] | 143 | -Wl,-defsym,kickstart_base=@KICKSTART_BASE@ -Wl,-T,${VG_ARCH}/stage2.lds |
nethercote | 7f39002 | 2004-10-25 17:18:24 +0000 | [diff] [blame] | 144 | endif |
nethercote | c69863e | 2004-10-25 19:13:41 +0000 | [diff] [blame] | 145 | |
njn | 717cde5 | 2005-05-10 02:47:21 +0000 | [diff] [blame] | 146 | stage2_LDADD= $(stage2_extra) \ |
| 147 | -ldl |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 148 | |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 149 | vg_inject_so_SOURCES = vg_intercept.c |
nethercote | 799fb80 | 2004-10-20 18:40:40 +0000 | [diff] [blame] | 150 | vg_inject_so_CFLAGS = $(AM_CFLAGS) -fpic |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 151 | vg_inject_so_LDADD = -ldl |
fitzhardinge | 98abfc7 | 2003-12-16 02:05:15 +0000 | [diff] [blame] | 152 | vg_inject_so_LDFLAGS = \ |
| 153 | -shared \ |
| 154 | -Wl,--soname,vg_inject.so \ |
| 155 | -Wl,-z,initfirst |
njn | 3e88418 | 2003-04-15 13:03:23 +0000 | [diff] [blame] | 156 | |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 157 | MANUAL_DEPS = $(noinst_HEADERS) $(include_HEADERS) |
sewardj | 71889e6 | 2002-05-10 03:03:57 +0000 | [diff] [blame] | 158 | |
daywalker | 781132b | 2003-06-01 20:05:08 +0000 | [diff] [blame] | 159 | all-local: |
fitzhardinge | 98abfc7 | 2003-12-16 02:05:15 +0000 | [diff] [blame] | 160 | mkdir -p $(inplacedir) |
| 161 | for i in $(val_PROGRAMS); do \ |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 162 | to=$(inplacedir)/$$i; \ |
fitzhardinge | 98abfc7 | 2003-12-16 02:05:15 +0000 | [diff] [blame] | 163 | rm -f $$$to; \ |
nethercote | 03b1948 | 2004-08-25 11:57:21 +0000 | [diff] [blame] | 164 | ln -sf ../$(subdir)/$$i $$to; \ |
fitzhardinge | 98abfc7 | 2003-12-16 02:05:15 +0000 | [diff] [blame] | 165 | done |
| 166 | |