From: Tom Hughes Date: Tue, 29 Jun 2004 09:45:37 +0000 (+0000) Subject: Make VPATH builds work so that valgrind can be built in a different X-Git-Tag: svn/VALGRIND_2_1_2~57 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a2a0946b8a6517592ae03282054c61db0373e2fa;p=thirdparty%2Fvalgrind.git Make VPATH builds work so that valgrind can be built in a different directory from the source tree. This resolves bug 83040. Based on patch from Ralf Wildenhues . git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2450 --- diff --git a/Makefile.am b/Makefile.am index 271e1b8857..02e2c8566a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -53,7 +53,8 @@ install-exec-hook: all-local: mkdir -p $(top_builddir)/.in_place rm -f $(addprefix $(top_builddir)/.in_place/,default.supp $(SUPP_FILES)) - ln -s $(addprefix $(top_srcdir)/../,default.supp $(SUPP_FILES)) $(top_builddir)/.in_place + ln -s ../default.supp $(top_builddir)/.in_place + ln -s $(addprefix ../$(top_srcdir)/,$(SUPP_FILES)) $(top_builddir)/.in_place distclean-local: rm -rf $(top_builddir)/.in_place diff --git a/addrcheck/Makefile.am b/addrcheck/Makefile.am index 3c86d5bac0..f4f97c2670 100644 --- a/addrcheck/Makefile.am +++ b/addrcheck/Makefile.am @@ -2,8 +2,8 @@ SUBDIRS = . docs tests # include memcheck/ for mac_shared.h -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/memcheck \ - -DVG_LIBDIR="\"$(libdir)"\" +AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include \ + -I$(top_srcdir)/memcheck -DVG_LIBDIR="\"$(libdir)"\" AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -O -fomit-frame-pointer \ @PREFERRED_STACK_BOUNDARY@ -g diff --git a/auxprogs/Makefile.am b/auxprogs/Makefile.am index 62e0ff71c9..d9d0b2dc05 100644 --- a/auxprogs/Makefile.am +++ b/auxprogs/Makefile.am @@ -1,7 +1,8 @@ SUBDIRS = . -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/coregrind \ +AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include \ + -I$(top_builddir)/coregrind -I$(top_srcdir)/coregrind \ -DVG_LIBDIR="\"$(libdir)"\" AM_CFLAGS = $(WERROR) -Winline -Wall -O -g diff --git a/cachegrind/Makefile.am b/cachegrind/Makefile.am index a00235e24a..0f0a5fea12 100644 --- a/cachegrind/Makefile.am +++ b/cachegrind/Makefile.am @@ -1,7 +1,8 @@ SUBDIRS = . docs tests -AM_CPPFLAGS = -I$(top_srcdir)/include -DVG_LIBDIR="\"$(libdir)"\" +AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include \ + -DVG_LIBDIR="\"$(libdir)"\" AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -O -fomit-frame-pointer \ @PREFERRED_STACK_BOUNDARY@ -g diff --git a/corecheck/Makefile.am b/corecheck/Makefile.am index b1682cc16a..02880dcdb6 100644 --- a/corecheck/Makefile.am +++ b/corecheck/Makefile.am @@ -1,7 +1,8 @@ SUBDIRS = . tests docs -AM_CPPFLAGS = -I$(top_srcdir)/include -DVG_LIBDIR="\"$(libdir)"\" +AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include \ + -DVG_LIBDIR="\"$(libdir)"\" AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -O -fomit-frame-pointer \ @PREFERRED_STACK_BOUNDARY@ -g diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am index affceefdd6..f4855d06fe 100644 --- a/coregrind/Makefile.am +++ b/coregrind/Makefile.am @@ -1,7 +1,8 @@ SUBDIRS = x86 demangle . docs -add_includes = -I$(srcdir)/demangle -I$(top_srcdir)/include -I$(srcdir)/x86 +add_includes = -I$(srcdir)/demangle -I$(top_builddir)/include \ + -I$(top_srcdir)/include -I$(srcdir)/x86 valdir = $(libdir)/valgrind inplacedir = $(top_builddir)/.in_place @@ -90,15 +91,15 @@ stage2_LDADD= \ demangle/safe-ctype.o \ -ldl -vg_intercept.c: $(srcdir)/gen_intercepts.pl vg_intercept.c.base +vg_intercept.c: $(srcdir)/gen_intercepts.pl $(srcdir)/vg_intercept.c.base rm -f $@ - $(PERL) $(srcdir)/gen_intercepts.pl < vg_intercept.c.base > $@ + $(PERL) $(srcdir)/gen_intercepts.pl < $(srcdir)/vg_intercept.c.base > $@ -vg_replace_malloc.c: $(srcdir)/gen_intercepts.pl vg_replace_malloc.c.base +vg_replace_malloc.c: $(srcdir)/gen_intercepts.pl $(srcdir)/vg_replace_malloc.c.base rm -f $@ - $(PERL) $(srcdir)/gen_intercepts.pl < vg_replace_malloc.c.base > $@ + $(PERL) $(srcdir)/gen_intercepts.pl < $(srcdir)/vg_replace_malloc.c.base > $@ -vg_toolint.c: $(srcdir)/gen_toolint.pl $(srcdir)/toolfuncs.def $(srcdir)/Makefile +vg_toolint.c: $(srcdir)/gen_toolint.pl $(srcdir)/toolfuncs.def ./Makefile rm -f $@ $(PERL) $(srcdir)/gen_toolint.pl callwrap < $(srcdir)/toolfuncs.def > $@ || rm -f $@ $(PERL) $(srcdir)/gen_toolint.pl missingfuncs < $(srcdir)/toolfuncs.def >> $@ || rm -f $@ @@ -106,7 +107,7 @@ vg_toolint.c: $(srcdir)/gen_toolint.pl $(srcdir)/toolfuncs.def $(srcdir)/Makefil $(PERL) $(srcdir)/gen_toolint.pl initdlsym < $(srcdir)/toolfuncs.def >> $@ || rm -f $@ $(PERL) $(srcdir)/gen_toolint.pl structdef < $(srcdir)/toolfuncs.def >> $@ || rm -f $@ -vg_toolint.h: $(srcdir)/gen_toolint.pl $(srcdir)/toolfuncs.def $(srcdir)/Makefile +vg_toolint.h: $(srcdir)/gen_toolint.pl $(srcdir)/toolfuncs.def ./Makefile rm -f $@ $(PERL) $(srcdir)/gen_toolint.pl proto < $(srcdir)/toolfuncs.def > $@ || rm -f $@ $(PERL) $(srcdir)/gen_toolint.pl struct < $(srcdir)/toolfuncs.def >> $@ || rm -f $@ diff --git a/coregrind/demangle/Makefile.am b/coregrind/demangle/Makefile.am index 1ac2b8fc8f..b1956c44e9 100644 --- a/coregrind/demangle/Makefile.am +++ b/coregrind/demangle/Makefile.am @@ -1,5 +1,6 @@ -AM_CPPFLAGS = -I$(top_srcdir)/coregrind -I$(top_srcdir)/include +AM_CPPFLAGS = -I$(top_builddir)/coregrind -I$(top_srcdir)/coregrind \ + -I$(top_builddir)/include -I$(top_srcdir)/include AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -O -fomit-frame-pointer -g noinst_HEADERS = \ diff --git a/helgrind/Makefile.am b/helgrind/Makefile.am index eab751501b..09dc6a844c 100644 --- a/helgrind/Makefile.am +++ b/helgrind/Makefile.am @@ -1,7 +1,8 @@ SUBDIRS = . docs tests -AM_CPPFLAGS = -I$(top_srcdir)/include -DVG_LIBDIR="\"$(libdir)"\" +AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include \ + -DVG_LIBDIR="\"$(libdir)"\" AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -O -fomit-frame-pointer \ @PREFERRED_STACK_BOUNDARY@ -g diff --git a/lackey/Makefile.am b/lackey/Makefile.am index fdadc30e40..7b0599b48f 100644 --- a/lackey/Makefile.am +++ b/lackey/Makefile.am @@ -1,7 +1,8 @@ SUBDIRS = . docs tests -AM_CPPFLAGS = -I$(top_srcdir)/include -DVG_LIBDIR="\"$(libdir)"\" +AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include \ + -DVG_LIBDIR="\"$(libdir)"\" AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -O -fomit-frame-pointer \ @PREFERRED_STACK_BOUNDARY@ -g diff --git a/massif/Makefile.am b/massif/Makefile.am index 7e1ce6b187..65a69383d4 100644 --- a/massif/Makefile.am +++ b/massif/Makefile.am @@ -1,7 +1,8 @@ SUBDIRS = . tests docs hp2ps -AM_CPPFLAGS = -I$(top_srcdir)/include -DVG_LIBDIR="\"$(libdir)"\" +AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include \ + -DVG_LIBDIR="\"$(libdir)"\" AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -O -fomit-frame-pointer \ @PREFERRED_STACK_BOUNDARY@ -g diff --git a/memcheck/Makefile.am b/memcheck/Makefile.am index ec5c4731e8..5d5fd15688 100644 --- a/memcheck/Makefile.am +++ b/memcheck/Makefile.am @@ -1,7 +1,7 @@ SUBDIRS = . tests docs -all_includes = -I$(top_srcdir)/include +all_includes = -I$(top_builddir)/include -I$(top_srcdir)/include AM_CPPFLAGS = $(all_includes) -DVG_LIBDIR="\"$(libdir)"\" AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -O2 -fomit-frame-pointer \ diff --git a/none/Makefile.am b/none/Makefile.am index 30a631ea47..775a0cd9ba 100644 --- a/none/Makefile.am +++ b/none/Makefile.am @@ -1,7 +1,8 @@ SUBDIRS = . docs tests -AM_CPPFLAGS = -I$(top_srcdir)/include -DVG_LIBDIR="\"$(libdir)"\" +AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include \ + -DVG_LIBDIR="\"$(libdir)"\" AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -O -fomit-frame-pointer \ @PREFERRED_STACK_BOUNDARY@ -g