summaryrefslogtreecommitdiff
path: root/src/devtools
diff options
context:
space:
mode:
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,$@)
######################################################################