public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs@oss.sgi.com
Subject: Re: make install in the brave new build system world
Date: Fri, 5 Feb 2010 22:48:56 +1100	[thread overview]
Message-ID: <20100205114856.GE11483@discord.disaster> (raw)
In-Reply-To: <20100205112850.GB28701@infradead.org>

On Fri, Feb 05, 2010 at 06:28:50AM -0500, Christoph Hellwig wrote:
> On Fri, Feb 05, 2010 at 09:44:14PM +1100, Dave Chinner wrote:
> > The dependencies are always regenerated due to the default target
> > requiring the depend target. Rebuilding the dependencies is the only
> > way to catch changes between builds and so ensure the correct files
> > are rebuilt.
> > 
> > The install target is building the dependencies because it has a
> > dependency on the default target.
> 
> Well, it's building the dependecies twice - once by invoking the
> default target, but they are also rebuilt again when the actuall
> install rules are called.   The latter is pretty clearly superflous.

Ah, there's a double depenency chain.

The top level make file has:

install: default

Which causes "make install" to run the top level default target,
which runs the default target in all the target subdirs.

Then, in each subdir, the makefile has:

install: default

Which when then install target is actually run, does another
dependency check because it's got a local dependency on the depend
target via the default target.

Replace the previous patch with the one below and try again.
Now the "make install" will rebuild targets out of the local
dependencies rather than a separate run of the top level default
target (i.e. only traverse directories once).

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com


xfsprogs: clean up make install build V2

The install targets did not get the silent treatment like the
normal build targets. Shut them up.

Also, remove the top level install target dependency on the default
target. Each sub-directory already defines the correct dependencies
for the install targets and so all the rebuilds can be done in one
traversal of the subdirectories via the install rules.

Signed-off-by: Dave Chinner <david@fromorbit.com>
---
 Makefile           |   13 ++++++++-----
 include/buildrules |    4 ----
 man/Makefile       |    4 ++--
 mdrestore/Makefile |    2 +-
 4 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/Makefile b/Makefile
index 62c4258..1905261 100644
--- a/Makefile
+++ b/Makefile
@@ -98,22 +98,25 @@ include/platform_defs.h: include/builddefs
 		$(MAKE) $(MAKEOPTS) $(AM_MAKEFLAGS) include/builddefs; \
 	fi
 
-install: default $(addsuffix -install,$(SUBDIRS))
+install: $(addsuffix -install,$(SUBDIRS))
 	$(INSTALL) -m 755 -d $(PKG_DOC_DIR)
 	$(INSTALL) -m 644 README $(PKG_DOC_DIR)
 
-install-dev: default $(addsuffix -install-dev,$(SUBDIRS))
+install-dev: $(addsuffix -install-dev,$(SUBDIRS))
 
 install-qa: install $(addsuffix -install-qa,$(SUBDIRS))
 
 %-install:
-	$(MAKE) -C $* install
+	@echo "Installing $@"
+	$(Q)$(MAKE) $(MAKEOPTS) -C $* install
 
 %-install-dev:
-	$(MAKE) -C $* install-dev
+	@echo "Installing $@"
+	$(Q)$(MAKE) $(MAKEOPTS) -C $* install-dev
 
 %-install-qa:
-	$(MAKE) -C $* install-qa
+	@echo "Installing $@"
+	$(Q)$(MAKE) $(MAKEOPTS) -C $* install-qa
 
 distclean: clean
 	$(Q)rm -f $(DISTDIRT)
diff --git a/include/buildrules b/include/buildrules
index 1695e23..beb469b 100644
--- a/include/buildrules
+++ b/include/buildrules
@@ -101,7 +101,3 @@ ltdepend: $(CFILES) $(HFILES)
 depend: $(CFILES) $(HFILES)
 	@echo "    [DEP]"
 	$(Q)$(MAKEDEP) $(CFILES) > .dep
-
-
-#	$(Q)$(MAKEDEP) $(CFILES) | $(SED) -e 's,^\([^:]*\)\.o,\1,' > .dep
-
diff --git a/man/Makefile b/man/Makefile
index 2b5e89c..863284c 100644
--- a/man/Makefile
+++ b/man/Makefile
@@ -14,9 +14,9 @@ install : $(addsuffix -install,$(SUBDIRS))
 install-dev : $(addsuffix -install-dev,$(SUBDIRS))
 
 %-install:
-	$(MAKE) -C $* install
+	$(Q)$(MAKE) $(MAKEOPTS) -C $* install
 
 %-install-dev:
-	$(MAKE) -C $* install-dev
+	$(Q)$(MAKE) $(MAKEOPTS) -C $* install-dev
 
 include $(BUILDRULES)
diff --git a/mdrestore/Makefile b/mdrestore/Makefile
index fd35d80..ca2d1a0 100644
--- a/mdrestore/Makefile
+++ b/mdrestore/Makefile
@@ -16,7 +16,7 @@ default: depend $(LTCOMMAND)
 
 include $(BUILDRULES)
 
-install:
+install: default
 	$(INSTALL) -m 755 -d $(PKG_SBIN_DIR)
 	$(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_SBIN_DIR)
 install-dev:

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2010-02-05 11:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-05  9:22 make install in the brave new build system world Christoph Hellwig
2010-02-05 10:44 ` Dave Chinner
2010-02-05 11:17   ` Dave Chinner
2010-02-05 11:27     ` Christoph Hellwig
2010-02-05 11:28   ` Christoph Hellwig
2010-02-05 11:48     ` Dave Chinner [this message]
2010-02-08 10:29       ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100205114856.GE11483@discord.disaster \
    --to=david@fromorbit.com \
    --cc=hch@infradead.org \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox