1 # -----------------------------------------------------------------------------
4 include $(TOP)/mk/boilerplate.mk
6 # -----------------------------------------------------------------------------
8 SUBDIRS = base haskell98 template-haskell
10 ifeq "$(GhcLibsWithUnix)" "YES"
15 SUBDIRS += $(wildcard parsec)
17 # Set GhcBootLibs=YES from the command line to work with just the libraries
18 # needed to bootstrap GHC.
19 ifneq "$(GhcBootLibs)" "YES"
20 SUBDIRS += $(wildcard haskell-src)
21 SUBDIRS += $(wildcard network)
22 SUBDIRS += $(wildcard QuickCheck)
23 SUBDIRS += $(wildcard HUnit)
24 SUBDIRS += $(wildcard mtl)
25 SUBDIRS += $(wildcard fgl)
26 SUBDIRS += $(wildcard X11)
27 ifeq "$(Windows)" "YES"
28 SUBDIRS += $(wildcard Win32)
30 SUBDIRS += $(wildcard HGL)
31 SUBDIRS += $(wildcard OpenGL)
32 SUBDIRS += $(wildcard GLUT)
33 SUBDIRS += $(wildcard OpenAL)
34 SUBDIRS += $(wildcard ALUT)
35 SUBDIRS += $(wildcard stm)
36 ifeq "$(GhcLibsWithObjectIO)" "YES"
37 SUBDIRS += $(wildcard ObjectIO)
41 ifeq "$(GhcLibsWithReadline)" "YES"
42 SUBDIRS += $(wildcard readline)
45 # -----------------------------------------------------------------------------
47 DIST_CLEAN_FILES += config.cache config.status
49 include $(TOP)/mk/target.mk
51 # -----------------------------------------------------------------------------
52 # Generating the combined contents/index pages for the library docs
54 ifneq "$(NO_HADDOCK_DOCS)" "YES"
58 # ATTENTION, incomprehensible shell stuff ahead: Automagically create the
59 # prologue for the combined index via a header, the package prologues (in
60 # alphabetical order of the packages) and a footer. Not very nice, but much
61 # better than redundancy or a strong coupling with the packages.
62 libraries.txt: libraries-header.txt libraries-footer.txt $(foreach f,package.conf.in prologue.txt,$(addsuffix /$(f),$(SUBDIRS)))
64 ( cat libraries-header.txt ; echo ; \
65 for i in `for j in $(SUBDIRS) ; do echo $$j ; done | $(SORT) -f` ; do \
66 if test -f $$i/$$i.haddock; then \
68 grep -v '^ *$$' $$i/prologue.txt; \
72 cat libraries-footer.txt ; echo ) > $@
74 CLEAN_FILES += libraries.txt
76 $(HTML_DIR)/index.html : libraries.txt
77 @$(INSTALL_DIR) $(HTML_DIR)
78 $(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
80 -t "Haskell Hierarchical Libraries" \
82 $(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
83 $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
84 --read-interface=$(pkg),$(pkg)/$(pkg).haddock))
86 html :: $(HTML_DIR)/index.html
88 libraries.HxS : libraries.txt
89 @$(INSTALL_DIR) $(HTML_DIR)
90 $(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
92 -t "Haskell Hierarchical Libraries" \
96 $(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
97 $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
98 --read-interface=$(pkg),$(pkg)/$(pkg).haddock))
99 ( cd $(HTML_DIR) && if Hxcomp -p libraries.HxC -o ../$@ ; then false ; else true ; fi ) || true
101 libraries.chm : libraries.txt
102 @$(INSTALL_DIR) $(HTML_DIR)
103 $(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
105 -t "Haskell Hierarchical Libraries" \
109 $(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
110 $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
111 --read-interface=$(pkg),$(pkg)/$(pkg).haddock))
112 ( cd $(HTML_DIR) && if hhc libraries.hhp ; then false ; else true ; fi && mv libraries.chm .. ) || true
117 install-docs :: $(HTML_DIR)/index.html
118 $(INSTALL_DIR) $(datadir)/html/libraries; \
119 for i in $(HTML_DIR)/*; do \
120 if test -f $$i; then \
121 echo $(INSTALL_DATA) $(INSTALL_OPTS) $$i $(datadir)/html/libraries; \
122 $(INSTALL_DATA) $(INSTALL_OPTS) $$i $(datadir)/html/libraries; \
125 @for i in $(filter html chm HxS,$(XMLDocWays)); do \
126 if [ $$i != "html" ]; then \
127 $(INSTALL_DIR) $(datadir)/doc; \
128 echo $(INSTALL_DATA) $(INSTALL_OPTS) libraries`echo .$$i | sed s/\.html-no-chunks/.html/` $(datadir)/doc; \
129 $(INSTALL_DATA) $(INSTALL_OPTS) libraries`echo .$$i | sed s/\.html-no-chunks/.html/` $(datadir)/doc; \
131 if [ $$i = "html-no-chunks" ]; then \
132 echo $(CP) $(FPTOOLS_CSS_ABS) $(datadir); \
133 $(CP) $(FPTOOLS_CSS_ABS) $(datadir); \
136 endif # NO_HADDOCK_DOCS