xfs
[Top] [All Lists]

Re: make install in the brave new build system world

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: make install in the brave new build system world
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Fri, 5 Feb 2010 22:48:56 +1100
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20100205112850.GB28701@xxxxxxxxxxxxx>
References: <20100205092229.GA32454@xxxxxxxxxxxxx> <20100205104414.GC11483@xxxxxxxxxxxxxxxx> <20100205112850.GB28701@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.18 (2008-05-17)
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@xxxxxxxxxxxxx


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@xxxxxxxxxxxxx>
---
 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:

<Prev in Thread] Current Thread [Next in Thread>