9144a0728ed94b2ebc5949d07e6492a671390d6e
[ghc.git] / docs / users_guide / ghc.mk
1 # -----------------------------------------------------------------------------
2 #
3 # (c) 2009 The University of Glasgow
4 #
5 # This file is part of the GHC build system.
6 #
7 # To understand how the build system works and how to modify it, see
8 # http://ghc.haskell.org/trac/ghc/wiki/Building/Architecture
9 # http://ghc.haskell.org/trac/ghc/wiki/Building/Modifying
10 #
11 # -----------------------------------------------------------------------------
12
13
14 docs/users_guide_RST_SOURCES := \
15 $(utils/mkUserGuidePart_GENERATED_RST_SOURCES) \
16 $(wildcard docs/users_guide/*.rst)
17
18 $(eval $(call sphinx,docs/users_guide,users_guide))
19
20 html_docs/users_guide : docs/users_guide/images/prof_scc.svg
21
22 # man page
23 docs/users_guide_MAN_RST_SOURCES := docs/users_guide/ghc.rst
24
25 MAN_SECTION := 1
26 MAN_PAGES := docs/users_guide/build-man/ghc.1
27
28 ifneq "$(BINDIST)" "YES"
29 $(MAN_PAGES): $(docs/users_guide_MAN_RST_SOURCES) $(utils/mkUserGuidePart_GENERATED_RST_SOURCES)
30 $(SPHINXBUILD) -b man -d docs/users_guide/.doctrees-man docs/users_guide docs/users_guide/build-man
31 endif
32
33 $(eval $(call clean-target,users-guide,manpage,docs/users_guide/.doctrees-man/ docs/users_guide/build-man/))
34
35 man : $(MAN_PAGES)
36
37 ifeq "$(BUILD_MAN)" "YES"
38 ifeq "$(phase)" "final"
39 $(eval $(call all-target,users_guide/man,$(MAN_PAGES)))
40 endif
41
42 INSTALL_MANPAGES += $(MAN_PAGES)
43
44 install: install_man
45
46 .PHONY: install_man
47 install_man: $(MAN_PAGES)
48 $(INSTALL_DIR) "$(DESTDIR)$(mandir)"
49 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man$(MAN_SECTION)"
50 $(INSTALL_MAN) $(INSTALL_OPTS) $(MAN_PAGES) "$(DESTDIR)$(mandir)/man$(MAN_SECTION)"
51
52 endif