Some Makefile.am changes.  Lots of them affected:

- changed deprecated INCLUDES variable to AM_CPPFLAGS

- moved the -DVG_LIBDIR definition from AM_CFLAGS into AM_CPPFLAGS

- generally neatened them up a bit -- removed old commented out stuff, fixed a
  couple of other minor things

Everything works for me, hopefully it won't break things for anyone else...


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1680 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/Makefile.am b/Makefile.am
index 3c16913..270c9df 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -13,12 +13,15 @@
 		lackey \
 		none
 
-AM_CFLAGS = $(WERROR) -DVG_LIBDIR="\"$(libdir)"\" \
-		-Winline -Wall -Wshadow -O -fomit-frame-pointer @PREFERRED_STACK_BOUNDARY@ -g
+AM_CPPFLAGS = -DVG_LIBDIR="\"$(libdir)"\"
+AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -O -fomit-frame-pointer \
+		@PREFERRED_STACK_BOUNDARY@ -g
 
 valdir = $(libdir)/valgrind
 
-SUPP_FILES = glibc-2.1.supp glibc-2.2.supp glibc-2.3.supp xfree-3.supp xfree-4.supp
+SUPP_FILES = \
+	glibc-2.1.supp glibc-2.2.supp glibc-2.3.supp \
+	xfree-3.supp xfree-4.supp
 
 val_DATA = $(SUPP_FILES) default.supp
 
diff --git a/addrcheck/Makefile.am b/addrcheck/Makefile.am
index c7c9d63..1a4f506 100644
--- a/addrcheck/Makefile.am
+++ b/addrcheck/Makefile.am
@@ -2,10 +2,10 @@
 SUBDIRS = . docs tests
 
 # include memcheck/ for mac_shared.h
-INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/memcheck
-
-AM_CFLAGS = $(WERROR) -DVG_LIBDIR="\"$(libdir)"\" \
-		-Winline -Wall -Wshadow -O -fomit-frame-pointer @PREFERRED_STACK_BOUNDARY@ -g
+AM_CPPFLAGS = -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
 
 valdir = $(libdir)/valgrind
 
diff --git a/addrcheck/tests/Makefile.am b/addrcheck/tests/Makefile.am
index 47ad0df..e586af5 100644
--- a/addrcheck/tests/Makefile.am
+++ b/addrcheck/tests/Makefile.am
@@ -1,7 +1,4 @@
-## Process this file with automake to produce Makefile.in
-
 noinst_SCRIPTS = filter_stderr
 
-EXTRA_DIST = \
-	$(noinst_SCRIPTS) \
+EXTRA_DIST = $(noinst_SCRIPTS) \
 	true.stderr.exp true.vgtest
diff --git a/auxprogs/Makefile.am b/auxprogs/Makefile.am
index ad6aa9f..62e0ff7 100644
--- a/auxprogs/Makefile.am
+++ b/auxprogs/Makefile.am
@@ -1,10 +1,9 @@
 
 SUBDIRS = . 
 
-INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/coregrind
-
-AM_CFLAGS = $(WERROR) -DVG_LIBDIR="\"$(libdir)"\" \
-		-Winline -Wall -O -g
+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/coregrind \
+		-DVG_LIBDIR="\"$(libdir)"\"
+AM_CFLAGS = $(WERROR) -Winline -Wall -O -g
 
 bin_PROGRAMS = valgrind-listener
 
diff --git a/cachegrind/Makefile.am b/cachegrind/Makefile.am
index ef494bb..7786699 100644
--- a/cachegrind/Makefile.am
+++ b/cachegrind/Makefile.am
@@ -1,10 +1,9 @@
 
-SUBDIRS = . tests docs
+SUBDIRS = . docs tests
 
-INCLUDES = -I$(top_srcdir)/include
-
-AM_CFLAGS = $(WERROR) -DVG_LIBDIR="\"$(libdir)"\" \
-		-Winline -Wall -Wshadow -O -fomit-frame-pointer @PREFERRED_STACK_BOUNDARY@ -g
+AM_CPPFLAGS = -I$(top_srcdir)/include -DVG_LIBDIR="\"$(libdir)"\"
+AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -O -fomit-frame-pointer \
+		@PREFERRED_STACK_BOUNDARY@ -g
 
 valdir = $(libdir)/valgrind
 
@@ -20,8 +19,3 @@
 
 vgskin_cachegrind_so_SOURCES = cg_main.c
 vgskin_cachegrind_so_LDFLAGS = -shared
-
-##vgskin_cachegrind.so$(EXEEXT): $(vgskin_cachegrind_so_OBJECTS)
-##	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o vgskin_cachegrind.so \
-##		$(vgskin_cachegrind_so_OBJECTS)
-
diff --git a/corecheck/Makefile.am b/corecheck/Makefile.am
index f74488f..c9fd968 100644
--- a/corecheck/Makefile.am
+++ b/corecheck/Makefile.am
@@ -1,18 +1,13 @@
 
 SUBDIRS = . tests docs
 
-AM_CFLAGS = $(WERROR) -DVG_LIBDIR="\"$(libdir)"\" \
-		-Winline -Wall -Wshadow -O -fomit-frame-pointer @PREFERRED_STACK_BOUNDARY@ -g
+AM_CPPFLAGS = -I$(top_srcdir)/include -DVG_LIBDIR="\"$(libdir)"\"
+AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -O -fomit-frame-pointer \
+		@PREFERRED_STACK_BOUNDARY@ -g
 
 valdir = $(libdir)/valgrind
 
-INCLUDES = -I$(top_srcdir)/include
-
 val_PROGRAMS = vgskin_corecheck.so
 
 vgskin_corecheck_so_SOURCES = cc_main.c
 vgskin_corecheck_so_LDFLAGS = -shared
-
-##vgskin_corecheck.so$(EXEEXT): $(vgskin_corecheck_so_OBJECTS)
-##	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o vgskin_corecheck.so \
-##		$(vgskin_corecheck_so_OBJECTS)
diff --git a/corecheck/tests/Makefile.am b/corecheck/tests/Makefile.am
index a6a6efc..8e1f293 100644
--- a/corecheck/tests/Makefile.am
+++ b/corecheck/tests/Makefile.am
@@ -1,5 +1,3 @@
-## Process this file with automake to produce Makefile.in
-
 ##---------------------------------------------------------------------------
 ## These test core error checking, eg. "silly values" for malloc/calloc,
 ## pthread errors (and suppressions), signal handling errors, invalid fds for
@@ -8,8 +6,7 @@
 
 noinst_SCRIPTS = filter_stderr
 
-EXTRA_DIST = \
-	$(noinst_SCRIPTS) \
+EXTRA_DIST = $(noinst_SCRIPTS) \
 	erringfds.stderr.exp erringfds.stdout.exp erringfds.vgtest \
 	pth_atfork1.stderr.exp pth_atfork1.stdout.exp pth_atfork1.vgtest \
 	pth_cancel2.stderr.exp pth_cancel2.vgtest \
diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am
index 4118354..b79fc24 100644
--- a/coregrind/Makefile.am
+++ b/coregrind/Makefile.am
@@ -1,16 +1,15 @@
 
 SUBDIRS = demangle . docs
 
-AM_CFLAGS = $(WERROR) -DVG_LIBDIR="\"$(libdir)"\" \
-		-Winline -Wall -Wshadow -O -fomit-frame-pointer \
+add_includes = -I$(srcdir)/demangle -I$(top_srcdir)/include
+
+AM_CPPFLAGS = $(add_includes) -DVG_LIBDIR="\"$(libdir)"\"
+AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -O -fomit-frame-pointer \
 		@PREFERRED_STACK_BOUNDARY@ -g
+AM_CCASFLAGS = $(add_includes)
 
 valdir = $(libdir)/valgrind
 
-INCLUDES = -I$(srcdir)/demangle -I$(top_srcdir)/include
-
-AM_CCASFLAGS = $(INCLUDES)
-
 bin_SCRIPTS = valgrind
 
 default.supp: $(SUPP_FILES)
@@ -26,7 +25,8 @@
 	vg_libpthread.c \
 	vg_libpthread_unimp.c
 libpthread_so_DEPENDENCIES = $(srcdir)/vg_libpthread.vs
-libpthread_so_LDFLAGS	   = -Werror -fno-omit-frame-pointer -UVG_LIBDIR -shared -fpic \
+libpthread_so_LDFLAGS	   = -Werror -fno-omit-frame-pointer -UVG_LIBDIR \
+	-shared -fpic \
 	-Wl,-version-script $(srcdir)/vg_libpthread.vs \
 	-Wl,-z,nodelete,-z,initfirst \
 	-Wl,--soname=libpthread.so.0
@@ -84,8 +84,6 @@
 
 MANUAL_DEPS = $(noinst_HEADERS) $(include_HEADERS) .in_place/libpthread.so.0
 
-vg_memory_c_CFLAGS = $(PREFERRED_STACK_BOUNDARY)
-
 vg_intercept.o vg_libpthread.o vg_replace_malloc.o: CFLAGS += -fno-omit-frame-pointer
 
 all-local:
diff --git a/coregrind/demangle/Makefile.am b/coregrind/demangle/Makefile.am
index 090f923..1ac2b8f 100644
--- a/coregrind/demangle/Makefile.am
+++ b/coregrind/demangle/Makefile.am
@@ -1,6 +1,5 @@
 
-INCLUDES = -I$(top_srcdir)/coregrind -I$(top_srcdir)/include
-
+AM_CPPFLAGS = -I$(top_srcdir)/coregrind -I$(top_srcdir)/include
 AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -O -fomit-frame-pointer -g
 
 noinst_HEADERS = \
@@ -14,7 +13,6 @@
 libdemangle_a_SOURCES = \
 	cp-demangle.c cplus-dem.c dyn-string.c safe-ctype.c
 
-# some files don't like my config.h, so just pretend it does not exist...
-cp_demange_c_CFLAGS = -Wno-unused -Wno-shadow -UHAVE_CONFIG_H
-dyn_string_c_CFLAGS = -UHAVE_CONFIG_H
-cplus_dem_c_CFLAGS = -Wno-unused
+cp-demangle.o: CFLAGS += -Wno-unused -Wno-shadow 
+cplus-dem.o: CFLAGS += -Wno-unused
+
diff --git a/example/Makefile.am b/example/Makefile.am
index b33202e..92c3413 100644
--- a/example/Makefile.am
+++ b/example/Makefile.am
@@ -1,13 +1,12 @@
 
 SUBDIRS = .
 
-AM_CFLAGS = $(WERROR) -DVG_LIBDIR="\"$(libdir)"\" \
-		-Winline -Wall -Wshadow -O -fomit-frame-pointer @PREFERRED_STACK_BOUNDARY@ -g
+AM_CPPFLAGS = -I$(top_srcdir)/include -DVG_LIBDIR="\"$(libdir)"\"
+AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -O -fomit-frame-pointer \
+		@PREFERRED_STACK_BOUNDARY@ -g
 
 valdir = $(libdir)/valgrind
 
-INCLUDES = -I$(top_srcdir)/include
-
 val_PROGRAMS = vgskin_example.so
 
 vgskin_example_so_SOURCES = ex_main.c
diff --git a/helgrind/Makefile.am b/helgrind/Makefile.am
index aadefa6..c31517a 100644
--- a/helgrind/Makefile.am
+++ b/helgrind/Makefile.am
@@ -1,13 +1,12 @@
 
 SUBDIRS = . docs tests
 
-AM_CFLAGS = $(WERROR) -DVG_LIBDIR="\"$(libdir)"\" \
-		-Winline -Wall -Wshadow -O -fomit-frame-pointer @PREFERRED_STACK_BOUNDARY@ -g
+AM_CPPFLAGS = -I$(top_srcdir)/include -DVG_LIBDIR="\"$(libdir)"\"
+AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -O -fomit-frame-pointer \
+		@PREFERRED_STACK_BOUNDARY@ -g
 
 valdir = $(libdir)/valgrind
 
-INCLUDES = -I$(top_srcdir)/include
-
 val_PROGRAMS = vgskin_helgrind.so
 
 vgskin_helgrind_so_SOURCES = hg_main.c
diff --git a/helgrind/tests/Makefile.am b/helgrind/tests/Makefile.am
index 47ad0df..e586af5 100644
--- a/helgrind/tests/Makefile.am
+++ b/helgrind/tests/Makefile.am
@@ -1,7 +1,4 @@
-## Process this file with automake to produce Makefile.in
-
 noinst_SCRIPTS = filter_stderr
 
-EXTRA_DIST = \
-	$(noinst_SCRIPTS) \
+EXTRA_DIST = $(noinst_SCRIPTS) \
 	true.stderr.exp true.vgtest
diff --git a/lackey/Makefile.am b/lackey/Makefile.am
index 8b47529..202ac99 100644
--- a/lackey/Makefile.am
+++ b/lackey/Makefile.am
@@ -1,18 +1,14 @@
 
 SUBDIRS = . docs tests
 
-AM_CFLAGS = $(WERROR) -DVG_LIBDIR="\"$(libdir)"\" \
-		-Winline -Wall -Wshadow -O -fomit-frame-pointer @PREFERRED_STACK_BOUNDARY@ -g
+AM_CPPFLAGS = -I$(top_srcdir)/include -DVG_LIBDIR="\"$(libdir)"\"
+AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -O -fomit-frame-pointer \
+		@PREFERRED_STACK_BOUNDARY@ -g
 
 valdir = $(libdir)/valgrind
 
-INCLUDES = -I$(top_srcdir)/include
-
 val_PROGRAMS = vgskin_lackey.so
 
 vgskin_lackey_so_SOURCES = lk_main.c
 vgskin_lackey_so_LDFLAGS = -shared
 
-##vgskin_lackey.so$(EXEEXT): $(vgskin_lackey_so_OBJECTS)
-##	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o vgskin_lackey.so \
-##		$(vgskin_lackey_so_OBJECTS)
diff --git a/lackey/tests/Makefile.am b/lackey/tests/Makefile.am
index 47ad0df..e586af5 100644
--- a/lackey/tests/Makefile.am
+++ b/lackey/tests/Makefile.am
@@ -1,7 +1,4 @@
-## Process this file with automake to produce Makefile.in
-
 noinst_SCRIPTS = filter_stderr
 
-EXTRA_DIST = \
-	$(noinst_SCRIPTS) \
+EXTRA_DIST = $(noinst_SCRIPTS) \
 	true.stderr.exp true.vgtest
diff --git a/memcheck/Makefile.am b/memcheck/Makefile.am
index 7b775e5..e938507 100644
--- a/memcheck/Makefile.am
+++ b/memcheck/Makefile.am
@@ -1,13 +1,12 @@
 
 SUBDIRS = . tests docs
 
-INCLUDES = -I$(top_srcdir)/include
+all_includes = -I$(top_srcdir)/include
 
-AM_CFLAGS = $(WERROR) -DVG_LIBDIR="\"$(libdir)"\" \
-		-Winline -Wall -Wshadow -O -fomit-frame-pointer \
+AM_CPPFLAGS = $(all_includes) -DVG_LIBDIR="\"$(libdir)"\"
+AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -O -fomit-frame-pointer \
 		@PREFERRED_STACK_BOUNDARY@ -g
-
-AM_CCASFLAGS = $(INCLUDES)
+AM_CCASFLAGS = $(all_includes)
 
 valdir = $(libdir)/valgrind
 
diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am
index 1704e04..1c6dfc1 100644
--- a/memcheck/tests/Makefile.am
+++ b/memcheck/tests/Makefile.am
@@ -1,20 +1,12 @@
-## Process this file with automake to produce Makefile.in
-
 ##---------------------------------------------------------------------------
 ## Need more tests:
 ## - lots more mmap/munmap/mremap/mprotect ones
-
-## Notes:
-##   - HEAD and ERASER stderr.exp are different for signal2 due to lazy vs.
-##     strict EIP updating
 ##---------------------------------------------------------------------------
 
 noinst_SCRIPTS = filter_allocs filter_leak_check_size filter_stderr \
                  filter_stderr_backtrace
 
-
-EXTRA_DIST = \
-	$(noinst_SCRIPTS) \
+EXTRA_DIST = $(noinst_SCRIPTS) \
 	badaddrvalue.stderr.exp \
 	badaddrvalue.stdout.exp badaddrvalue.vgtest \
 	badfree-2trace.stderr.exp badfree-2trace.vgtest \
@@ -73,9 +65,9 @@
 	trivialleak tronical weirdioctl	\
 	mismatches new_override
 
+AM_CPPFLAGS = -I$(top_srcdir)/include
 AM_CFLAGS   = $(WERROR) -Winline -Wall -Wshadow -g 
 AM_CXXFLAGS = $(AM_CFLAGS)
-INCLUDES = -I$(top_srcdir)/include
 
 # C ones
 badaddrvalue_SOURCES 	= badaddrvalue.c
diff --git a/none/Makefile.am b/none/Makefile.am
index 1fb9d20..8f8ce9d 100644
--- a/none/Makefile.am
+++ b/none/Makefile.am
@@ -1,13 +1,12 @@
 
-SUBDIRS = . tests docs
+SUBDIRS = . docs tests
 
-AM_CFLAGS = $(WERROR) -DVG_LIBDIR="\"$(libdir)"\" \
-		-Winline -Wall -Wshadow -O -fomit-frame-pointer @PREFERRED_STACK_BOUNDARY@ -g
+AM_CPPFLAGS = -I$(top_srcdir)/include -DVG_LIBDIR="\"$(libdir)"\"
+AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -O -fomit-frame-pointer \
+		@PREFERRED_STACK_BOUNDARY@ -g
 
 valdir = $(libdir)/valgrind
 
-INCLUDES = -I$(top_srcdir)/include
-
 val_PROGRAMS = vgskin_none.so
 
 vgskin_none_so_SOURCES 	 = nl_main.c
diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am
index a0f4cee..fbd7c3b 100644
--- a/none/tests/Makefile.am
+++ b/none/tests/Makefile.am
@@ -1,13 +1,6 @@
-## Process this file with automake to produce Makefile.in
-
-##---------------------------------------------------------------------------
-## These ones all work fine without producing errors in any skin.
-##---------------------------------------------------------------------------
-
 noinst_SCRIPTS = filter_stderr
 
-EXTRA_DIST = \
-	$(noinst_SCRIPTS) \
+EXTRA_DIST = $(noinst_SCRIPTS) \
 	args.stderr.exp args.stdout.exp args.vgtest \
 	bitfield1.stderr.exp bitfield1.vgtest \
 	bt_everything.stderr.exp \
@@ -89,6 +82,5 @@
 gxx304_SOURCES		= gxx304.cpp
 
 # must be built with these flags -- bug only occurred with them
-fpu_lazy_eflags.o: fpu_lazy_eflags.c
-	$(COMPILE) -O2 -mcpu=pentiumpro -march=pentiumpro -c $<
+fpu_lazy_eflags.o: CFLAGS += -O2 -mcpu=pentiumpro -march=pentiumpro
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
index e29b3d1..b2997a6 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -8,6 +8,8 @@
 	filter_stderr_basic \
 	filter_test_paths
 
+EXTRA_DIST = $(noinst_SCRIPTS)
+
 check_PROGRAMS = \
 	true
 
@@ -17,5 +19,4 @@
 # generic C ones
 true_SOURCES 	= true.c
 
-EXTRA_DIST = $(noinst_SCRIPTS)