1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# Copyright 2021-2024, Alejandro Colomar <alx@kernel.org>
# SPDX-License-Identifier: LGPL-3.0-only WITH LGPL-3.0-linking-exception
ifndef MAKEFILE_SRC_MAN_INCLUDED
MAKEFILE_SRC_MAN_INCLUDED := 1
include $(MAKEFILEDIR)/configure/build-depends/findutils/find.mk
include $(MAKEFILEDIR)/configure/build-depends/findutils/xargs.mk
include $(MAKEFILEDIR)/configure/build-depends/grep/grep.mk
include $(MAKEFILEDIR)/configure/build-depends/sed/sed.mk
include $(MAKEFILEDIR)/configure/directory_variables/src.mk
include $(MAKEFILEDIR)/src/sortman.mk
MANEXT := \(\.[[:digit:]]\([[:alpha:]][[:alnum:]]*\)\?\>\|\.man\)\+\(\.man\|\.in\)*$
MANPAGES := $(shell $(FIND) $(MANDIR)/* -type f \
| $(GREP) '$(MANEXT)' \
| $(SORTMAN) \
| $(SED) 's,:,\\:,g')
MANINTROPAGES := $(shell $(FIND) $(MANDIR)/* -type f \
| $(GREP) '$(MANEXT)' \
| $(GREP) '/intro$(MANEXT)' \
| $(SORTMAN) \
| $(SED) 's,:,\\:,g')
$(foreach s, $(MANSECTIONS), \
$(eval MAN$(s)PAGES := \
$(filter-out $(MANINTROPAGES), \
$(filter $(MAN$(s)DIR)/%, \
$(filter %.$(s), \
$(MANPAGES))))))
$(foreach s, $(MANSECTIONS), \
$(eval MAN$(s)INTROPAGE := \
$(filter $(MAN$(s)DIR)/%, \
$(filter %.$(s), \
$(MANINTROPAGES)))))
NONSO_MAN := $(shell $(FIND) $(MANDIR)/* -type f \
| $(GREP) '$(MANEXT)' \
| $(XARGS) $(GREP) -l '^\.TH ' \
| $(SORTMAN) \
| $(SED) 's,:,\\:,g')
NONSO_MDOC := $(shell $(FIND) $(MANDIR)/* -type f \
| $(GREP) '$(MANEXT)' \
| $(XARGS) $(GREP) -l '^\.Dt ' \
| $(SORTMAN) \
| $(SED) 's,:,\\:,g')
SO_MAN := $(filter-out $(NONSO_MAN) $(NONSO_MDOC), $(MANPAGES))
endif # include guard
|