ghc.mk 2.38 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
# -----------------------------------------------------------------------------
#
# (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
#      http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
#      http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
#
# -----------------------------------------------------------------------------
Ian Lynagh's avatar
Ian Lynagh committed
12

13 14 15 16 17 18 19 20 21 22 23
docs/users_guide_GENERATED_DOCBOOK_SOURCES := \
	docs/users_guide/what_glasgow_exts_does.gen.xml

# sort remove duplicates
docs/users_guide_DOCBOOK_SOURCES :=                           \
    $(sort $(docs/users_guide_GENERATED_DOCBOOK_SOURCES)      \
           $(wildcard docs/users_guide/*.xml)                 \
           $(basename $(wildcard docs/users_guide/*.xml.in)))

$(docs/users_guide_GENERATED_DOCBOOK_SOURCES): %.gen.xml: inplace/bin/mkUserGuidePart
	inplace/bin/mkUserGuidePart $@
Ian Lynagh's avatar
Ian Lynagh committed
24 25 26

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

27 28 29 30 31 32 33
# Hack: dblatex normalises the name of the input file using
# os.path.realpath, which means that if we're in a linked build tree,
# it won't be able to find ug-book.xml which is in the build tree but
# not in the source tree.  Hence, we copy ug-book.xml to the source
# tree.  This is a horrible hack, but I can't find a better way to do
# it --SDM (2009-05-11)

34
build_ug_book = docs/users_guide/ug-book.xml
35 36
src_ug_book  = $(dir $(realpath $(dir $(build_ug_book))/ug-book.xml.in))ug-book.xml

37 38 39 40 41 42
# ... and similarly for ug-ent.xml, which is now generated by configure from
# ug-ent.xml.in --SDM (2010-02-25)

build_ug_ent = docs/users_guide/ug-ent.xml
src_ug_ent  = $(dir $(realpath $(dir $(build_ug_ent))/ug-ent.xml.in))ug-ent.xml

43 44 45 46 47 48 49 50
html_docs/users_guide : docs/users_guide/users_guide/prof_scc.png

docs/users_guide/users_guide/prof_scc.png : \
		docs/users_guide/prof_scc.png \
		docs/users_guide/users_guide/index.html
	$(CP) $< $@
# dep. on d/u/u/index.html is to make sure that the d/u/u dir is created first

51 52
ifneq "$(build_ug_book)" "$(src_ug_book)"
$(src_ug_book) : $(build_ug_book)
53
	"$(CP)" $< $@
Ian Lynagh's avatar
Ian Lynagh committed
54
ifneq "$(BINDIST)" "YES"
55
docs/users_guide/users_guide.pdf docs/users_guide/users_guide.ps: $(src_ug_book)
56
endif
Ian Lynagh's avatar
Ian Lynagh committed
57 58
endif

59 60 61 62 63 64 65 66
ifneq "$(build_ug_ent)" "$(src_ug_ent)"
$(src_ug_ent) : $(build_ug_ent)
	"$(CP)" $< $@
ifneq "$(BINDIST)" "YES"
docs/users_guide/users_guide.pdf docs/users_guide/users_guide.ps: $(src_ug_ent)
endif
endif