1 # -----------------------------------------------------------------------------
4 include $(TOP)/mk/boilerplate.mk
6 # -----------------------------------------------------------------------------
8 # The Cabal package has a GNUmakefile for standalone building, but we
12 SUBDIRS = base filepath 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"
67 # ATTENTION, incomprehensible shell stuff ahead: Automagically create the
68 # prologue for the combined index via a header, the package prologues (in
69 # alphabetical order of the packages) and a footer. Not very nice, but much
70 # better than redundancy or a strong coupling with the packages.
71 libraries.txt: libraries-header.txt libraries-footer.txt $(foreach f,package.conf.in prologue.txt,$(addsuffix /$(f),$(SUBDIRS)))
73 ( cat libraries-header.txt ; echo ; \
74 for i in `for j in $(SUBDIRS) ; do echo $$j ; done | $(SORT) -f` ; do \
75 if test -f $$i/$$i.haddock; then \
77 grep -v '^ *$$' $$i/prologue.txt; \
81 cat libraries-footer.txt ; echo ) > $@
83 CLEAN_FILES += libraries.txt
85 $(HTML_DIR)/index.html : libraries.txt
86 @$(INSTALL_DIR) $(HTML_DIR)
87 $(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
89 -t "Haskell Hierarchical Libraries" \
91 $(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
92 $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
93 --read-interface=$(pkg),$(pkg)/$(pkg).haddock))
95 html :: $(HTML_DIR)/index.html
97 libraries.HxS : libraries.txt
98 @$(INSTALL_DIR) $(HTML_DIR)
99 $(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
101 -t "Haskell Hierarchical Libraries" \
104 --html-help=mshelp2 \
105 $(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
106 $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
107 --read-interface=$(pkg),$(pkg)/$(pkg).haddock))
108 ( cd $(HTML_DIR) && if Hxcomp -p libraries.HxC -o ../$@ ; then false ; else true ; fi ) || true
110 libraries.chm : libraries.txt
111 @$(INSTALL_DIR) $(HTML_DIR)
112 $(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
114 -t "Haskell Hierarchical Libraries" \
118 $(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
119 $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
120 --read-interface=$(pkg),$(pkg)/$(pkg).haddock))
121 ( cd $(HTML_DIR) && if hhc libraries.hhp ; then false ; else true ; fi && mv libraries.chm .. ) || true
126 install-docs :: $(HTML_DIR)/index.html
127 $(INSTALL_DIR) $(datadir)/html/libraries; \
128 for i in $(HTML_DIR)/*; do \
129 if test -f $$i; then \
130 echo $(INSTALL_DATA) $(INSTALL_OPTS) $$i $(datadir)/html/libraries; \
131 $(INSTALL_DATA) $(INSTALL_OPTS) $$i $(datadir)/html/libraries; \
134 @for i in $(filter html chm HxS,$(XMLDocWays)); do \
135 if [ $$i != "html" ]; then \
136 $(INSTALL_DIR) $(datadir)/doc; \
137 echo $(INSTALL_DATA) $(INSTALL_OPTS) libraries`echo .$$i | sed s/\.html-no-chunks/.html/` $(datadir)/doc; \
138 $(INSTALL_DATA) $(INSTALL_OPTS) libraries`echo .$$i | sed s/\.html-no-chunks/.html/` $(datadir)/doc; \
140 if [ $$i = "html-no-chunks" ]; then \
141 echo $(CP) $(FPTOOLS_CSS_ABS) $(datadir); \
142 $(CP) $(FPTOOLS_CSS_ABS) $(datadir); \
145 endif # NO_HADDOCK_DOCS