summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-05-09 12:36:02 (EDT)
committer P. J. McDermott <pjm@nac.net>2013-05-09 12:36:02 (EDT)
commit91857c37f07f1c2f7653d74bf6f9c825dc18b4d2 (patch)
tree92bfce8e72c7766ecf2694f3df97a58e8aefb2ee
parent437a672d718a2a7a238f41f623ff6f656f2b1df1 (diff)
Makefile.in: Move common commands into macros.
-rw-r--r--Makefile.in105
1 files changed, 37 insertions, 68 deletions
diff --git a/Makefile.in b/Makefile.in
index 94f90cb..0618b58 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -123,70 +123,47 @@ all-data: all-man1 all-locale
all-man1: $(man1)
all-locale: $(locale)
-clean: clean-exec clean-data
-clean-exec: clean-bin clean-pkglib clean-pkglibbuildsystem
-clean-bin:
- @set -e; for f in $(bin); do \
+clean_cmds = \
+ set -e; \
+ for f in $${files}; do \
printf ' RM %s\n' "$${f}"; \
rm -f "$${f}"; \
done
+clean: clean-exec clean-data
+clean-exec: clean-bin clean-pkglib clean-pkglibbuildsystem
+clean-bin:
+ @files='$(bin)'; $(clean_cmds)
clean-pkglib:
- @set -e; for f in $(pkglib); do \
- printf ' RM %s\n' "$${f}"; \
- rm -f "$${f}"; \
- done
+ @files='$(pkglib)'; $(clean_cmds)
clean-pkglibbuildsystem:
- @set -e; for f in $(pkglibbuildsystem); do \
- printf ' RM %s\n' "$${f}"; \
- rm -f "$${f}"; \
- done
+ @files='$(pkglibbuildsystem)'; $(clean_cmds)
clean-data: clean-man1 clean-locale
clean-man1:
- @set -e; for f in $(man1); do \
- printf ' RM %s\n' "$${f}"; \
- rm -f "$${f}"; \
- done
+ @files='$(man1)'; $(clean_cmds)
clean-locale:
- @set -e; for f in $(locale); do \
- printf ' RM %s\n' "$${f}"; \
- rm -f "$${f}"; \
- done
+ @files='$(locale)'; $(clean_cmds)
-install: all install-exec install-data
-install-exec: install-bin install-pkglib install-pkglibbuildsystem
-install-bin:
- @mkdir -p '$(DESTDIR)/$(bindir)'
- @set -e; for f in $(bin); do \
+install_cmds = \
+ set -e; \
+ mkdir -p "$(DESTDIR)/$${dir}"; \
+ for f in $${files}; do \
printf ' INSTALL %s\n' "$${f}"; \
ff="$$(basename "$${f}")"; \
- cp "$${f}" "$(DESTDIR)/$(bindir)/$${ff}"; \
- chmod 755 "$(DESTDIR)/$(bindir)/$${ff}"; \
+ cp "$${f}" "$(DESTDIR)/$${dir}/$${ff}"; \
+ chmod "$${mode}" "$(DESTDIR)/$${dir}/$${ff}"; \
done
+install: all install-exec install-data
+install-exec: install-bin install-pkglib install-pkglibbuildsystem
+install-bin:
+ @files='$(bin)'; dir='$(bindir)'; mode='755'; $(install_cmds)
install-pkglib:
- @mkdir -p '$(DESTDIR)/$(pkglibdir)'
- @set -e; for f in $(pkglib); do \
- printf ' INSTALL %s\n' "$${f}"; \
- ff="$$(basename "$${f}")"; \
- cp "$${f}" "$(DESTDIR)/$(pkglibdir)/$${ff}"; \
- chmod 644 "$(DESTDIR)/$(pkglibdir)/$${ff}"; \
- done
+ @files='$(pkglib)'; dir='$(pkglibdir)'; mode='644'; $(install_cmds)
install-pkglibbuildsystem:
- @mkdir -p '$(DESTDIR)/$(pkglibbuildsystemdir)'
- @set -e; for f in $(pkglibbuildsystem); do \
- printf ' INSTALL %s\n' "$${f}"; \
- ff="$$(basename "$${f}")"; \
- cp "$${f}" "$(DESTDIR)/$(pkglibbuildsystemdir)/$${ff}"; \
- chmod 644 "$(DESTDIR)/$(pkglibbuildsystemdir)/$${ff}"; \
- done
+ @files='$(pkglibbuildsystem)'; dir='$(pkglibbuildsystemdir)'; \
+ mode='644'; $(install_cmds)
install-data: install-man1 install-locale
install-man1:
- @mkdir -p '$(DESTDIR)/$(man1dir)'
- @set -e; for f in $(man1); do \
- printf ' INSTALL %s\n' "$${f}"; \
- ff="$$(basename "$${f}")"; \
- cp "$${f}" "$(DESTDIR)/$(man1dir)/$${ff}"; \
- chmod 644 "$(DESTDIR)/$(man1dir)/$${ff}"; \
- done
+ @files='$(man1)'; dir='$(man1dir)'; mode='644'; $(install_cmds)
install-locale:
@mkdir -p '$(DESTDIR)/$(localedir)'
@set -e; for f in $(locale); do \
@@ -198,35 +175,27 @@ install-locale:
chmod 644 "$(DESTDIR)/$(localedir)/$${ff}"; \
done
-uninstall: uninstall-exec uninstall-data
-uninstall-exec: uninstall-bin uninstall-pkglibbuildsystem uninstall-pkglib
-uninstall-bin:
- @set -e; for f in $(bin); do \
+uninstall_cmds = \
+ set -e; \
+ for f in $${files}; do \
printf ' RM %s\n' "$${f}"; \
ff="$$(basename "$${f}")"; \
- rm -f "$(DESTDIR)/$(bindir)/$${ff}"; \
+ rm -f "$(DESTDIR)/$${dir}/$${ff}"; \
done
+uninstall: uninstall-exec uninstall-data
+uninstall-exec: uninstall-bin uninstall-pkglibbuildsystem uninstall-pkglib
+uninstall-bin:
+ @files='$(bin)'; dir='$(bindir)'; $(uninstall_cmds)
uninstall-pkglib:
- @set -e; for f in $(pkglib); do \
- printf ' RM %s\n' "$${f}"; \
- ff="$$(basename "$${f}")"; \
- rm -f "$(DESTDIR)/$(pkglibdir)/$${ff}"; \
- done
+ @files='$(pkglib)'; dir='$(pkglibdir)'; $(uninstall_cmds)
@rmdir '$(DESTDIR)/$(pkglibdir)'
uninstall-pkglibbuildsystem:
- @set -e; for f in $(pkglibbuildsystem); do \
- printf ' RM %s\n' "$${f}"; \
- ff="$$(basename "$${f}")"; \
- rm -f "$(DESTDIR)/$(pkglibbuildsystemdir)/$${ff}"; \
- done
+ @files='$(pkglibbuildsystem)'; dir='$(pkglibbuildsystemdir)'; \
+ $(uninstall_cmds)
@rmdir '$(DESTDIR)/$(pkglibbuildsystemdir)'
uninstall-data: uninstall-man1 uninstall-locale
uninstall-man1:
- @set -e; for f in $(man1); do \
- printf ' RM %s\n' "$${f}"; \
- ff="$$(basename "$${f}")"; \
- rm -f "$(DESTDIR)/$(man1dir)/$${ff}"; \
- done
+ @files='$(man1)'; dir='$(man1dir)'; $(uninstall_cmds)
uninstall-locale:
@set -e; for f in $(locale); do \
printf ' RM %s\n' "$${f}"; \