9334784c6d07134168bcd5f5eaa857522a009045
[ghc-hetmet.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://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
9 #      http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
10 #
11 # -----------------------------------------------------------------------------
12
13 docs/users_guide_GENERATED_DOCBOOK_SOURCES := \
14         docs/users_guide/what_glasgow_exts_does.gen.xml
15
16 # sort remove duplicates
17 docs/users_guide_DOCBOOK_SOURCES :=                           \
18     $(sort $(docs/users_guide_GENERATED_DOCBOOK_SOURCES)      \
19            $(wildcard docs/users_guide/*.xml)                 \
20            $(basename $(wildcard docs/users_guide/*.xml.in)))
21
22 $(docs/users_guide_GENERATED_DOCBOOK_SOURCES): %.gen.xml: inplace/bin/mkUserGuidePart
23         inplace/bin/mkUserGuidePart $@
24
25 $(eval $(call docbook,docs/users_guide,users_guide))
26
27 # Hack: dblatex normalises the name of the input file using
28 # os.path.realpath, which means that if we're in a linked build tree,
29 # it won't be able to find ug-book.xml which is in the build tree but
30 # not in the source tree.  Hence, we copy ug-book.xml to the source
31 # tree.  This is a horrible hack, but I can't find a better way to do
32 # it --SDM (2009-05-11)
33
34 build_ug_book = docs/users_guide/ug-book.xml
35 src_ug_book  = $(dir $(realpath $(dir $(build_ug_book))/ug-book.xml.in))ug-book.xml
36
37 # ... and similarly for ug-ent.xml, which is now generated by configure from
38 # ug-ent.xml.in --SDM (2010-02-25)
39
40 build_ug_ent = docs/users_guide/ug-ent.xml
41 src_ug_ent  = $(dir $(realpath $(dir $(build_ug_ent))/ug-ent.xml.in))ug-ent.xml
42
43 html_docs/users_guide : docs/users_guide/users_guide/prof_scc.png
44
45 docs/users_guide/users_guide/prof_scc.png : \
46                 docs/users_guide/prof_scc.png \
47                 docs/users_guide/users_guide/index.html
48         $(CP) $< $@
49 # dep. on d/u/u/index.html is to make sure that the d/u/u dir is created first
50
51 ifneq "$(build_ug_book)" "$(src_ug_book)"
52 $(src_ug_book) : $(build_ug_book)
53         "$(CP)" $< $@
54 ifneq "$(BINDIST)" "YES"
55 docs/users_guide/users_guide.pdf docs/users_guide/users_guide.ps: $(src_ug_book)
56 endif
57 endif
58
59 ifneq "$(build_ug_ent)" "$(src_ug_ent)"
60 $(src_ug_ent) : $(build_ug_ent)
61         "$(CP)" $< $@
62 ifneq "$(BINDIST)" "YES"
63 docs/users_guide/users_guide.pdf docs/users_guide/users_guide.ps: $(src_ug_ent)
64 endif
65 endif
66