summaryrefslogtreecommitdiffstats
path: root/share/mk/install
diff options
context:
space:
mode:
Diffstat (limited to 'share/mk/install')
-rw-r--r--share/mk/install/_.mk3
-rw-r--r--share/mk/install/html.mk8
-rw-r--r--share/mk/install/man.mk64
-rw-r--r--share/mk/install/pdf/_.mk16
-rw-r--r--share/mk/install/pdf/book.mk33
5 files changed, 77 insertions, 47 deletions
diff --git a/share/mk/install/_.mk b/share/mk/install/_.mk
index bb39de3..e4a0f3e 100644
--- a/share/mk/install/_.mk
+++ b/share/mk/install/_.mk
@@ -6,7 +6,8 @@ ifndef MAKEFILE_INSTALL_INCLUDED
MAKEFILE_INSTALL_INCLUDED := 1
-include $(MAKEFILEDIR)/configure/build-depends/coreutils.mk
+include $(MAKEFILEDIR)/configure/build-depends/coreutils/install.mk
+include $(MAKEFILEDIR)/configure/build-depends/coreutils/rm.mk
%/:
diff --git a/share/mk/install/html.mk b/share/mk/install/html.mk
index 047df90..f29220c 100644
--- a/share/mk/install/html.mk
+++ b/share/mk/install/html.mk
@@ -8,16 +8,16 @@ MAKEFILE_INSTALL_HTML_INCLUDED := 1
include $(MAKEFILEDIR)/build/_.mk
include $(MAKEFILEDIR)/build/html/post-grohtml.mk
-include $(MAKEFILEDIR)/configure/build-depends/coreutils.mk
-include $(MAKEFILEDIR)/configure/directory_variables.mk
+include $(MAKEFILEDIR)/configure/build-depends/coreutils/install.mk
+include $(MAKEFILEDIR)/configure/directory_variables/install.mk
include $(MAKEFILEDIR)/install/_.mk
_htmldir := $(DESTDIR)$(htmldir)
-_htmlpages := $(patsubst $(_MANDIR)/%,$(_htmldir)/%,$(_HTMLMAN))
-_htmlpages_rm := $(addsuffix -rm,$(wildcard $(_htmlpages)))
+_htmlpages := $(patsubst $(_MANDIR)/%,$(_htmldir)/%,$(_HTMLMAN))
+_htmlpages_rm := $(addsuffix -rm,$(wildcard $(_htmlpages)))
$(_htmlpages): $(_htmldir)/%: $(_MANDIR)/% $(MK) | $$(@D)/
diff --git a/share/mk/install/man.mk b/share/mk/install/man.mk
index 65c1ea5..e22276b 100644
--- a/share/mk/install/man.mk
+++ b/share/mk/install/man.mk
@@ -6,19 +6,19 @@ ifndef MAKEFILE_INSTALL_MAN_INCLUDED
MAKEFILE_INSTALL_MAN_INCLUDED := 1
-include $(MAKEFILEDIR)/configure/build-depends/bzip2.mk
-include $(MAKEFILEDIR)/configure/build-depends/coreutils.mk
-include $(MAKEFILEDIR)/configure/build-depends/findutils.mk
-include $(MAKEFILEDIR)/configure/build-depends/grep.mk
-include $(MAKEFILEDIR)/configure/build-depends/gzip.mk
-include $(MAKEFILEDIR)/configure/build-depends/lzip.mk
-include $(MAKEFILEDIR)/configure/build-depends/moreutils.mk
-include $(MAKEFILEDIR)/configure/build-depends/sed.mk
-include $(MAKEFILEDIR)/configure/build-depends/xz-utils.mk
-include $(MAKEFILEDIR)/configure/directory_variables.mk
-include $(MAKEFILEDIR)/configure/z.mk
+include $(MAKEFILEDIR)/configure/build-depends/coreutils/cat.mk
+include $(MAKEFILEDIR)/configure/build-depends/coreutils/install.mk
+include $(MAKEFILEDIR)/configure/build-depends/coreutils/ln.mk
+include $(MAKEFILEDIR)/configure/build-depends/coreutils/test.mk
+include $(MAKEFILEDIR)/configure/build-depends/findutils/xargs.mk
+include $(MAKEFILEDIR)/configure/build-depends/grep/grep.mk
+include $(MAKEFILEDIR)/configure/build-depends/moreutils/sponge.mk
+include $(MAKEFILEDIR)/configure/build-depends/sed/sed.mk
+include $(MAKEFILEDIR)/configure/directory_variables/install.mk
+include $(MAKEFILEDIR)/configure/directory_variables/src.mk
+include $(MAKEFILEDIR)/configure/man/link_pages.mk
include $(MAKEFILEDIR)/install/_.mk
-include $(MAKEFILEDIR)/src.mk
+include $(MAKEFILEDIR)/src/man.mk
_mandir := $(DESTDIR)$(mandir)
@@ -27,11 +27,11 @@ $(foreach s, $(MANSECTIONS), \
$(foreach s, $(MANSECTIONS), \
$(eval _man$(s)pages := \
- $(patsubst $(MAN$(s)DIR)/%.$(s), $(_man$(s)dir)/%$(man$(s)ext)$(Z), \
+ $(patsubst $(MAN$(s)DIR)/%.$(s), $(_man$(s)dir)/%$(man$(s)ext), \
$(MAN$(s)PAGES))))
$(foreach s, $(MANSECTIONS), \
$(eval _man$(s)intropage := \
- $(patsubst $(MAN$(s)DIR)/%.$(s), $(_man$(s)dir)/%$(man$(s)ext)$(Z), \
+ $(patsubst $(MAN$(s)DIR)/%.$(s), $(_man$(s)dir)/%$(man$(s)ext), \
$(MAN$(s)INTROPAGE))))
_manintropages := $(foreach s, $(MANSECTIONS), $(_man$(s)intropage))
_manpages := $(_manintropages) $(foreach s, $(MANSECTIONS), $(_man$(s)pages))
@@ -45,44 +45,24 @@ $(foreach s, $(MANSECTIONS), \
$(foreach s, $(MANSECTIONS), \
$(eval $(_man$(s)pages) $(_man$(s)intropage): \
- $(_man$(s)dir)/%$(man$(s)ext)$(Z): \
- $(MAN$(s)DIR)/%.$(s) $(MK) | $$$$(@D)/))
+ $(_man$(s)dir)/%$(man$(s)ext): \
+ $(_MANDIR)/man$(s)/%.$(s) $(MK) | $$$$(@D)/))
$(_manpages):
$(info $(INFO_)INSTALL $@)
- <$< \
- $(SED) $(foreach s, $(MANSECTIONS), \
- -e '/^\.so /s, man$(s)/\(.*\)\.$(s)$$, $(notdir $(man$(s)dir))/\1$(man$(s)ext)$(Z),') \
- | $(INSTALL_DATA) -T /dev/stdin $@
+ $(INSTALL_DATA) -T $< $@
+ $(SED) -i $(foreach s, $(MANSECTIONS), \
+ -e '/^\.so /s, man$(s)/\(.*\)\.$(s)$$, $(notdir $(man$(s)dir))/\1$(man$(s)ext),') \
+ $@
ifeq ($(LINK_PAGES),symlink)
- if $(GREP) '^\.so ' <$@ >/dev/null; then \
+ $(CAT) <$@ \
+ | if $(GREP) '^\.so ' >/dev/null; then \
$(GREP) '^\.so ' <$@ \
| $(SED) 's,^\.so \(.*\),../\1,' \
| $(XARGS) -I tgt $(LN) -fsT tgt $@; \
fi
endif
-ifeq ($(Z),.bz2)
- if ! $(TEST) -L $@; then \
- $(BZIP2) $(BZIP2FLAGS) <$@ \
- | $(SPONGE) $@; \
- fi
-else ifeq ($(Z),.gz)
- if ! $(TEST) -L $@; then \
- $(GZIP) $(GZIPFLAGS) <$@ \
- | $(SPONGE) $@; \
- fi
-else ifeq ($(Z),.lz)
- if ! $(TEST) -L $@; then \
- $(LZIP) $(LZIPFLAGS) <$@ \
- | $(SPONGE) $@; \
- fi
-else ifeq ($(Z),.xz)
- if ! $(TEST) -L $@; then \
- $(XZ) $(XZFLAGS) <$@ \
- | $(SPONGE) $@; \
- fi
-endif
.PHONY: install-manintro
diff --git a/share/mk/install/pdf/_.mk b/share/mk/install/pdf/_.mk
new file mode 100644
index 0000000..2559257
--- /dev/null
+++ b/share/mk/install/pdf/_.mk
@@ -0,0 +1,16 @@
+# Copyright 2021-2024, Alejandro Colomar <alx@kernel.org>
+# SPDX-License-Identifier: LGPL-3.0-only WITH LGPL-3.0-linking-exception
+
+
+ifndef MAKEFILE_INSTALL_PDF_INCLUDED
+MAKEFILE_INSTALL_PDF_INCLUDED := 1
+
+
+.PHONY: install-pdf
+install-pdf: install-pdf-book;
+
+.PHONY: uninstall-pdf
+uninstall-pdf: uninstall-pdf-book;
+
+
+endif # include guard
diff --git a/share/mk/install/pdf/book.mk b/share/mk/install/pdf/book.mk
new file mode 100644
index 0000000..083bce2
--- /dev/null
+++ b/share/mk/install/pdf/book.mk
@@ -0,0 +1,33 @@
+# Copyright 2021-2024, Alejandro Colomar <alx@kernel.org>
+# SPDX-License-Identifier: LGPL-3.0-only WITH LGPL-3.0-linking-exception
+
+
+ifndef MAKEFILE_INSTALL_PDF_BOOK_INCLUDED
+MAKEFILE_INSTALL_PDF_BOOK_INCLUDED := 1
+
+
+include $(MAKEFILEDIR)/build/pdf/book/_.mk
+include $(MAKEFILEDIR)/configure/build-depends/coreutils/install.mk
+include $(MAKEFILEDIR)/configure/directory_variables/install.mk
+
+
+_pdfdir := $(DESTDIR)$(pdfdir)
+
+
+_pdf_book := $(patsubst $(_PDFDIR)/%,$(_pdfdir)/%,$(_PDF_BOOK))
+_pdf_book_rm := $(addsuffix -rm,$(wildcard $(_pdf_book)))
+
+
+$(_pdf_book): $(_pdfdir)/%: $(_PDFDIR)/% $(MK) | $$(@D)/
+ $(info $(INFO_)INSTALL $@)
+ $(INSTALL_DATA) -T $< $@
+
+
+.PHONY: install-pdf-book
+install-pdf-book: $(_pdf_book);
+
+.PHONY: uninstall-pdf-book
+uninstall-pdf-book: $(_pdf_book_rm);
+
+
+endif # include guard