From c737d348045479f71ea7d31eaeadda16eea94aa9 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 9 Apr 2010 21:34:25 +0000 Subject: [PATCH] Use vpath instead of VPATH. Usage of VPATH makes troubles when used within $(builddir). Not only source files are being found through VPATH, but targets as well. (make --debug=v) Thus if user builds the code in $(srcdir) and also in some $(builddir) he gets mangled results as some generated files (i.e. .export.sym) are 'reused' from $(srcdir) instead of $(builddir). This patch switches to use vpath were we could explicitly name suffixes that should be looked via vpath - we must take care, we do not generate files with these suffixes: .c, .in, .po, .exported_symbols --- Makefile.in | 1 - WHATS_NEW | 1 + daemons/Makefile.in | 1 - daemons/clvmd/Makefile.in | 1 - daemons/cmirrord/Makefile.in | 1 - daemons/dmeventd/Makefile.in | 1 - daemons/dmeventd/plugins/Makefile.in | 1 - daemons/dmeventd/plugins/lvm2/Makefile.in | 1 - daemons/dmeventd/plugins/mirror/Makefile.in | 1 - daemons/dmeventd/plugins/snapshot/Makefile.in | 1 - doc/Makefile.in | 3 +-- lib/Makefile.in | 1 - lib/format1/Makefile.in | 1 - lib/format_pool/Makefile.in | 1 - lib/locking/Makefile.in | 1 - lib/mirror/Makefile.in | 1 - lib/snapshot/Makefile.in | 1 - libdm/Makefile.in | 1 - liblvm/Makefile.in | 1 - make.tmpl.in | 6 ++++++ man/Makefile.in | 1 - po/Makefile.in | 1 - scripts/Makefile.in | 1 - test/api/Makefile.in | 1 - tools/Makefile.in | 3 +-- udev/Makefile.in | 3 ++- 26 files changed, 11 insertions(+), 26 deletions(-) diff --git a/Makefile.in b/Makefile.in index 710c9a0cc..609dcd2d6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -15,7 +15,6 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -VPATH = @srcdir@ SUBDIRS = doc include man scripts diff --git a/WHATS_NEW b/WHATS_NEW index 06a2449ea..257ace5a3 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.63 - ================================ + Switch from using VPATH to vpath in Makefiles. Permit mimage LVs to be striped in lvcreate and lvresize. Fix pvmove allocation to take existing parallel stripes into account. Add pvmove_source_seg to struct lv_segment. diff --git a/daemons/Makefile.in b/daemons/Makefile.in index 2f5837a83..ce400d78a 100644 --- a/daemons/Makefile.in +++ b/daemons/Makefile.in @@ -14,7 +14,6 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -VPATH = @srcdir@ .PHONY: dmeventd clvmd cmirrord diff --git a/daemons/clvmd/Makefile.in b/daemons/clvmd/Makefile.in index e3f70d5a8..773c3689d 100644 --- a/daemons/clvmd/Makefile.in +++ b/daemons/clvmd/Makefile.in @@ -14,7 +14,6 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -VPATH = @srcdir@ CCS_LIBS = @CCS_LIBS@ CCS_CFLAGS = @CCS_CFLAGS@ diff --git a/daemons/cmirrord/Makefile.in b/daemons/cmirrord/Makefile.in index b8928c749..583c4549d 100644 --- a/daemons/cmirrord/Makefile.in +++ b/daemons/cmirrord/Makefile.in @@ -14,7 +14,6 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -VPATH = @srcdir@ CPG_LIBS = @CPG_LIBS@ CPG_CFLAGS = @CPG_CFLAGS@ diff --git a/daemons/dmeventd/Makefile.in b/daemons/dmeventd/Makefile.in index cd2a4d36e..e0a634950 100644 --- a/daemons/dmeventd/Makefile.in +++ b/daemons/dmeventd/Makefile.in @@ -14,7 +14,6 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -VPATH = @srcdir@ SOURCES = libdevmapper-event.c SOURCES2 = dmeventd.c diff --git a/daemons/dmeventd/plugins/Makefile.in b/daemons/dmeventd/plugins/Makefile.in index 6b25235da..45176ad7f 100644 --- a/daemons/dmeventd/plugins/Makefile.in +++ b/daemons/dmeventd/plugins/Makefile.in @@ -15,7 +15,6 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -VPATH = @srcdir@ SUBDIRS += lvm2 mirror snapshot diff --git a/daemons/dmeventd/plugins/lvm2/Makefile.in b/daemons/dmeventd/plugins/lvm2/Makefile.in index 0f23c8450..f44a5626d 100644 --- a/daemons/dmeventd/plugins/lvm2/Makefile.in +++ b/daemons/dmeventd/plugins/lvm2/Makefile.in @@ -14,7 +14,6 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -VPATH = @srcdir@ CLDFLAGS += -L$(top_builddir)/tools diff --git a/daemons/dmeventd/plugins/mirror/Makefile.in b/daemons/dmeventd/plugins/mirror/Makefile.in index 02c4e2496..3dfc3a225 100644 --- a/daemons/dmeventd/plugins/mirror/Makefile.in +++ b/daemons/dmeventd/plugins/mirror/Makefile.in @@ -15,7 +15,6 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -VPATH = @srcdir@ INCLUDES += -I$(top_srcdir)/tools -I$(top_srcdir)/daemons/dmeventd/plugins/lvm2 CLDFLAGS += -L$(top_builddir)/tools -L$(top_builddir)/daemons/dmeventd/plugins/lvm2 diff --git a/daemons/dmeventd/plugins/snapshot/Makefile.in b/daemons/dmeventd/plugins/snapshot/Makefile.in index 793fd3885..0f202b386 100644 --- a/daemons/dmeventd/plugins/snapshot/Makefile.in +++ b/daemons/dmeventd/plugins/snapshot/Makefile.in @@ -15,7 +15,6 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -VPATH = @srcdir@ INCLUDES += -I$(top_srcdir)/tools -I$(top_srcdir)/daemons/dmeventd/plugins/lvm2 CLDFLAGS += -L$(top_builddir)/tools -L$(top_builddir)/daemons/dmeventd/plugins/lvm2 diff --git a/doc/Makefile.in b/doc/Makefile.in index ce662094a..61b32e94d 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -14,9 +14,8 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -VPATH = @srcdir@ -CONFSRC=example.conf +CONFSRC=$(srcdir)/example.conf CONFDEST=lvm.conf include $(top_builddir)/make.tmpl diff --git a/lib/Makefile.in b/lib/Makefile.in index acfb23ed1..9662120a7 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -15,7 +15,6 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -VPATH = @srcdir@ ifeq ("@LVM1@", "shared") SUBDIRS = format1 diff --git a/lib/format1/Makefile.in b/lib/format1/Makefile.in index f62ab7c51..327a1c223 100644 --- a/lib/format1/Makefile.in +++ b/lib/format1/Makefile.in @@ -15,7 +15,6 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -VPATH = @srcdir@ SOURCES =\ disk-rep.c \ diff --git a/lib/format_pool/Makefile.in b/lib/format_pool/Makefile.in index b0ebc361e..d9cedf06d 100644 --- a/lib/format_pool/Makefile.in +++ b/lib/format_pool/Makefile.in @@ -15,7 +15,6 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -VPATH = @srcdir@ SOURCES =\ disk_rep.c \ diff --git a/lib/locking/Makefile.in b/lib/locking/Makefile.in index 399b0afec..99cc206c1 100644 --- a/lib/locking/Makefile.in +++ b/lib/locking/Makefile.in @@ -15,7 +15,6 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -VPATH = @srcdir@ SOURCES = cluster_locking.c diff --git a/lib/mirror/Makefile.in b/lib/mirror/Makefile.in index 038399abb..233fa96f0 100644 --- a/lib/mirror/Makefile.in +++ b/lib/mirror/Makefile.in @@ -15,7 +15,6 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -VPATH = @srcdir@ SOURCES = mirrored.c diff --git a/lib/snapshot/Makefile.in b/lib/snapshot/Makefile.in index 80728c7bc..e2c2b10e0 100644 --- a/lib/snapshot/Makefile.in +++ b/lib/snapshot/Makefile.in @@ -15,7 +15,6 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -VPATH = @srcdir@ SOURCES = snapshot.c diff --git a/libdm/Makefile.in b/libdm/Makefile.in index 63e6603f9..1e9284a1c 100644 --- a/libdm/Makefile.in +++ b/libdm/Makefile.in @@ -15,7 +15,6 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -VPATH = @srcdir@ SOURCES =\ datastruct/bitset.c \ diff --git a/liblvm/Makefile.in b/liblvm/Makefile.in index 1b2b47453..165ce46ff 100644 --- a/liblvm/Makefile.in +++ b/liblvm/Makefile.in @@ -15,7 +15,6 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -VPATH = @srcdir@ SOURCES =\ lvm_misc.c \ diff --git a/make.tmpl.in b/make.tmpl.in index 58774a1ee..6a7955108 100644 --- a/make.tmpl.in +++ b/make.tmpl.in @@ -63,6 +63,12 @@ localedir = $(DESTDIR)@LOCALEDIR@ staticdir = $(DESTDIR)@STATICDIR@ udevdir = $(DESTDIR)@udevdir@ +# Setup vpath search paths for some suffixes +vpath %.c $(srcdir) +vpath %.in $(srcdir) +vpath %.po $(srcdir) +vpath %.exported_symbols $(srcdir) + interface = @interface@ interfacebuilddir = $(top_builddir)/libdm/$(interface) diff --git a/man/Makefile.in b/man/Makefile.in index 446bbe6c6..f34014ea5 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -15,7 +15,6 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -VPATH = @srcdir@ ifeq ("@FSADM@", "yes") FSADMMAN = fsadm.8 diff --git a/po/Makefile.in b/po/Makefile.in index 22184f110..79bd34005 100644 --- a/po/Makefile.in +++ b/po/Makefile.in @@ -14,7 +14,6 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -VPATH = @srcdir@ LANGS=de diff --git a/scripts/Makefile.in b/scripts/Makefile.in index b79d3120f..4b1ab7f33 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -14,7 +14,6 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -VPATH = @srcdir@ include $(top_builddir)/make.tmpl diff --git a/test/api/Makefile.in b/test/api/Makefile.in index 605da33c8..d373ff841 100644 --- a/test/api/Makefile.in +++ b/test/api/Makefile.in @@ -14,7 +14,6 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -VPATH = @srcdir@ ifeq ("@DEBUG@", "yes") DEFS += -DDEBUG diff --git a/tools/Makefile.in b/tools/Makefile.in index 8cab5c4aa..b048fad94 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -15,7 +15,6 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -VPATH = @srcdir@ SOURCES =\ dumpconfig.c \ @@ -146,7 +145,7 @@ liblvm2cmd-static.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib. liblvm2cmd.$(LIB_SUFFIX): liblvm2cmd.a $(LDDEPS) -.commands: commands.h cmdnames.h Makefile +.commands: $(srcdir)/commands.h $(srcdir)/cmdnames.h Makefile $(CC) -E -P $(srcdir)/cmdnames.h 2> /dev/null | \ egrep -v '^ *(|#.*|dumpconfig|formats|help|pvdata|segtypes|version) *$$' > .commands diff --git a/udev/Makefile.in b/udev/Makefile.in index 0d9e2ec68..2511cf8a8 100644 --- a/udev/Makefile.in +++ b/udev/Makefile.in @@ -14,7 +14,6 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -VPATH = @srcdir@ DM_RULES=10-dm.rules 13-dm-disk.rules 95-dm-notify.rules LVM_RULES=11-dm-lvm.rules @@ -24,6 +23,8 @@ CLEAN_TARGETS=10-dm.rules include $(top_builddir)/make.tmpl +vpath %.rules $(srcdir) + %: %.in $(SED) -e "s/(DM_DIR)/$(DM_DIR)/" $< >$@