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