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 \
13 regex-base regex-posix regex-compat parsec Cabal
15 ifeq "$(GhcLibsWithUnix)" "YES"
18 ifeq "$(Windows)" "YES"
19 SUBDIRS += $(wildcard Win32)
22 # Set GhcBootLibs=YES from the command line to work with just the libraries
23 # needed to bootstrap GHC.
24 ifneq "$(GhcBootLibs)" "YES"
25 SUBDIRS += $(wildcard haskell-src)
26 SUBDIRS += $(wildcard html)
27 SUBDIRS += $(wildcard network)
28 SUBDIRS += $(wildcard QuickCheck)
29 SUBDIRS += $(wildcard HUnit)
30 SUBDIRS += $(wildcard mtl)
31 SUBDIRS += $(wildcard fgl)
32 SUBDIRS += $(wildcard X11)
33 SUBDIRS += $(wildcard time)
34 ifeq "$(Windows)" "NO"
35 # HGL is not working on Win32, so omit it for now. Better not to ship it
36 # at all than to ship a broken version.
37 SUBDIRS += $(wildcard HGL)
39 SUBDIRS += $(wildcard OpenGL)
40 SUBDIRS += $(wildcard GLUT)
41 SUBDIRS += $(wildcard OpenAL)
42 SUBDIRS += $(wildcard ALUT)
43 SUBDIRS += $(wildcard stm)
44 SUBDIRS += $(wildcard xhtml)
45 SUBDIRS += $(wildcard cgi)
46 ifeq "$(GhcLibsWithObjectIO)" "YES"
47 SUBDIRS += $(wildcard ObjectIO)
51 # -----------------------------------------------------------------------------
53 DIST_CLEAN_FILES += config.cache config.status
55 include $(TOP)/mk/target.mk
57 # -----------------------------------------------------------------------------
58 # Generating the combined contents/index pages for the library docs
60 ifneq "$(NO_HADDOCK_DOCS)" "YES"
64 # ATTENTION, incomprehensible shell stuff ahead: Automagically create the
65 # prologue for the combined index via a header, the package prologues (in
66 # alphabetical order of the packages) and a footer. Not very nice, but much
67 # better than redundancy or a strong coupling with the packages.
68 libraries.txt: libraries-header.txt libraries-footer.txt $(foreach f,package.conf.in prologue.txt,$(addsuffix /$(f),$(SUBDIRS)))
70 ( cat libraries-header.txt ; echo ; \
71 for i in `for j in $(SUBDIRS) ; do echo $$j ; done | $(SORT) -f` ; do \
72 if test -f $$i/$$i.haddock; then \
74 grep -v '^ *$$' $$i/prologue.txt; \
78 cat libraries-footer.txt ; echo ) > $@
80 CLEAN_FILES += libraries.txt
82 $(HTML_DIR)/index.html : libraries.txt
83 @$(INSTALL_DIR) $(HTML_DIR)
84 $(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
86 -t "Haskell Hierarchical Libraries" \
88 $(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
89 $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
90 --read-interface=$(pkg),$(pkg)/$(pkg).haddock))
92 html :: $(HTML_DIR)/index.html
94 libraries.HxS : libraries.txt
95 @$(INSTALL_DIR) $(HTML_DIR)
96 $(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
98 -t "Haskell Hierarchical Libraries" \
101 --html-help=mshelp2 \
102 $(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
103 $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
104 --read-interface=$(pkg),$(pkg)/$(pkg).haddock))
105 ( cd $(HTML_DIR) && if Hxcomp -p libraries.HxC -o ../$@ ; then false ; else true ; fi ) || true
107 libraries.chm : libraries.txt
108 @$(INSTALL_DIR) $(HTML_DIR)
109 $(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
111 -t "Haskell Hierarchical Libraries" \
115 $(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
116 $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
117 --read-interface=$(pkg),$(pkg)/$(pkg).haddock))
118 ( cd $(HTML_DIR) && if hhc libraries.hhp ; then false ; else true ; fi && mv libraries.chm .. ) || true
123 install-docs :: $(HTML_DIR)/index.html
124 $(INSTALL_DIR) $(datadir)/html/libraries; \
125 for i in $(HTML_DIR)/*; do \
126 if test -f $$i; then \
127 echo $(INSTALL_DATA) $(INSTALL_OPTS) $$i $(datadir)/html/libraries; \
128 $(INSTALL_DATA) $(INSTALL_OPTS) $$i $(datadir)/html/libraries; \
131 @for i in $(filter html chm HxS,$(XMLDocWays)); do \
132 if [ $$i != "html" ]; then \
133 $(INSTALL_DIR) $(datadir)/doc; \
134 echo $(INSTALL_DATA) $(INSTALL_OPTS) libraries`echo .$$i | sed s/\.html-no-chunks/.html/` $(datadir)/doc; \
135 $(INSTALL_DATA) $(INSTALL_OPTS) libraries`echo .$$i | sed s/\.html-no-chunks/.html/` $(datadir)/doc; \
137 if [ $$i = "html-no-chunks" ]; then \
138 echo $(CP) $(FPTOOLS_CSS_ABS) $(datadir); \
139 $(CP) $(FPTOOLS_CSS_ABS) $(datadir); \
142 endif # NO_HADDOCK_DOCS