diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 19:41:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 19:41:09 +0000 |
commit | 0db324e2e5d9d3347ea0e93138372fb65aac09e6 (patch) | |
tree | 1b794022fb98db123c73021e75286a82c116aa7f /share/mk/build/examples/src.mk | |
parent | Releasing progress-linux version 6.05.01-1~progress7.99u1. (diff) | |
download | manpages-0db324e2e5d9d3347ea0e93138372fb65aac09e6.tar.xz manpages-0db324e2e5d9d3347ea0e93138372fb65aac09e6.zip |
Merging upstream version 6.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'share/mk/build/examples/src.mk')
-rw-r--r-- | share/mk/build/examples/src.mk | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/share/mk/build/examples/src.mk b/share/mk/build/examples/src.mk new file mode 100644 index 0000000..f47a713 --- /dev/null +++ b/share/mk/build/examples/src.mk @@ -0,0 +1,55 @@ +# Copyright 2021-2024, Alejandro Colomar <alx@kernel.org> +# SPDX-License-Identifier: LGPL-3.0-only WITH LGPL-3.0-linking-exception + + +ifndef MAKEFILE_BUILD_EX_SRC_INCLUDED +MAKEFILE_BUILD_EX_SRC_INCLUDED := 1 + + +include $(MAKEFILEDIR)/build/_.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/mandoc.mk +include $(MAKEFILEDIR)/configure/build-depends/sed.mk +include $(MAKEFILEDIR)/configure/directory_variables.mk +include $(MAKEFILEDIR)/src.mk + + +_UNITS_ex_src := \ + $(patsubst $(MANDIR)/%, $(_MANDIR)/%, \ + $(shell \ + $(FIND) $(MANDIR)/* -type f \ + | $(GREP) '$(MANEXT)' \ + | $(XARGS) $(GREP) -H '^\.\\" SRC BEGIN ' \ + | $(SED) 's,:\.\\" SRC BEGIN (,.d/,' \ + | $(SED) 's/)//' \ + | $(SORTMAN) \ + | $(SED) 's,:,\\:,g' \ + ) \ + ) +_UNITS_ex_h := $(filter %.h,$(_UNITS_ex_src)) +_UNITS_ex_c := $(filter %.c,$(_UNITS_ex_src)) + + +$(_UNITS_ex_src): $$(patsubst $(_MANDIR)/%.d,$(MANDIR)/%,$$(@D)) $(MK) | $$(@D)/ +$(_UNITS_ex_c): $$(filter $$(@D)/%.h,$(_UNITS_ex_h)) +$(_UNITS_ex_src): + $(info $(INFO_)SED $@) + <$< \ + $(SED) -n \ + -e '/^\.TH/,/^\.SH/{/^\.SH/!p}' \ + -e '/^\.SH EXAMPLES/p' \ + -e "/^\... SRC BEGIN ($(@F))$$/,/^\... SRC END$$/p" \ + | $(MANDOC) -Tutf8 \ + | $(HEAD) -n-2 \ + | $(SED) '/^[^ ]/d' \ + | $(SED) 's/^ //' \ + >$@ + + +.PHONY: build-ex-src +build-ex-src: $(_UNITS_ex_src); + + +endif # include guard |