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 network)
29 SUBDIRS += $(wildcard QuickCheck)
30 SUBDIRS += $(wildcard HUnit)
31 SUBDIRS += $(wildcard mtl)
32 SUBDIRS += $(wildcard fgl)
33 SUBDIRS += $(wildcard X11)
34 SUBDIRS += $(wildcard time)
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 # -----------------------------------------------------------------------------
48 DIST_CLEAN_FILES += config.cache config.status
50 include $(TOP)/mk/target.mk
52 # -----------------------------------------------------------------------------
53 # Generating the combined contents/index pages for the library docs
55 ifneq "$(NO_HADDOCK_DOCS)" "YES"
59 # ATTENTION, incomprehensible shell stuff ahead: Automagically create the
60 # prologue for the combined index via a header, the package prologues (in
61 # alphabetical order of the packages) and a footer. Not very nice, but much
62 # better than redundancy or a strong coupling with the packages.
63 libraries.txt: libraries-header.txt libraries-footer.txt $(foreach f,package.conf.in prologue.txt,$(addsuffix /$(f),$(SUBDIRS)))
65 ( cat libraries-header.txt ; echo ; \
66 for i in `for j in $(SUBDIRS) ; do echo $$j ; done | $(SORT) -f` ; do \
67 if test -f $$i/$$i.haddock; then \
69 grep -v '^ *$$' $$i/prologue.txt; \
73 cat libraries-footer.txt ; echo ) > $@
75 CLEAN_FILES += libraries.txt
77 $(HTML_DIR)/index.html : libraries.txt
78 @$(INSTALL_DIR) $(HTML_DIR)
79 $(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
81 -t "Haskell Hierarchical Libraries" \
83 $(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
84 $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
85 --read-interface=$(pkg),$(pkg)/$(pkg).haddock))
87 html :: $(HTML_DIR)/index.html
89 libraries.HxS : libraries.txt
90 @$(INSTALL_DIR) $(HTML_DIR)
91 $(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
93 -t "Haskell Hierarchical Libraries" \
97 $(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
98 $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
99 --read-interface=$(pkg),$(pkg)/$(pkg).haddock))
100 ( cd $(HTML_DIR) && if Hxcomp -p libraries.HxC -o ../$@ ; then false ; else true ; fi ) || true
102 libraries.chm : libraries.txt
103 @$(INSTALL_DIR) $(HTML_DIR)
104 $(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
106 -t "Haskell Hierarchical Libraries" \
110 $(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
111 $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
112 --read-interface=$(pkg),$(pkg)/$(pkg).haddock))
113 ( cd $(HTML_DIR) && if hhc libraries.hhp ; then false ; else true ; fi && mv libraries.chm .. ) || true
118 install-docs :: $(HTML_DIR)/index.html
119 $(INSTALL_DIR) $(datadir)/html/libraries; \
120 for i in $(HTML_DIR)/*; do \
121 if test -f $$i; then \
122 echo $(INSTALL_DATA) $(INSTALL_OPTS) $$i $(datadir)/html/libraries; \
123 $(INSTALL_DATA) $(INSTALL_OPTS) $$i $(datadir)/html/libraries; \
126 @for i in $(filter html chm HxS,$(XMLDocWays)); do \
127 if [ $$i != "html" ]; then \
128 $(INSTALL_DIR) $(datadir)/doc; \
129 echo $(INSTALL_DATA) $(INSTALL_OPTS) libraries`echo .$$i | sed s/\.html-no-chunks/.html/` $(datadir)/doc; \
130 $(INSTALL_DATA) $(INSTALL_OPTS) libraries`echo .$$i | sed s/\.html-no-chunks/.html/` $(datadir)/doc; \
132 if [ $$i = "html-no-chunks" ]; then \
133 echo $(CP) $(FPTOOLS_CSS_ABS) $(datadir); \
134 $(CP) $(FPTOOLS_CSS_ABS) $(datadir); \
137 endif # NO_HADDOCK_DOCS