1 ########################################################################
2 # Copyright (C) 2021, 2022 Alejandro Colomar <alx.manpages@gmail.com>
3 # SPDX-License-Identifier: GPL-2.0 OR LGPL-2.0
4 ########################################################################
7 ifndef MAKEFILE_BUILD_HTML_INCLUDED
8 MAKEFILE_BUILD_HTML_INCLUDED
:= 1
11 include $(srcdir)/lib
/build.mk
12 include $(srcdir)/lib
/cmd.mk
13 include $(srcdir)/lib
/src.mk
17 _HTMLDIR
:= $(builddir
)/html
20 DEFAULT_MAN2HTMLFLAGS
:=
21 EXTRA_MAN2HTMLFLAGS
:=
22 MAN2HTMLFLAGS
:= $(DEFAULT_MAN2HTMLFLAGS
) $(EXTRA_MAN2HTMLFLAGS
)
26 _HTMLPAGES
:= $(patsubst $(MANDIR
)/%,$(_HTMLDIR
)/%.html
,$(MANPAGES
))
27 _HTMLDIRS
:= $(patsubst $(MANDIR
)/%,$(_HTMLDIR
)/%/.
,$(MANDIRS
))
31 # make MAN2HTMLFLAGS=whatever html
32 # The sed removes the lines "Content-type: text/html\n\n"
33 $(_HTMLPAGES
): $(_HTMLDIR
)/%.html
: $(MANDIR
)/% |
$$(@D
)/.
35 $(MAN2HTML
) $(MAN2HTMLFLAGS
) $< \
38 $(_HTMLDIRS
): %/.
: |
$$(dir %).
$(_HTMLDIR
)/.
41 .PHONY
: build-html html
42 build-html html
: $(_HTMLPAGES
) | builddirs-html
45 .PHONY
: builddirs-html
46 builddirs-html
: $(_HTMLDIRS
)
50 endif # MAKEFILE_BUILD_HTML_INCLUDED