1 # -----------------------------------------------------------------------------
4 include $(TOP)/mk/boilerplate.mk
6 # -----------------------------------------------------------------------------
8 # The Cabal package has a GNUmakefile for standalone building, but we
12 SUBDIRS = base haskell98 template-haskell
14 ifeq "$(GhcLibsWithUnix)" "YES"
19 SUBDIRS += $(wildcard parsec)
21 # Set GhcBootLibs=YES from the command line to work with just the libraries
22 # needed to bootstrap GHC.
23 ifneq "$(GhcBootLibs)" "YES"
24 SUBDIRS += $(wildcard haskell-src)
25 SUBDIRS += $(wildcard network)
26 SUBDIRS += $(wildcard QuickCheck)
27 SUBDIRS += $(wildcard HUnit)
28 SUBDIRS += $(wildcard mtl)
29 SUBDIRS += $(wildcard fgl)
30 SUBDIRS += $(wildcard X11)
31 ifeq "$(Windows)" "YES"
32 SUBDIRS += $(wildcard Win32)
34 SUBDIRS += $(wildcard HGL)
35 SUBDIRS += $(wildcard OpenGL)
36 SUBDIRS += $(wildcard GLUT)
37 SUBDIRS += $(wildcard OpenAL)
38 SUBDIRS += $(wildcard ALUT)
39 SUBDIRS += $(wildcard stm)
40 ifeq "$(GhcLibsWithObjectIO)" "YES"
41 SUBDIRS += $(wildcard ObjectIO)
45 ifeq "$(GhcLibsWithReadline)" "YES"
46 SUBDIRS += $(wildcard readline)
49 # -----------------------------------------------------------------------------
51 DIST_CLEAN_FILES += config.cache config.status
53 include $(TOP)/mk/target.mk
55 # -----------------------------------------------------------------------------
56 # Generating the combined contents/index pages for the library docs
58 ifneq "$(NO_HADDOCK_DOCS)" "YES"
62 # ATTENTION, incomprehensible shell stuff ahead: Automagically create the
63 # prologue for the combined index via a header, the package prologues (in
64 # alphabetical order of the packages) and a footer. Not very nice, but much
65 # better than redundancy or a strong coupling with the packages.
66 libraries.txt: libraries-header.txt libraries-footer.txt $(foreach f,package.conf.in prologue.txt,$(addsuffix /$(f),$(SUBDIRS)))
68 ( cat libraries-header.txt ; echo ; \
69 for i in `for j in $(SUBDIRS) ; do echo $$j ; done | $(SORT) -f` ; do \
70 if test -f $$i/$$i.haddock; then \
72 grep -v '^ *$$' $$i/prologue.txt; \
76 cat libraries-footer.txt ; echo ) > $@
78 CLEAN_FILES += libraries.txt
80 $(HTML_DIR)/index.html : libraries.txt
81 @$(INSTALL_DIR) $(HTML_DIR)
82 $(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
84 -t "Haskell Hierarchical Libraries" \
86 $(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
87 $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
88 --read-interface=$(pkg),$(pkg)/$(pkg).haddock))
90 html :: $(HTML_DIR)/index.html
92 libraries.HxS : libraries.txt
93 @$(INSTALL_DIR) $(HTML_DIR)
94 $(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
96 -t "Haskell Hierarchical Libraries" \
100 $(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
101 $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
102 --read-interface=$(pkg),$(pkg)/$(pkg).haddock))
103 ( cd $(HTML_DIR) && if Hxcomp -p libraries.HxC -o ../$@ ; then false ; else true ; fi ) || true
105 libraries.chm : libraries.txt
106 @$(INSTALL_DIR) $(HTML_DIR)
107 $(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
109 -t "Haskell Hierarchical Libraries" \
113 $(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
114 $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
115 --read-interface=$(pkg),$(pkg)/$(pkg).haddock))
116 ( cd $(HTML_DIR) && if hhc libraries.hhp ; then false ; else true ; fi && mv libraries.chm .. ) || true
121 install-docs :: $(HTML_DIR)/index.html
122 $(INSTALL_DIR) $(datadir)/html/libraries; \
123 for i in $(HTML_DIR)/*; do \
124 if test -f $$i; then \
125 echo $(INSTALL_DATA) $(INSTALL_OPTS) $$i $(datadir)/html/libraries; \
126 $(INSTALL_DATA) $(INSTALL_OPTS) $$i $(datadir)/html/libraries; \
129 @for i in $(filter html chm HxS,$(XMLDocWays)); do \
130 if [ $$i != "html" ]; then \
131 $(INSTALL_DIR) $(datadir)/doc; \
132 echo $(INSTALL_DATA) $(INSTALL_OPTS) libraries`echo .$$i | sed s/\.html-no-chunks/.html/` $(datadir)/doc; \
133 $(INSTALL_DATA) $(INSTALL_OPTS) libraries`echo .$$i | sed s/\.html-no-chunks/.html/` $(datadir)/doc; \
135 if [ $$i = "html-no-chunks" ]; then \
136 echo $(CP) $(FPTOOLS_CSS_ABS) $(datadir); \
137 $(CP) $(FPTOOLS_CSS_ABS) $(datadir); \
140 endif # NO_HADDOCK_DOCS