All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] Makefile updates
@ 2010-03-23 16:27 Zdenek Kabelac
  2010-03-23 16:27 ` [PATCH 1/6] Reuse clean target for distclean Zdenek Kabelac
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Zdenek Kabelac @ 2010-03-23 16:27 UTC (permalink / raw)
  To: lvm-devel

This patch set fixes few minor Makefile errors mostly
around clean & distclean targets. Major topic is the update 
of cflow rules.

Zdenek Kabelac (6):
  Reuse clean target for distclean
  Query make.tmpl variable
  Fix cleanup of libdevmapper-event.a and dmeventd
  Fix run of cscope in $(builddir)
  Fix distclean error for subtargets
  Update cflow

 Makefile.in                                 |   25 ++++-------
 daemons/Makefile.in                         |    9 ++++-
 daemons/dmeventd/Makefile.in                |   27 ++++++++++---
 daemons/dmeventd/plugins/mirror/Makefile.in |   11 ++++-
 include/Makefile.in                         |    3 +-
 lib/Makefile.in                             |   21 ++++++----
 libdm/Makefile.in                           |    4 ++
 make.tmpl.in                                |   58 +++++++++++++++++++++++----
 tools/Makefile.in                           |   23 ++++-------
 9 files changed, 122 insertions(+), 59 deletions(-)



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/6] Reuse clean target for distclean
  2010-03-23 16:27 [PATCH 0/6] Makefile updates Zdenek Kabelac
@ 2010-03-23 16:27 ` Zdenek Kabelac
  2010-03-23 16:27 ` [PATCH 2/6] Query make.tmpl variable Zdenek Kabelac
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Zdenek Kabelac @ 2010-03-23 16:27 UTC (permalink / raw)
  To: lvm-devel

Instead of duplicating clean target inside distclean target,
just use it as a subtarget and avoid add duplicating code.

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
---
 make.tmpl.in |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/make.tmpl.in b/make.tmpl.in
index ff4d1b2..df4eafa 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -257,12 +257,9 @@ clean: $(SUBDIRS.clean)
 	      $(SOURCES2:%.c=%.d) $(SOURCES:%.c=%.pot) $(SOURCES:%.c=%.gcno) \
 	      $(SOURCES:%.c=%.gcda) $(LDDEPS)
 
-distclean: $(SUBDIRS.distclean)
+distclean: $(SUBDIRS.clean) $(SUBDIRS.distclean)
 	$(RM) -rf $(DISTCLEAN_DIRS)
-	$(RM) $(DISTCLEAN_TARGETS) \
-	      $(OBJECTS) $(TARGETS) $(CLEAN_TARGETS) $(SOURCES:%.c=%.d) \
-	      $(SOURCES2:%.c=%.d) $(SOURCES:%.c=%.pot) $(SOURCES:%.c=%.gcno) \
-	      $(SOURCES:%.c=%.gcda) $(LDDEPS) \
+	$(RM) $(DISTCLEAN_TARGETS)  \
 	      config.cache config.log config.status \
 	      Makefile make.tmpl core \
 	      lvm-version.h
-- 
1.7.0.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/6] Query make.tmpl variable
  2010-03-23 16:27 [PATCH 0/6] Makefile updates Zdenek Kabelac
  2010-03-23 16:27 ` [PATCH 1/6] Reuse clean target for distclean Zdenek Kabelac
@ 2010-03-23 16:27 ` Zdenek Kabelac
  2010-03-23 16:27 ` [PATCH 3/6] Fix cleanup of libdevmapper-event.a and dmeventd Zdenek Kabelac
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Zdenek Kabelac @ 2010-03-23 16:27 UTC (permalink / raw)
  To: lvm-devel

Avoid hard sed replacement - i.e. quick test change in make.tmpl
could avoid recofiguration steps in same debug cases.

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
---
 Makefile.in |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index a4b1d78..593500e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -88,7 +88,7 @@ endif
 check: all
 	$(MAKE) -C test all
 
-ifneq ("@LCOV@", "")
+ifneq ("$(LCOV)", "")
 .PHONY: lcov-reset lcov lcov-dated
 
 ifeq ($(MAKECMDGOALS),lcov-dated)
@@ -116,7 +116,7 @@ lcov: all
 		-a $(LCOV_REPORTS_DIR)/libdm.info \
 		-a $(LCOV_REPORTS_DIR)/tools.info \
 		-o $(LCOV_REPORTS_DIR)/lvm.info
-ifneq ("@GENHTML@", "")
+ifneq ("$(GENHTML)", "")
 	$(GENHTML) -o $(LCOV_REPORTS_DIR) -p $(top_srcdir) $(LCOV_REPORTS_DIR)/lvm.info
 endif
 
-- 
1.7.0.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/6] Fix cleanup of libdevmapper-event.a and dmeventd
  2010-03-23 16:27 [PATCH 0/6] Makefile updates Zdenek Kabelac
  2010-03-23 16:27 ` [PATCH 1/6] Reuse clean target for distclean Zdenek Kabelac
  2010-03-23 16:27 ` [PATCH 2/6] Query make.tmpl variable Zdenek Kabelac
@ 2010-03-23 16:27 ` Zdenek Kabelac
  2010-03-23 16:27 ` [PATCH 4/6] Fix run of cscope in $(builddir) Zdenek Kabelac
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Zdenek Kabelac @ 2010-03-23 16:27 UTC (permalink / raw)
  To: lvm-devel

Add $(LIB_STATIC) to TARGETS so it's cleaned in the same way
as other libraries in project.
Add dmeventd.gcda dmeventd.gcno to CLEAN_TARGETS.

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
---
 daemons/dmeventd/Makefile.in |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/daemons/dmeventd/Makefile.in b/daemons/dmeventd/Makefile.in
index dc48f0d..948d908 100644
--- a/daemons/dmeventd/Makefile.in
+++ b/daemons/dmeventd/Makefile.in
@@ -26,9 +26,10 @@ TARGETS = dmeventd
 INSTALL_DMEVENTD_TARGETS = install_dmeventd_dynamic
 INSTALL_LIB_TARGETS = install_lib_dynamic
 
+LIB_NAME = libdevmapper-event
 ifeq ("@STATIC_LINK@", "yes")
-  LIB_STATIC = libdevmapper-event.a
-  TARGETS += dmeventd.static
+  LIB_STATIC = $(LIB_NAME).a
+  TARGETS += $(LIB_STATIC) dmeventd.static
   INSTALL_DMEVENTD_TARGETS += install_dmeventd_static
   INSTALL_LIB_TARGETS += install_lib_static
 endif
@@ -36,13 +37,13 @@ endif
 LIB_VERSION = $(LIB_VERSION_DM)
 
 ifeq ("@LIB_SUFFIX@","dylib")
-  LIB_SHARED = libdevmapper-event.dylib
+  LIB_SHARED = $(LIB_NAME).dylib
 else
-  LIB_SHARED = libdevmapper-event.so
+  LIB_SHARED = $(LIB_NAME).so
   VERSIONED_SHLIB = $(LIB_SHARED).$(LIB_VERSION)
 endif
 
-CLEAN_TARGETS = dmeventd.o dmeventd.static
+CLEAN_TARGETS = dmeventd.o dmeventd.static dmeventd.gcda dmeventd.gcno
 
 ifneq ($(MAKECMDGOALS),device-mapper)
   SUBDIRS+=plugins
-- 
1.7.0.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/6] Fix run of cscope in $(builddir)
  2010-03-23 16:27 [PATCH 0/6] Makefile updates Zdenek Kabelac
                   ` (2 preceding siblings ...)
  2010-03-23 16:27 ` [PATCH 3/6] Fix cleanup of libdevmapper-event.a and dmeventd Zdenek Kabelac
@ 2010-03-23 16:27 ` Zdenek Kabelac
  2010-03-23 16:27 ` [PATCH 5/6] Fix distclean error for subtargets Zdenek Kabelac
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Zdenek Kabelac @ 2010-03-23 16:27 UTC (permalink / raw)
  To: lvm-devel

Use $(top_srcdir) for sources and add cscope.out to distcleaning.

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
---
 Makefile.in |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 593500e..967b026 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -81,8 +81,9 @@ endif
 
 ifneq ("@CSCOPE_CMD@", "")
 cscope.out: tools
-	@CSCOPE_CMD@ -b -R
+	@CSCOPE_CMD@ -b -R $(top_srcdir)
 all: cscope.out
+DISTCLEAN_TARGETS += cscope.out
 endif
 
 check: all
-- 
1.7.0.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 5/6] Fix distclean error for subtargets
  2010-03-23 16:27 [PATCH 0/6] Makefile updates Zdenek Kabelac
                   ` (3 preceding siblings ...)
  2010-03-23 16:27 ` [PATCH 4/6] Fix run of cscope in $(builddir) Zdenek Kabelac
@ 2010-03-23 16:27 ` Zdenek Kabelac
  2010-03-23 16:27 ` [PATCH 6/6] Update cflow Zdenek Kabelac
  2010-03-25 18:13 ` [PATCH 0/6] Makefile updates Alasdair G Kergon
  6 siblings, 0 replies; 8+ messages in thread
From: Zdenek Kabelac @ 2010-03-23 16:27 UTC (permalink / raw)
  To: lvm-devel

Move daemons/ and lib/ subtargets to their Makefiles so we don't get
double cleanup error during execution of distclean target.

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
---
 Makefile.in         |   11 +----------
 daemons/Makefile.in |    4 ++++
 lib/Makefile.in     |    9 +++++++++
 3 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 967b026..5c64a9a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -34,16 +34,7 @@ ifeq ("@APPLIB@", "yes")
 endif
 
 ifeq ($(MAKECMDGOALS),distclean)
-  SUBDIRS += daemons/clvmd \
-	     daemons/cmirrord \
-	     daemons/dmeventd/plugins \
-	     daemons/dmeventd \
-	     lib/format1 \
-	     lib/format_pool \
-	     lib/locking \
-	     lib/mirror \
-	     lib/snapshot \
-	     liblvm \
+  SUBDIRS += liblvm \
 	     udev \
 	     test/api \
 	     test \
diff --git a/daemons/Makefile.in b/daemons/Makefile.in
index a0e7268..1b4bcbb 100644
--- a/daemons/Makefile.in
+++ b/daemons/Makefile.in
@@ -30,6 +30,10 @@ ifeq ("@BUILD_DMEVENTD@", "yes")
   SUBDIRS += dmeventd
 endif
 
+ifeq ($(MAKECMDGOALS),distclean)
+  SUBDIRS = clvmd cmirrord dmeventd
+endif
+
 include $(top_builddir)/make.tmpl
 
 ifeq ("@BUILD_DMEVENTD@", "yes")
diff --git a/lib/Makefile.in b/lib/Makefile.in
index a2e66f3..c83dc89 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -152,6 +152,15 @@ LIB_STATIC = $(LIB_NAME).a
 
 CLEAN_TARGETS += $(LIB_NAME).cflow
 
+ifeq ($(MAKECMDGOALS),distclean)
+  SUBDIRS =\
+	format1 \
+	format_pool \
+	snapshot \
+	mirror \
+	locking
+endif
+
 include $(top_builddir)/make.tmpl
 
 $(SUBDIRS): $(LIB_STATIC)
-- 
1.7.0.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 6/6] Update cflow
  2010-03-23 16:27 [PATCH 0/6] Makefile updates Zdenek Kabelac
                   ` (4 preceding siblings ...)
  2010-03-23 16:27 ` [PATCH 5/6] Fix distclean error for subtargets Zdenek Kabelac
@ 2010-03-23 16:27 ` Zdenek Kabelac
  2010-03-25 18:13 ` [PATCH 0/6] Makefile updates Alasdair G Kergon
  6 siblings, 0 replies; 8+ messages in thread
From: Zdenek Kabelac @ 2010-03-23 16:27 UTC (permalink / raw)
  To: lvm-devel

Update cflow file generation - support build dir and properly use
top_srcdir to obtain sources. Create make.tmpl target for
simplier generation of cflow files with the help of
CFLOW_DIR, CFLOW_LIST, CFLOW_TARGET, CFLOW_GEN

Add support for dmeventd.

Try to avoid generation too many warnings from cflow execution.

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
---
 Makefile.in                                 |    7 ++--
 daemons/Makefile.in                         |    5 ++-
 daemons/dmeventd/Makefile.in                |   16 ++++++++-
 daemons/dmeventd/plugins/mirror/Makefile.in |   11 ++++--
 include/Makefile.in                         |    3 +-
 lib/Makefile.in                             |   12 ++----
 libdm/Makefile.in                           |    4 ++
 make.tmpl.in                                |   51 +++++++++++++++++++++++++--
 tools/Makefile.in                           |   23 ++++--------
 9 files changed, 96 insertions(+), 36 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 5c64a9a..ae52ff6 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -65,9 +65,10 @@ po.pofile: tools.pofile daemons.pofile
 pofile: po.pofile
 endif
 
-ifneq ("@CFLOW_CMD@", "")
-tools.cflow: lib.cflow
-cflow: tools.cflow
+ifneq ("$(CFLOW_CMD)", "")
+tools.cflow: libdm.cflow lib.cflow
+daemons.cflow: tools.cflow
+cflow: include.cflow
 endif
 
 ifneq ("@CSCOPE_CMD@", "")
diff --git a/daemons/Makefile.in b/daemons/Makefile.in
index 1b4bcbb..2f5837a 100644
--- a/daemons/Makefile.in
+++ b/daemons/Makefile.in
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2004 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2004-2010 Red Hat, Inc. All rights reserved.
 #
 # This file is part of LVM2.
 #
@@ -28,6 +28,9 @@ endif
 
 ifeq ("@BUILD_DMEVENTD@", "yes")
   SUBDIRS += dmeventd
+ifneq ("$(CFLOW_CMD)", "")
+daemons.cflow: dmeventd.cflow
+endif
 endif
 
 ifeq ($(MAKECMDGOALS),distclean)
diff --git a/daemons/dmeventd/Makefile.in b/daemons/dmeventd/Makefile.in
index 948d908..22100f9 100644
--- a/daemons/dmeventd/Makefile.in
+++ b/daemons/dmeventd/Makefile.in
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2005-2007 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2005-2010 Red Hat, Inc. All rights reserved.
 #
 # This file is part of the device-mapper userspace tools.
 #
@@ -49,6 +49,11 @@ ifneq ($(MAKECMDGOALS),device-mapper)
   SUBDIRS+=plugins
 endif
 
+CFLOW_DIR = daemons/dmeventd
+CFLOW_LIST = $(SOURCES)
+CFLOW_TARGET = $(LIB_NAME).cflow
+CFLOW_GEN = dmeventd
+
 include $(top_builddir)/make.tmpl
 
 all: device-mapper
@@ -72,6 +77,15 @@ ifeq ("@PKGCONFIG@", "yes")
   INSTALL_LIB_TARGETS += install_pkgconfig
 endif
 
+ifneq ("$(CFLOW_CMD)", "")
+CFLOW_SOURCES = $(addprefix $(top_srcdir)/daemons/dmeventd/, $(SOURCES))
+-include $(top_builddir)/libdm/libdevmapper.cflow
+-include $(top_builddir)/lib/liblvm-internal.cflow
+-include $(top_builddir)/lib/liblvm2cmd.cflow
+-include $(top_builddir)/daemons/dmeventd/$(LIB_NAME).cflow
+-include $(top_builddir)/daemons/dmeventd/plugins/mirror/$(LIB_NAME)-lvm2mirror.cflow
+endif
+
 install_include:
 	$(INSTALL) -D $(OWNER) $(GROUP) -m 444 $(srcdir)/libdevmapper-event.h \
 		$(includedir)/libdevmapper-event.h
diff --git a/daemons/dmeventd/plugins/mirror/Makefile.in b/daemons/dmeventd/plugins/mirror/Makefile.in
index bd85a6f..d4c9c7e 100644
--- a/daemons/dmeventd/plugins/mirror/Makefile.in
+++ b/daemons/dmeventd/plugins/mirror/Makefile.in
@@ -22,19 +22,24 @@ CLDFLAGS += -L$(top_builddir)/tools -L$(top_builddir)/daemons/dmeventd/plugins/l
 
 SOURCES = dmeventd_mirror.c
 
+LIB_NAME = libdevmapper-event-lvm2mirror
 ifeq ("@LIB_SUFFIX@","dylib")
-  LIB_SHARED = libdevmapper-event-lvm2mirror.dylib
+  LIB_SHARED = $(LIB_NAME).dylib
 else
-  LIB_SHARED = libdevmapper-event-lvm2mirror.so
+  LIB_SHARED = $(LIB_NAME).so
 endif
 
 LIB_VERSION = $(LIB_VERSION_LVM)
 
+CFLOW_DIR = daemons/dmeventd/plugins/mirror
+CFLOW_LIST = $(SOURCES)
+CFLOW_TARGET = $(LIB_NAME).cflow
+
 include $(top_builddir)/make.tmpl
 
 LIBS += @LVM2CMD_LIB@ -ldevmapper-event-lvm2 -ldevmapper $(PTHREAD_LIBS)
 
-install_lvm2: libdevmapper-event-lvm2mirror.$(LIB_SUFFIX)
+install_lvm2: $(LIB_NAME).$(LIB_SUFFIX)
 	$(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
 		$(libdir)/$<
 
diff --git a/include/Makefile.in b/include/Makefile.in
index 55add36..3023d4a 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -48,5 +48,4 @@ install_device-mapper:
 
 install_lvm2:
 
-cflow:
-
+cflow: all
diff --git a/lib/Makefile.in b/lib/Makefile.in
index c83dc89..f2cfdf7 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -161,14 +161,10 @@ ifeq ($(MAKECMDGOALS),distclean)
 	locking
 endif
 
+CFLOW_DIR = lib
+CFLOW_LIST = $(SOURCES)
+CFLOW_TARGET = $(LIB_NAME).cflow
+
 include $(top_builddir)/make.tmpl
 
 $(SUBDIRS): $(LIB_STATIC)
-
-$(LIB_NAME).cflow: $(SOURCES)
-	set -e; (echo -n "SOURCES += "; \
-		 echo $(SOURCES) | \
-		 sed "s/^/ /;s/ / $(top_srcdir)\/lib\//g;s/$$//"; \
-		 ) > $@
-
-cflow: $(LIB_NAME).cflow
diff --git a/libdm/Makefile.in b/libdm/Makefile.in
index 85e19ea..8874b2b 100644
--- a/libdm/Makefile.in
+++ b/libdm/Makefile.in
@@ -47,6 +47,10 @@ endif
 VERSIONED_SHLIB = libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION_DM)
 LIB_VERSION = $(LIB_VERSION_DM)
 
+CFLOW_DIR = libdm
+CFLOW_LIST = $(SOURCES)
+CFLOW_TARGET = libdevmapper.cflow
+
 include $(top_builddir)/make.tmpl
 
 DEFS += -DDM_DEVICE_UID=@DM_DEVICE_UID@ -DDM_DEVICE_GID=@DM_DEVICE_GID@ \
diff --git a/make.tmpl.in b/make.tmpl.in
index df4eafa..a59b9c0 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -200,8 +200,52 @@ $(SUBDIRS.pofile):
 	$(MAKE) -C $(@:.pofile=) pofile
 endif
 
-ifneq ("@CFLOW_CMD@", "")
+ifneq ("$(CFLOW_CMD)", "")
 cflow: $(SUBDIRS.cflow)
+ifneq ("$(CFLOW_TARGET)", "")
+CLEAN_CFLOW += $(CFLOW_TARGET)
+# use 't' to print in verbatim $(top_srcdir) - any better way ?
+$(CFLOW_TARGET): $(CFLOW_LIST)
+	echo "CFLOW_SOURCES += $(addprefix\
+		\$$(top_srcdir)/$(CFLOW_DIR)/, $(CFLOW_LIST))" > $@
+cflow: $(CFLOW_TARGET)
+.PHONY: $(CFLOW_TARGET)
+endif
+
+ifneq ("$(CFLOW_GEN)", "")
+CFLOW_FLAGS +=\
+ --cpp="$(CC) -E"\
+ --symbol _ISbit:wrapper\
+ --symbol __attribute__:wrapper\
+ --symbol __const__:wrapper\
+ --symbol __extension__:wrapper\
+ --symbol __nonnull:wrapper\
+ --symbol __nothrow__:wrapper\
+ --symbol __pure__:wrapper\
+ --symbol __REDIRECT:wrapper\
+ --symbol __REDIRECT_NTH:wrapper\
+ --symbol __wur:wrapper\
+ -I$(top_srcdir)/libdm\
+ -I$(top_srcdir)/libdm/ioctl\
+ -I$(top_srcdir)/tools/ioctl\
+ -I$(top_srcdir)/daemons/dmeventd/plugins/lvm2/\
+ $(INCLUDES) $(DEFS)
+
+.PHONY: $(CFLOW_GEN).cflow $(CFLOW_GEN).xref $(CFLOW_GEN).tree $(CFLOW_GEN).rtree $(CFLOW_GEN).rxref
+CLEAN_CFLOW += $(CFLOW_GEN).cflow $(CFLOW_GEN).xref $(CFLOW_GEN).tree $(CFLOW_GEN).rtree $(CFLOW_GEN).rxref
+$(CFLOW_GEN).cflow: $(CFLOW_SOURCES)
+	$(CFLOW_CMD) -o$@ $(CFLOW_FLAGS) $(CFLOW_SOURCES)
+$(CFLOW_GEN).rxref: $(CFLOW_SOURCES)
+	$(CFLOW_CMD) -o$@ $(CFLOW_FLAGS) -r --omit-arguments -x $(CFLOW_SOURCES)
+$(CFLOW_GEN).tree: $(SOURCES)
+	$(CFLOW_CMD) -o$@ $(CFLOW_FLAGS) --omit-arguments -T -b -x $(CFLOW_SOURCES)
+$(CFLOW_GEN).xref: $(SOURCES)
+	$(CFLOW_CMD) -o$@ $(CFLOW_FLAGS) --omit-arguments -x $(CFLOW_SOURCES)
+#$(CFLOW_GEN).rtree: $(SOURCES)
+#	$(CFLOW_CMD) -o$@ $(CFLOW_FLAGS) -r --omit-arguments -T -b $(CFLOW_SOURCES)
+cflow: $(CFLOW_GEN).cflow $(CFLOW_GEN).tree $(CFLOW_GEN).rxref $(CFLOW_GEN).xref
+#$(CFLOW_GEN).rtree
+endif
 
 $(SUBDIRS.cflow):
 	$(MAKE) -C $(@:.cflow=) cflow
@@ -255,7 +299,7 @@ $(LIB_STATIC): $(OBJECTS)
 clean: $(SUBDIRS.clean)
 	$(RM) $(OBJECTS) $(TARGETS) $(CLEAN_TARGETS) $(SOURCES:%.c=%.d) \
 	      $(SOURCES2:%.c=%.d) $(SOURCES:%.c=%.pot) $(SOURCES:%.c=%.gcno) \
-	      $(SOURCES:%.c=%.gcda) $(LDDEPS)
+	      $(SOURCES:%.c=%.gcda) $(LDDEPS) $(CLEAN_CFLOW)
 
 distclean: $(SUBDIRS.clean) $(SUBDIRS.distclean)
 	$(RM) -rf $(DISTCLEAN_DIRS)
@@ -269,6 +313,7 @@ distclean: $(SUBDIRS.clean) $(SUBDIRS.distclean)
 		 sed "s/^/		/;s/$$/;/" < $<; \
 		 echo "	local:"; echo "		*;"; echo "};") > $@
 
+ifneq ($(MAKECMDGOALS),cflow)
 ifneq ($(MAKECMDGOALS),clean)
   ifneq ($(MAKECMDGOALS),distclean)
     ifdef SOURCES
@@ -279,4 +324,4 @@ ifneq ($(MAKECMDGOALS),clean)
     endif
   endif
 endif
-
+endif
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 5106327..b3e5299 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -89,7 +89,6 @@ LIB_VERSION = $(LIB_VERSION_LVM)
 
 CLEAN_TARGETS = liblvm2cmd.$(LIB_SUFFIX) liblvm2cmd.a liblvm2cmd-static.a lvm lvm.o \
 		lvm2cmd.o lvm2cmd-static.o lvm2cmdlib.o lvm.static \
-		lvm.cflow lvm.xref lvm.tree lvm.rxref lvm.rtree \
 		lvmcmdlib.o lvm-static.o dmsetup.o $(TARGETS_DM)
 
 ifeq ("@CMDLIB@", "yes")
@@ -105,6 +104,11 @@ LVMLIBS += -ldevmapper
 
 DEFS += -DLVM_SHARED_PATH=\"$(exec_prefix)/sbin/lvm\"
 
+CFLOW_DIR = tools
+CFLOW_LIST = lvmcmdlib.c lvm2cmd.c
+CFLOW_TARGET = liblvm2cmd.cflow
+CFLOW_GEN = lvm
+
 include $(top_builddir)/make.tmpl
 
 LIBS += $(UDEV_LIBS)
@@ -147,20 +151,9 @@ liblvm2cmd.$(LIB_SUFFIX): liblvm2cmd.a $(LDDEPS)
 	install_tools_dynamic install_tools_static
 
 ifneq ("$(CFLOW_CMD)", "")
-CFLOW_FLAGS += --cpp="$(CC) -E"
-.PHONY: lvm.cflow
--include $(top_srcdir)/lib/liblvm-internal.cflow
-lvm.cflow: $(SOURCES)
-	$(CFLOW_CMD) -o$@ $(CFLOW_FLAGS) $(INCLUDES) $(DEFS) $(SOURCES)
-lvm.rxref: $(SOURCES)
-	$(CFLOW_CMD) -o$@ --cpp="$(CC) -E" -r --omit-arguments -x $(INCLUDES) $(DEFS) $(SOURCES)
-lvm.xref: $(SOURCES)
-	$(CFLOW_CMD) -o$@ --cpp="$(CC) -E" --omit-arguments -x $(INCLUDES) $(DEFS) $(SOURCES)
-lvm.rtree: $(SOURCES)
-	$(CFLOW_CMD) -o$@ --cpp="$(CC) -E" -r --omit-arguments -T -b $(INCLUDES) $(DEFS) $(SOURCES)
-lvm.tree: $(SOURCES)
-	$(CFLOW_CMD) -o$@ --cpp="$(CC) -E" --omit-arguments -T -b $(INCLUDES) $(DEFS) $(SOURCES)
-cflow: lvm.cflow lvm.xref lvm.tree lvm.rtree lvm.rxref
+CFLOW_SOURCES = $(addprefix $(top_srcdir)/tools/, $(SOURCES))
+-include $(top_builddir)/libdm/libdevmapper.cflow
+-include $(top_builddir)/lib/liblvm-internal.cflow
 endif
 
 install_cmdlib_dynamic: liblvm2cmd.$(LIB_SUFFIX)
-- 
1.7.0.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 0/6] Makefile updates
  2010-03-23 16:27 [PATCH 0/6] Makefile updates Zdenek Kabelac
                   ` (5 preceding siblings ...)
  2010-03-23 16:27 ` [PATCH 6/6] Update cflow Zdenek Kabelac
@ 2010-03-25 18:13 ` Alasdair G Kergon
  6 siblings, 0 replies; 8+ messages in thread
From: Alasdair G Kergon @ 2010-03-25 18:13 UTC (permalink / raw)
  To: lvm-devel

On Tue, Mar 23, 2010 at 05:27:33PM +0100, Zdenek Kabelac wrote:
> This patch set fixes few minor Makefile errors mostly
> around clean & distclean targets. Major topic is the update 
> of cflow rules.
 
Go for it - check them in.

It's a bit of a hack, but 'make distclean' attempts to clean up everything
regardless of what configuration options were used last time the
configure script was run: it has to try to clean up stuff that was
created by previous configure options.

Alasdair



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-03-25 18:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-23 16:27 [PATCH 0/6] Makefile updates Zdenek Kabelac
2010-03-23 16:27 ` [PATCH 1/6] Reuse clean target for distclean Zdenek Kabelac
2010-03-23 16:27 ` [PATCH 2/6] Query make.tmpl variable Zdenek Kabelac
2010-03-23 16:27 ` [PATCH 3/6] Fix cleanup of libdevmapper-event.a and dmeventd Zdenek Kabelac
2010-03-23 16:27 ` [PATCH 4/6] Fix run of cscope in $(builddir) Zdenek Kabelac
2010-03-23 16:27 ` [PATCH 5/6] Fix distclean error for subtargets Zdenek Kabelac
2010-03-23 16:27 ` [PATCH 6/6] Update cflow Zdenek Kabelac
2010-03-25 18:13 ` [PATCH 0/6] Makefile updates Alasdair G Kergon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.