1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
# -----------------------------------------------------------------------------
TOP=.
include $(TOP)/mk/boilerplate.mk
# -----------------------------------------------------------------------------
SUBDIRS = base haskell98 template-haskell
# Set GHCBootLibs=YES from the command line to work with just the libraries
# needed to bootstrap GHC.
ifneq "$(GHCBootLibs)" "YES"
SUBDIRS += haskell-src mtl network parsec QuickCheck HUnit fgl
ifeq "$(GhcLibsWithX11)" "YES"
SUBDIRS += X11 HGL
endif
endif
ifeq "$(GhcLibsWithReadline)" "YES"
SUBDIRS += readline
endif
ifeq "$(GhcLibsWithOpenGL)" "YES"
SUBDIRS += OpenGL
endif
ifeq "$(GhcLibsWithGLUT)" "YES"
SUBDIRS += GLUT
endif
ifeq "$(GhcLibsWithObjectIO)" "YES"
SUBDIRS += ObjectIO
endif
ifeq "$(GhcLibsWithUnix)" "YES"
SUBDIRS += unix
endif
ifeq "$(GhcLibsWithOpenAL)" "YES"
SUBDIRS += $(wildcard OpenAL)
endif
# -----------------------------------------------------------------------------
include $(TOP)/mk/target.mk
# -----------------------------------------------------------------------------
# Generating the combined contents/index pages for the library docs
ifneq "$(NO_HADDOCK_DOCS)" "YES"
HTML_DIR = html
# ATTENTION, incomprehensible shell stuff ahead: Automagically create the
# prologue for the combined index via a header, the package prologues (in
# alphabetical order of the packages) and a footer. Not very nice, but much
# better than redundancy or a strong coupling with the packages.
libraries.txt: libraries-header.txt libraries-footer.txt $(foreach f,package.conf.in prologue.txt,$(addsuffix /$(f),$(SUBDIRS)))
$(RM) $@
( cat libraries-header.txt ; echo ; \
for i in `for j in $(SUBDIRS) ; do echo $$j ; done | sort -f` ; do \
grep -w name $$i/package.conf.in | sed "s/^.*\"\(.*\)\".*$$/[@\1@]/"; \
grep -v '^ *$$' $$i/prologue.txt; \
echo; \
done ; \
cat libraries-footer.txt ; echo ) > $@
$(HTML_DIR)/index.html : libraries.txt
@$(INSTALL_DIR) $(HTML_DIR)
$(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
$(HADDOCK_OPTS) \
-t "Haskell Hierarchical Libraries" \
-p libraries.txt \
$(foreach pkg, $(SUBDIRS), \
--read-interface=$(pkg),$(pkg)/$(pkg).haddock)
html :: $(HTML_DIR)/index.html
install-docs :: $(HTML_DIR)/index.html
@$(INSTALL_DIR) $(datadir)/html/libraries/
@for i in $(HTML_DIR)/*; do \
echo $(INSTALL_DATA) $(INSTALL_OPTS) $$i $(datadir)/html/libraries; \
$(INSTALL_DATA) $(INSTALL_OPTS) $$i $(datadir)/html/libraries; \
done
endif # NO_HADDOCK_DOCS
|