summaryrefslogtreecommitdiff
path: root/docs/users_guide/ghc.mk
blob: af051227fc97648c9cd1030aed6de810cd8fa13b (plain)
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
# -----------------------------------------------------------------------------
#
# (c) 2009 The University of Glasgow
#
# This file is part of the GHC build system.
#
# To understand how the build system works and how to modify it, see
#      https://gitlab.haskell.org/ghc/ghc/wikis/building/architecture
#      https://gitlab.haskell.org/ghc/ghc/wikis/building/modifying
#
# -----------------------------------------------------------------------------


docs/users_guide_RST_SOURCES := $(wildcard docs/users_guide/*.rst)

$(eval $(call sphinx,docs/users_guide,users_guide))

html_docs/users_guide : docs/users_guide/images/prof_scc.svg

# man page
docs/users_guide_MAN_RST_SOURCES := docs/users_guide/ghc.rst

MAN_SECTION := 1
MAN_PAGES := docs/users_guide/build-man/ghc.1

ifneq "$(BINDIST)" "YES"
$(MAN_PAGES): $(docs/users_guide_MAN_RST_SOURCES)
	$(SPHINXBUILD) -b man -d docs/users_guide/.doctrees-man docs/users_guide docs/users_guide/build-man
endif

$(eval $(call clean-target,users-guide,manpage,docs/users_guide/.doctrees-man/ docs/users_guide/build-man/))

man : $(MAN_PAGES)

ifeq "$(BUILD_MAN)" "YES"
ifeq "$(phase)" "final"
$(eval $(call all-target,users_guide/man,$(MAN_PAGES)))
endif

INSTALL_MANPAGES += $(MAN_PAGES)

install: install_man

.PHONY: install_man
install_man: $(MAN_PAGES)
	$(INSTALL_DIR) "$(DESTDIR)$(mandir)"
	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man$(MAN_SECTION)"
	$(INSTALL_MAN) $(INSTALL_OPTS) $(MAN_PAGES) "$(DESTDIR)$(mandir)/man$(MAN_SECTION)"

endif