<commit_before># -----------------------------------------------------------------------------

TOP=.
include $(TOP)/mk/boilerplate.mk

# -----------------------------------------------------------------------------

# The Cabal package has a GNUmakefile for standalone building, but we
# want the Makefile.
MFLAGS += -f Makefile

SUBDIRS = base haskell98 template-haskell

ifeq "$(GhcLibsWithUnix)" "YES"
SUBDIRS += unix
endif

SUBDIRS += Cabal
SUBDIRS += $(wildcard parsec)

# Set GhcBootLibs=YES from the command line to work with just the libraries
# needed to bootstrap GHC.
ifneq "$(GhcBootLibs)" "YES"
SUBDIRS += $(wildcard haskell-src)
SUBDIRS += $(wildcard time)
SUBDIRS += $(wildcard network)
SUBDIRS += $(wildcard QuickCheck)
SUBDIRS += $(wildcard HUnit)
SUBDIRS += $(wildcard mtl)
SUBDIRS += $(wildcard fgl)
SUBDIRS += $(wildcard X11)
ifeq "$(Windows)" "YES"
SUBDIRS += $(wildcard Win32)
endif
SUBDIRS += $(wildcard HGL)
SUBDIRS += $(wildcard OpenGL)
SUBDIRS += $(wildcard GLUT)
SUBDIRS += $(wildcard OpenAL)
SUBDIRS += $(wildcard ALUT)
SUBDIRS += $(wildcard stm)
ifeq "$(GhcLibsWithObjectIO)" "YES"
SUBDIRS += $(wildcard ObjectIO)
endif
endif

ifeq "$(GhcLibsWithReadline)" "YES"
SUBDIRS += $(wildcard readline)
endif

# -----------------------------------------------------------------------------

DIST_CLEAN_FILES += config.cache config.status

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 \
	   if test -f $$i/$$i.haddock; then \
	      echo "[@$$i@]"; \
	      grep -v '^ *$$' $$i/prologue.txt; \
	      echo; \
	   fi; \
	done ; \
	cat libraries-footer.txt ; echo ) > $@

CLEAN_FILES += libraries.txt

$(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, $(filter-out haskell98,$(SUBDIRS)), \
		   $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
		      --read-interface=$(pkg),$(pkg)/$(pkg).haddock))

html :: $(HTML_DIR)/index.html

libraries.HxS : libraries.txt
	@$(INSTALL_DIR) $(HTML_DIR)
	$(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
		$(HADDOCK_OPTS) \
		-t "Haskell Hierarchical Libraries" \
		-p libraries.txt \
		-k libraries \
		--html-help=mshelp2 \
		$(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
		   $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
		      --read-interface=$(pkg),$(pkg)/$(pkg).haddock))
	( cd $(HTML_DIR) && if Hxcomp -p libraries.HxC -o ../$@ ; then false ; else true ; fi ) || true

libraries.chm : libraries.txt
	@$(INSTALL_DIR) $(HTML_DIR)
	$(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
		$(HADDOCK_OPTS) \
		-t "Haskell Hierarchical Libraries" \
		-p libraries.txt \
		-k libraries \
		--html-help=mshelp \
		$(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
		   $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
		      --read-interface=$(pkg),$(pkg)/$(pkg).haddock))
	( cd $(HTML_DIR) && if hhc libraries.hhp ; then false ; else true ; fi && mv libraries.chm .. ) || true

HxS :: libraries.HxS
chm :: libraries.chm

install-docs :: $(HTML_DIR)/index.html
	$(INSTALL_DIR) $(datadir)/html/libraries; \
	for i in $(HTML_DIR)/*; do \
		if test -f $$i; then \
		  echo $(INSTALL_DATA) $(INSTALL_OPTS) $$i $(datadir)/html/libraries; \
		  $(INSTALL_DATA) $(INSTALL_OPTS) $$i $(datadir)/html/libraries; \
		fi; \
	done
	@for i in $(filter html chm HxS,$(XMLDocWays)); do \
		if [ $$i != "html" ]; then \
			$(INSTALL_DIR) $(datadir)/doc; \
			echo $(INSTALL_DATA) $(INSTALL_OPTS) libraries`echo .$$i | sed s/\.html-no-chunks/.html/` $(datadir)/doc; \
			$(INSTALL_DATA) $(INSTALL_OPTS) libraries`echo .$$i | sed s/\.html-no-chunks/.html/` $(datadir)/doc; \
		fi; \
		if [ $$i = "html-no-chunks" ]; then \
			echo $(CP) $(FPTOOLS_CSS_ABS) $(datadir); \
			$(CP) $(FPTOOLS_CSS_ABS) $(datadir); \
		fi \
	done
endif # NO_HADDOCK_DOCS
<commit_msg>take parsec out of $(GhcBootLibs)<commit_after># -----------------------------------------------------------------------------

TOP=.
include $(TOP)/mk/boilerplate.mk

# -----------------------------------------------------------------------------

# The Cabal package has a GNUmakefile for standalone building, but we
# want the Makefile.
MFLAGS += -f Makefile

SUBDIRS = base haskell98 template-haskell

ifeq "$(GhcLibsWithUnix)" "YES"
SUBDIRS += unix
endif

SUBDIRS += Cabal

# Set GhcBootLibs=YES from the command line to work with just the libraries
# needed to bootstrap GHC.
ifneq "$(GhcBootLibs)" "YES"
SUBDIRS += $(wildcard parsec)
SUBDIRS += $(wildcard haskell-src)
SUBDIRS += $(wildcard time)
SUBDIRS += $(wildcard network)
SUBDIRS += $(wildcard QuickCheck)
SUBDIRS += $(wildcard HUnit)
SUBDIRS += $(wildcard mtl)
SUBDIRS += $(wildcard fgl)
SUBDIRS += $(wildcard X11)
ifeq "$(Windows)" "YES"
SUBDIRS += $(wildcard Win32)
endif
SUBDIRS += $(wildcard HGL)
SUBDIRS += $(wildcard OpenGL)
SUBDIRS += $(wildcard GLUT)
SUBDIRS += $(wildcard OpenAL)
SUBDIRS += $(wildcard ALUT)
SUBDIRS += $(wildcard stm)
ifeq "$(GhcLibsWithObjectIO)" "YES"
SUBDIRS += $(wildcard ObjectIO)
endif
endif

ifeq "$(GhcLibsWithReadline)" "YES"
SUBDIRS += $(wildcard readline)
endif

# -----------------------------------------------------------------------------

DIST_CLEAN_FILES += config.cache config.status

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 \
	   if test -f $$i/$$i.haddock; then \
	      echo "[@$$i@]"; \
	      grep -v '^ *$$' $$i/prologue.txt; \
	      echo; \
	   fi; \
	done ; \
	cat libraries-footer.txt ; echo ) > $@

CLEAN_FILES += libraries.txt

$(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, $(filter-out haskell98,$(SUBDIRS)), \
		   $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
		      --read-interface=$(pkg),$(pkg)/$(pkg).haddock))

html :: $(HTML_DIR)/index.html

libraries.HxS : libraries.txt
	@$(INSTALL_DIR) $(HTML_DIR)
	$(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
		$(HADDOCK_OPTS) \
		-t "Haskell Hierarchical Libraries" \
		-p libraries.txt \
		-k libraries \
		--html-help=mshelp2 \
		$(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
		   $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
		      --read-interface=$(pkg),$(pkg)/$(pkg).haddock))
	( cd $(HTML_DIR) && if Hxcomp -p libraries.HxC -o ../$@ ; then false ; else true ; fi ) || true

libraries.chm : libraries.txt
	@$(INSTALL_DIR) $(HTML_DIR)
	$(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
		$(HADDOCK_OPTS) \
		-t "Haskell Hierarchical Libraries" \
		-p libraries.txt \
		-k libraries \
		--html-help=mshelp \
		$(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
		   $(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
		      --read-interface=$(pkg),$(pkg)/$(pkg).haddock))
	( cd $(HTML_DIR) && if hhc libraries.hhp ; then false ; else true ; fi && mv libraries.chm .. ) || true

HxS :: libraries.HxS
chm :: libraries.chm

install-docs :: $(HTML_DIR)/index.html
	$(INSTALL_DIR) $(datadir)/html/libraries; \
	for i in $(HTML_DIR)/*; do \
		if test -f $$i; then \
		  echo $(INSTALL_DATA) $(INSTALL_OPTS) $$i $(datadir)/html/libraries; \
		  $(INSTALL_DATA) $(INSTALL_OPTS) $$i $(datadir)/html/libraries; \
		fi; \
	done
	@for i in $(filter html chm HxS,$(XMLDocWays)); do \
		if [ $$i != "html" ]; then \
			$(INSTALL_DIR) $(datadir)/doc; \
			echo $(INSTALL_DATA) $(INSTALL_OPTS) libraries`echo .$$i | sed s/\.html-no-chunks/.html/` $(datadir)/doc; \
			$(INSTALL_DATA) $(INSTALL_OPTS) libraries`echo .$$i | sed s/\.html-no-chunks/.html/` $(datadir)/doc; \
		fi; \
		if [ $$i = "html-no-chunks" ]; then \
			echo $(CP) $(FPTOOLS_CSS_ABS) $(datadir); \
			$(CP) $(FPTOOLS_CSS_ABS) $(datadir); \
		fi \
	done
endif # NO_HADDOCK_DOCS

{'fraction_non_alphanumeric': 0.2364441564052711, 'fraction_numerical': 0.0028083819399438324, 'mean_word_length': 2.768416768416768, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5586987', 'n_tokens_mistral': 3538, 'n_tokens_neox': 3262, 'n_words': 818}