summaryrefslogtreecommitdiff
path: root/src/devtools
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-05-02 21:47:28 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-05-02 21:47:28 -0400
commit1f33c065609cb061ce9b7bb9ac0d93d29fd210f1 (patch)
treea64b53214183442594cd891f4a25f32a987d9566 /src/devtools
parenteed537603fc5c80122753871276652b2c1d7065c (diff)
src/devtools/Makefile: edit lib/*.sh scripts
- makechrootpkg.sh: run through $(edit) to expand m4_include() - common.sh: add a header and footer to prevent multiple inclusion
Diffstat (limited to 'src/devtools')
-rw-r--r--src/devtools/Makefile35
1 files changed, 22 insertions, 13 deletions
diff --git a/src/devtools/Makefile b/src/devtools/Makefile
index 453f843..e357675 100644
--- a/src/devtools/Makefile
+++ b/src/devtools/Makefile
@@ -25,15 +25,15 @@ copy: \
find-libdeps.in \
finddeps.in \
lddd.in \
- lib/common.sh \
+ lib/common.sh.in \
lib/makechrootpkg.sh.in
-archroot.in: $(devtoolsdir)/mkarchroot.in ; cp $< $@
-checkpkg.in: $(devtoolsdir)/checkpkg.in ; cp $< $@
-find-libdeps.in: $(devtoolsdir)/find-libdeps.in ; cp $< $@
-finddeps.in: $(devtoolsdir)/finddeps.in ; cp $< $@
-lddd.in: $(devtoolsdir)/lddd.in ; cp $< $@
-lib/common.sh: $(devtoolsdir)/lib/common.sh ; cp $< $@
+archroot.in: $(devtoolsdir)/mkarchroot.in ; cp $< $@
+checkpkg.in: $(devtoolsdir)/checkpkg.in ; cp $< $@
+find-libdeps.in: $(devtoolsdir)/find-libdeps.in ; cp $< $@
+finddeps.in: $(devtoolsdir)/finddeps.in ; cp $< $@
+lddd.in: $(devtoolsdir)/lddd.in ; cp $< $@
+lib/common.sh.in: $(devtoolsdir)/lib/common.sh ; cp $< $@
lib/makechrootpkg.sh.in: $(devtoolsdir)/makechrootpkg.in ; cp $< $@
######################################################################
@@ -54,19 +54,28 @@ indent = emacs --batch $1 \
--eval '(indent-region (point-min) (point-max) nil)' \
-f save-buffer &>/dev/null
-M4GEN = @echo "M4GEN $2 ($1)"; $(edit) <"$1" >"$2"
-INDENT = @echo "INDENT $2 ($1)"; cp "$1" "$2"; $(call indent,$2)
-
%: %.in Makefile
- $(call M4GEN,$<,$@); chmod 755 "$@"
+ @echo "GEN $@"
+ @$(edit) <"$<" >"$@"
+ @chmod 755 "$@"
+
+lib/common.sh: %: %.in Makefile
+ @echo "GEN $@"
+ @{ \
+ echo 'if [[ -z $${_INCLUDE_COMMON_SH:-} ]]; then' && \
+ echo '_INCLUDE_COMMON_SH=true' && \
+ cat "$<" && \
+ echo 'fi'; } > "$@"
lib/makechrootpkg.sh.ugly: %.ugly: %.in %.patch Makefile
- @echo "PATCH $@"
+ @echo "GEN $@"
@cp $*.in $@
@patch $@ $*.patch
lib/makechrootpkg.sh: %: %.ugly Makefile
- $(call INDENT,$<,$@)
+ @echo "GEN $@"
+ @$(edit) <"$<" >"$@"
+ $(call indent,$@)
######################################################################