[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 08/11] build: don't hardcode repeated long paths in Makefile r
From: |
Gary V. Vaughan |
Subject: |
[PATCH v2 08/11] build: don't hardcode repeated long paths in Makefile rules. |
Date: |
Thu, 23 Sep 2010 22:21:25 +0700 |
The few remaining cases where I would have liked to use "$<", instead
of writing it out long-hand relative to the build tree more than
once, I've stored it in a shell variable and referenced that.
There are another couple of instances that don't show in this patch
where there was only a single "$<" required, in which case I just
typed the path out longhand as you suggested.
Okay to push?
* Makefile.am (libltdl/m4/ltversion.m4, libltdl/config/ltmain.sh):
Use sed to calculate input file names from "$@".
Signed-off-by: Gary V. Vaughan <address@hidden>
---
ChangeLog | 4 ++++
Makefile.am | 21 +++++++++++----------
2 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 85ac802..d923588 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2010-08-31 Gary V. Vaughan <address@hidden>
+ build: don't hardcode repeated long paths in Makefile rules.
+ * Makefile.am (libltdl/m4/ltversion.m4, libltdl/config/ltmain.sh):
+ Use sed to calculate input file names from "$@".
+
build: make better use of automatic variables in `Makefile.am'.
* Makefile.am (libtoolize, libtoolize.in, libltdl/Makefile.am)
(libltdl/config/mkstamp, libltdl/config/ltmain.m4sh)
diff --git a/Makefile.am b/Makefile.am
index 32b192c..90cd671 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -118,9 +118,10 @@ $(srcdir)/$(m4dir)/ltversion.m4: $(m4dir)/ltversion.in
configure.ac ChangeLog
done; \
if $$rebuild; then \
rm -f "address@hidden"; \
+ in=`echo "$@" | sed 's:\.m4$$:.in:'`; \
serial=`echo "$$revision" | sed 's,^1[.],,g'`; \
- echo "$(bootstrap_edit) $(srcdir)/$(m4dir)/ltversion.in > $@"; \
- $(bootstrap_edit) "$(srcdir)/$(m4dir)/ltversion.in" >
"address@hidden"; \
+ echo "$(bootstrap_edit) $$in > $@"; \
+ $(bootstrap_edit) "$$in" > "address@hidden"; \
chmod a-w "address@hidden"; \
mv -f "address@hidden" "$@"; \
fi
@@ -146,14 +147,14 @@ $(srcdir)/$(auxdir)/ltmain.sh: $(sh_files)
$(auxdir)/ltmain.m4sh configure.ac Ch
case $$prereq in *ChangeLog);; *) rebuild=:;; esac; \
done; \
if $$rebuild; then \
- rm -f "$(srcdir)/$(auxdir)/ltmain.in" "address@hidden" "$@"; \
- echo $(LT_M4SH) $(srcdir)/$(auxdir)/ltmain.m4sh \
- \> $(srcdir)/$(auxdir)/ltmain.in; \
- $(LT_M4SH) "$(srcdir)/$(auxdir)/ltmain.m4sh" \
- > "$(srcdir)/$(auxdir)/ltmain.in"; \
- echo "$(bootstrap_edit) $(srcdir)/$(auxdir)/ltmain.in > $@"; \
- $(bootstrap_edit) "$(srcdir)/$(auxdir)/ltmain.in" > "address@hidden";
\
- rm -f $(srcdir)/$(auxdir)/ltmain.in; \
+ in=`echo "$@" | sed 's:\.sh$$:.m4sh:'`; \
+ intermediate=`echo "$@" | sed 's:\.sh$$:.in'`; \
+ rm -f "$$intermediate" "address@hidden" "$@"; \
+ echo "$(LT_M4SH) $$in > $$intermediate"; \
+ $(LT_M4SH) "$$in" > "$$intermediate"; \
+ echo "$(bootstrap_edit) $$intermediate > $@"; \
+ $(bootstrap_edit) "$$intermediate" > "address@hidden"; \
+ rm -f "$$intermediate"; \
chmod a-w "address@hidden"; \
mv -f "address@hidden" "$@"; \
fi
--
1.7.3
- [PATCH v2 01/11] maint: rearrange Makefile.am in preparation for a follow-up patch., (continued)
- [PATCH v2 01/11] maint: rearrange Makefile.am in preparation for a follow-up patch., Gary V. Vaughan, 2010/09/23
- [PATCH v2 02/11] maint: don't leak developer GREP, SED etc into distribution file., Gary V. Vaughan, 2010/09/23
- [PATCH v2 03/11] build: compare `revision' rather than `correctver' in Makefile.am., Gary V. Vaughan, 2010/09/23
- [PATCH v2 04/11] build: avoid unnecessary directory changes in Makefile rules., Gary V. Vaughan, 2010/09/23
- [PATCH v2 05/11] build: factor Makefile.am `m4sh' invocations to LT_M4SH., Gary V. Vaughan, 2010/09/23
- [PATCH v2 06/11] build: name temporary files in `Makefile.am' consistently., Gary V. Vaughan, 2010/09/23
- [PATCH v2 09/11] build: eliminate `ltmain.in' intermediate file., Gary V. Vaughan, 2010/09/23
- [PATCH v2 08/11] build: don't hardcode repeated long paths in Makefile rules.,
Gary V. Vaughan <=
- [PATCH v2 10/11] build: eliminate superfluous temporary files from `Makefile.am'., Gary V. Vaughan, 2010/09/23
- [PATCH v2 11/11] maint: simplify and improve safety of bootstrap process., Gary V. Vaughan, 2010/09/23
- [PATCH v2 07/11] build: make better use of automatic variables in `Makefile.am'., Gary V. Vaughan, 2010/09/23