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"
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 network)
29 SUBDIRS += $(wildcard QuickCheck)
30 SUBDIRS += $(wildcard HUnit)
31 SUBDIRS += $(wildcard mtl)
32 SUBDIRS += $(wildcard fgl)
33 SUBDIRS += $(wildcard X11)
34 ifneq "$(Windows)" "YES"
35 SUBDIRS += $(wildcard time)
37 SUBDIRS += $(wildcard HGL)
38 SUBDIRS += $(wildcard OpenGL)
39 SUBDIRS += $(wildcard GLUT)
40 SUBDIRS += $(wildcard OpenAL)
41 SUBDIRS += $(wildcard ALUT)
42 SUBDIRS += $(wildcard stm)
43 ifeq "$(GhcLibsWithObjectIO)" "YES"
44 SUBDIRS += $(wildcard ObjectIO)
48 ifeq "$(GhcLibsWithReadline)" "YES"
49 SUBDIRS += $(wildcard readline)
52 # -----------------------------------------------------------------------------
54 DIST_CLEAN_FILES += config.cache config.status
56 include $(TOP)/mk/target.mk
58 # -----------------------------------------------------------------------------
59 # Generating the combined contents/index pages for the library docs
61 ifneq "$(NO_HADDOCK_DOCS)" "YES"
65 # ATTENTION, incomprehensible shell stuff ahead: Automagically create the
66 # prologue for the combined index via a header, the package prologues (in
67 # alphabetical order of the packages) and a footer. Not very nice, but much
68 # better than redundancy or a strong coupling with the packages.
69 libraries.txt: libraries-header.txt libraries-footer.txt $(foreach f,package.conf.in prologue.txt,$(addsuffix /$(f),$(SUBDIRS)))
71 ( cat libraries-header.txt ; echo ; \
72 for i in `for j in $(SUBDIRS) ; do echo $$j ; done | $(SORT) -f` ; do \
73 if test -f $$i/$$i.haddock; then \
75 grep -v '^ *$$' $$i/prologue.txt; \
79 cat libraries-footer.txt ; echo ) > $@
81 CLEAN_FILES += libraries.txt
83 $(HTML_DIR)/index.html : libraries.txt
84 @$(INSTALL_DIR) $(HTML_DIR)
85 $(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
87 -t "Haskell Hierarchical Libraries" \
89 $(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
90 $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
91 --read-interface=$(pkg),$(pkg)/$(pkg).haddock))
93 html :: $(HTML_DIR)/index.html
95 libraries.HxS : libraries.txt
96 @$(INSTALL_DIR) $(HTML_DIR)
97 $(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
99 -t "Haskell Hierarchical Libraries" \
102 --html-help=mshelp2 \
103 $(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
104 $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
105 --read-interface=$(pkg),$(pkg)/$(pkg).haddock))
106 ( cd $(HTML_DIR) && if Hxcomp -p libraries.HxC -o ../$@ ; then false ; else true ; fi ) || true
108 libraries.chm : libraries.txt
109 @$(INSTALL_DIR) $(HTML_DIR)
110 $(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
112 -t "Haskell Hierarchical Libraries" \
116 $(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
117 $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
118 --read-interface=$(pkg),$(pkg)/$(pkg).haddock))
119 ( cd $(HTML_DIR) && if hhc libraries.hhp ; then false ; else true ; fi && mv libraries.chm .. ) || true
124 install-docs :: $(HTML_DIR)/index.html
125 $(INSTALL_DIR) $(datadir)/html/libraries; \
126 for i in $(HTML_DIR)/*; do \
127 if test -f $$i; then \
128 echo $(INSTALL_DATA) $(INSTALL_OPTS) $$i $(datadir)/html/libraries; \
129 $(INSTALL_DATA) $(INSTALL_OPTS) $$i $(datadir)/html/libraries; \
132 @for i in $(filter html chm HxS,$(XMLDocWays)); do \
133 if [ $$i != "html" ]; then \
134 $(INSTALL_DIR) $(datadir)/doc; \
135 echo $(INSTALL_DATA) $(INSTALL_OPTS) libraries`echo .$$i | sed s/\.html-no-chunks/.html/` $(datadir)/doc; \
136 $(INSTALL_DATA) $(INSTALL_OPTS) libraries`echo .$$i | sed s/\.html-no-chunks/.html/` $(datadir)/doc; \
138 if [ $$i = "html-no-chunks" ]; then \
139 echo $(CP) $(FPTOOLS_CSS_ABS) $(datadir); \
140 $(CP) $(FPTOOLS_CSS_ABS) $(datadir); \
143 endif # NO_HADDOCK_DOCS