libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 04/11] build: avoid unnecessary directory changes in Makefile


From: Gary V. Vaughan
Subject: [PATCH v2 04/11] build: avoid unnecessary directory changes in Makefile rules.
Date: Thu, 23 Sep 2010 22:21:21 +0700

The vast majority of this patch gets thrown away further in the
series.  It's only really here to show separately how each of the
affected rules can be run perfectly well from the build tree... IIRC
I only wrote them this way originally as a short hand for retyping
all those long paths... but they are whittled away by the next few
patches anyway.

Okay to push?

* Makefile.am (libltdl/m4/ltversion.m4, libltdl/config/ltmain.m4sh)
(libtoolize.in, libltdl/Makefile.am, libltdl/config/mkstamp)
(tests/testsuite, tests/defs.in): Avoid unnecessary `cd' commands
by using fully qualified paths to files outside of current
directory.

Signed-off-by: Gary V. Vaughan <address@hidden>
---
 ChangeLog   |    7 +++++++
 Makefile.am |   53 +++++++++++++++++++++++------------------------------
 2 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a04ef73..20599a6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2010-08-31  Gary V. Vaughan  <address@hidden>
 
+       build: avoid unnecessary directory changes in Makefile rules.
+       * Makefile.am (libltdl/m4/ltversion.m4, libltdl/config/ltmain.m4sh)
+       (libtoolize.in, libltdl/Makefile.am, libltdl/config/mkstamp)
+       (tests/testsuite, tests/defs.in): Avoid unnecessary `cd' commands
+       by using fully qualified paths to files outside of current
+       directory.
+
        build: compare `revision' rather than `correctver' in Makefile.am.
        * Makefile.am (rebuild): Set the shell variable `revision' rather
        than `correctver' for clarity of purpose.
diff --git a/Makefile.am b/Makefile.am
index abfd208..64db1b9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -114,15 +114,14 @@ $(srcdir)/$(m4dir)/ltversion.m4: $(m4dir)/ltversion.in 
configure.ac ChangeLog
          case $$prereq in *ChangeLog | *configure.ac);; *) rebuild=:;; esac; \
        done; \
        if $$rebuild; then \
-         cd $(srcdir); \
-         rm -f $(m4dir)/ltversion.tmp; \
+         rm -f $(srcdir)/$(m4dir)/ltversion.tmp; \
          serial=`echo "$$revision" | sed 's,^1[.],,g'`; \
          echo $(bootstrap_edit) \
            $(srcdir)/$(m4dir)/ltversion.in \> $(srcdir)/$(m4dir)/ltversion.m4; 
\
          $(bootstrap_edit) \
-                 $(m4dir)/ltversion.in > $(m4dir)/ltversion.tmp; \
-         chmod a-w $(m4dir)/ltversion.tmp; \
-         mv -f $(m4dir)/ltversion.tmp $(m4dir)/ltversion.m4; \
+                 $(srcdir)/$(m4dir)/ltversion.in > 
$(srcdir)/$(m4dir)/ltversion.tmp; \
+         chmod a-w $(srcdir)/$(m4dir)/ltversion.tmp; \
+         mv -f $(srcdir)/$(m4dir)/ltversion.tmp 
$(srcdir)/$(m4dir)/ltversion.m4; \
        fi
 
 ## And for similar reasons, ltmain.sh can't be built from config.status.
@@ -146,33 +145,30 @@ $(srcdir)/$(auxdir)/ltmain.sh: $(sh_files) 
$(auxdir)/ltmain.m4sh configure.ac Ch
          case $$prereq in *ChangeLog);; *) rebuild=:;; esac; \
        done; \
        if $$rebuild; then \
-         cd $(srcdir); \
-         rm -f $(auxdir)/ltmain.in $(auxdir)/ltmain.tmp \
-           $(auxdir)/ltmain.sh; \
-         echo $(M4SH) -B $(auxdir) $(auxdir)/ltmain.m4sh \
-           \> $(auxdir)/ltmain.in; \
-         $(M4SH) -B $(auxdir) $(auxdir)/ltmain.m4sh \
-           > $(auxdir)/ltmain.in; \
+         rm -f $(srcdir)/$(auxdir)/ltmain.in $(srcdir)/$(auxdir)/ltmain.tmp \
+           $(srcdir)/$(auxdir)/ltmain.sh; \
+         echo $(M4SH) -B $(srcdir)/$(auxdir) $(srcdir)/$(auxdir)/ltmain.m4sh \
+           \> $(srcdir)/$(auxdir)/ltmain.in; \
+         $(M4SH) -B $(srcdir)/$(auxdir) $(srcdir)/$(auxdir)/ltmain.m4sh \
+           > $(srcdir)/$(auxdir)/ltmain.in; \
          echo $(bootstrap_edit) \
            $(srcdir)/$(auxdir)/ltmain.in "> $$target"; \
          $(bootstrap_edit) \
-               $(auxdir)/ltmain.in > $(auxdir)/ltmain.tmp; \
-         rm -f $(auxdir)/ltmain.in; \
-         chmod a-w $(auxdir)/ltmain.tmp; \
-         mv -f $(auxdir)/ltmain.tmp $(auxdir)/ltmain.sh; \
+               $(srcdir)/$(auxdir)/ltmain.in > $(srcdir)/$(auxdir)/ltmain.tmp; 
\
+         rm -f $(srcdir)/$(auxdir)/ltmain.in; \
+         chmod a-w $(srcdir)/$(auxdir)/ltmain.tmp; \
+         mv -f $(srcdir)/$(auxdir)/ltmain.tmp $(srcdir)/$(auxdir)/ltmain.sh; \
        fi
 
 # Use `$(srcdir)' for the benefit of non-GNU makes: this is
 # how libtoolize.in appears in our dependencies.
 EXTRA_DIST += libtoolize.m4sh
 $(srcdir)/libtoolize.in: $(sh_files) libtoolize.m4sh Makefile.am
-       cd $(srcdir); \
-       rm -f libtoolize.in; \
-       $(M4SH) -B $(auxdir) libtoolize.m4sh > libtoolize.in
+       rm -f $(srcdir)/libtoolize.in
+       $(M4SH) -B $(srcdir)/$(auxdir) $(srcdir)/libtoolize.m4sh > 
$(srcdir)/libtoolize.in
 
 $(srcdir)/libltdl/Makefile.am: $(srcdir)/libltdl/Makefile.inc
-       cd $(srcdir); \
-       in=libltdl/Makefile.inc; out=libltdl/Makefile.am; \
+       in=$(srcdir)/libltdl/Makefile.inc; out=$(srcdir)/libltdl/Makefile.am; \
        rm -f $$out; \
        ( $(SED) -n '1,/^.. DO NOT REMOVE THIS LINE -- /p' $$in; \
        { echo 'ACLOCAL_AMFLAGS = -I m4'; \
@@ -276,11 +272,10 @@ $(srcdir)/libltdl/Makefile.in: 
$(srcdir)/libltdl/Makefile.am \
        cd $(srcdir)/libltdl && $(AUTOMAKE) Makefile
 
 $(srcdir)/libltdl/stamp-mk: $(srcdir)/libltdl/Makefile.in
-       cd $(srcdir)/libltdl && \
        sed -e 's,config/mdate-sh,,' -e 's,config/texinfo.tex,,' \
            -e 's,config/mkinstalldirs,,' \
-           < Makefile.in > Makefile.inT && \
-       mv -f Makefile.inT Makefile.in
+           < $(srcdir)/libltdl/Makefile.in > $(srcdir)/libltdl/Makefile.inT && 
\
+       mv -f $(srcdir)/libltdl/Makefile.inT $(srcdir)/libltdl/Makefile.in
        echo stamp > $@
 
 sub_aclocal_m4_deps = \
@@ -541,9 +536,8 @@ INSTALLCHECK_ENVIRONMENT = \
 # Use `$(srcdir)' for the benefit of non-GNU makes: this is
 # how `testsuite' appears in our dependencies.
 $(srcdir)/$(TESTSUITE): $(srcdir)/tests/package.m4 $(TESTSUITE_AT) Makefile.am
-       cd $(srcdir)/tests && \
-       $(AUTOTEST) `echo $(TESTSUITE_AT) | sed 's,tests/,,g'` -o testsuite.tmp 
&& \
-       mv -f testsuite.tmp testsuite
+       $(AUTOTEST) -I $(srcdir)/tests $(TESTSUITE_AT) -o 
$(srcdir)/testsuite.tmp
+       mv -f $(srcdir)/testsuite.tmp $(srcdir)/testsuite
 
 $(srcdir)/tests/package.m4: $(srcdir)/configure.ac Makefile.am
        { \
@@ -905,9 +899,8 @@ tests/defs: $(srcdir)/tests/defs.in
 # Use `$(srcdir)/tests' for the benefit of non-GNU makes: this is
 # how defs.in appears in our dependencies.
 $(srcdir)/tests/defs.in: $(auxdir)/general.m4sh tests/defs.m4sh Makefile.am
-       cd $(srcdir); \
-       rm -f tests/defs.in; \
-       $(M4SH) -B $(auxdir) tests/defs.m4sh > tests/defs.in
+       rm -f $(srcdir)/tests/defs.in; \
+       $(M4SH) -B $(srcdir)/$(auxdir) $(srcdir)/tests/defs.m4sh > 
$(srcdir)/tests/defs.in
 
 # We need to remove any files that the above tests created.
 clean-local-legacy:
-- 
1.7.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]