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 readline
14 ifeq "$(GhcLibsWithUnix)" "YES"
17 ifeq "$(Windows)" "YES"
18 SUBDIRS += $(wildcard Win32)
23 # Set GhcBootLibs=YES from the command line to work with just the libraries
24 # needed to bootstrap GHC.
25 ifneq "$(GhcBootLibs)" "YES"
26 SUBDIRS += $(wildcard parsec)
27 SUBDIRS += $(wildcard haskell-src)
28 SUBDIRS += $(wildcard html)
29 SUBDIRS += $(wildcard network)
30 SUBDIRS += $(wildcard QuickCheck)
31 SUBDIRS += $(wildcard HUnit)
32 SUBDIRS += $(wildcard mtl)
33 SUBDIRS += $(wildcard fgl)
34 SUBDIRS += $(wildcard X11)
35 SUBDIRS += $(wildcard time)
36 SUBDIRS += $(wildcard HGL)
37 SUBDIRS += $(wildcard OpenGL)
38 SUBDIRS += $(wildcard GLUT)
39 SUBDIRS += $(wildcard OpenAL)
40 SUBDIRS += $(wildcard ALUT)
41 SUBDIRS += $(wildcard stm)
42 ifeq "$(GhcLibsWithObjectIO)" "YES"
43 SUBDIRS += $(wildcard ObjectIO)
47 # -----------------------------------------------------------------------------
49 DIST_CLEAN_FILES += config.cache config.status
51 include $(TOP)/mk/target.mk
53 # -----------------------------------------------------------------------------
54 # Generating the combined contents/index pages for the library docs
56 ifneq "$(NO_HADDOCK_DOCS)" "YES"
60 # ATTENTION, incomprehensible shell stuff ahead: Automagically create the
61 # prologue for the combined index via a header, the package prologues (in
62 # alphabetical order of the packages) and a footer. Not very nice, but much
63 # better than redundancy or a strong coupling with the packages.
64 libraries.txt: libraries-header.txt libraries-footer.txt $(foreach f,package.conf.in prologue.txt,$(addsuffix /$(f),$(SUBDIRS)))
66 ( cat libraries-header.txt ; echo ; \
67 for i in `for j in $(SUBDIRS) ; do echo $$j ; done | $(SORT) -f` ; do \
68 if test -f $$i/$$i.haddock; then \
70 grep -v '^ *$$' $$i/prologue.txt; \
74 cat libraries-footer.txt ; echo ) > $@
76 CLEAN_FILES += libraries.txt
78 $(HTML_DIR)/index.html : libraries.txt
79 @$(INSTALL_DIR) $(HTML_DIR)
80 $(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
82 -t "Haskell Hierarchical Libraries" \
84 $(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
85 $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
86 --read-interface=$(pkg),$(pkg)/$(pkg).haddock))
88 html :: $(HTML_DIR)/index.html
90 libraries.HxS : libraries.txt
91 @$(INSTALL_DIR) $(HTML_DIR)
92 $(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
94 -t "Haskell Hierarchical Libraries" \
98 $(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
99 $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
100 --read-interface=$(pkg),$(pkg)/$(pkg).haddock))
101 ( cd $(HTML_DIR) && if Hxcomp -p libraries.HxC -o ../$@ ; then false ; else true ; fi ) || true
103 libraries.chm : libraries.txt
104 @$(INSTALL_DIR) $(HTML_DIR)
105 $(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
107 -t "Haskell Hierarchical Libraries" \
111 $(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
112 $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
113 --read-interface=$(pkg),$(pkg)/$(pkg).haddock))
114 ( cd $(HTML_DIR) && if hhc libraries.hhp ; then false ; else true ; fi && mv libraries.chm .. ) || true
119 install-docs :: $(HTML_DIR)/index.html
120 $(INSTALL_DIR) $(datadir)/html/libraries; \
121 for i in $(HTML_DIR)/*; do \
122 if test -f $$i; then \
123 echo $(INSTALL_DATA) $(INSTALL_OPTS) $$i $(datadir)/html/libraries; \
124 $(INSTALL_DATA) $(INSTALL_OPTS) $$i $(datadir)/html/libraries; \
127 @for i in $(filter html chm HxS,$(XMLDocWays)); do \
128 if [ $$i != "html" ]; then \
129 $(INSTALL_DIR) $(datadir)/doc; \
130 echo $(INSTALL_DATA) $(INSTALL_OPTS) libraries`echo .$$i | sed s/\.html-no-chunks/.html/` $(datadir)/doc; \
131 $(INSTALL_DATA) $(INSTALL_OPTS) libraries`echo .$$i | sed s/\.html-no-chunks/.html/` $(datadir)/doc; \
133 if [ $$i = "html-no-chunks" ]; then \
134 echo $(CP) $(FPTOOLS_CSS_ABS) $(datadir); \
135 $(CP) $(FPTOOLS_CSS_ABS) $(datadir); \
138 endif # NO_HADDOCK_DOCS