hack to make the docs build again in a lndir build tree (see comments)
[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_DOCBOOK_SOURCES := \
14     $(wildcard docs/users_guide/*.xml) \
15     $(basename $(wildcard docs/users_guide/*.xml.in))
16
17 $(eval $(call docbook,docs/users_guide,users_guide))
18
19 # Hack: dblatex normalises the name of the input file using
20 # os.path.realpath, which means that if we're in a linked build tree,
21 # it won't be able to find ug-book.xml which is in the build tree but
22 # not in the source tree.  Hence, we copy ug-book.xml to the source
23 # tree.  This is a horrible hack, but I can't find a better way to do
24 # it --SDM (2009-05-11)
25
26 build_ug_book = docs/users_guide/ug-book.xml
27 src_ug_book  = $(dir $(realpath $(dir $(build_ug_book))/ug-book.xml.in))ug-book.xml
28
29 # ... and similarly for ug-ent.xml, which is now generated by configure from
30 # ug-ent.xml.in --SDM (2010-02-25)
31
32 build_ug_ent = docs/users_guide/ug-ent.xml
33 src_ug_ent  = $(dir $(realpath $(dir $(build_ug_ent))/ug-ent.xml.in))ug-ent.xml
34
35 html_docs/users_guide : docs/users_guide/users_guide/prof_scc.png
36
37 docs/users_guide/users_guide/prof_scc.png : \
38                 docs/users_guide/prof_scc.png \
39                 docs/users_guide/users_guide/index.html
40         $(CP) $< $@
41 # dep. on d/u/u/index.html is to make sure that the d/u/u dir is created first
42
43 ifneq "$(build_ug_book)" "$(src_ug_book)"
44 $(src_ug_book) : $(build_ug_book)
45         "$(CP)" $< $@
46 ifneq "$(BINDIST)" "YES"
47 docs/users_guide/users_guide.pdf docs/users_guide/users_guide.ps: $(src_ug_book)
48 endif
49 endif
50
51 ifneq "$(build_ug_ent)" "$(src_ug_ent)"
52 $(src_ug_ent) : $(build_ug_ent)
53         "$(CP)" $< $@
54 ifneq "$(BINDIST)" "YES"
55 docs/users_guide/users_guide.pdf docs/users_guide/users_guide.ps: $(src_ug_ent)
56 endif
57 endif
58