<commit_before>JHC_VERSION=0.1
PREFIX=/usr/local

all: jhc

GHCDEBUGOPTS= -W -fno-warn-unused-matches -fno-warn-unused-binds    # -O2 -ddump-simpl-stats -ddump-rules
GHCPROFOPTS=   -prof -auto-all -osuf prof.o -hisuf prof.hi
GHCINC=  -iFrontEnd
PACKAGES= -package mtl  -package unix -package QuickCheck
GHCOPTS=   -O -ignore-package lang  -pgmF drift-ghc  -F $(GHCDEBUGOPTS) $(GHCINC) $(PACKAGES) -fwarn-type-defaults   -fallow-undecidable-instances  -fglasgow-exts -fallow-overlapping-instances

HC = ghc
HCI = ghci
HC_OPTS = $(GHCOPTS)

BUILTSOURCES= PrimitiveOperators.hs RawFiles.hs FrontEnd/HsParser.hs FlagDump.hs FlagOpts.hs Version/Raw.hs Version/Ctx.hs

# HSFILES is defined here, it can be updated with 'make depend' whenever a new source file is added
-include depend.make


SUFFIXES= .hs .lhs .o .hi .hsc .c .h .ly .hi-boot .hs-boot .o-boot


MAIN=Main.hs

jhcp: $(BUILTSOURCES) $(HSFILES)
	date '+%y%m%d%H%M.%S' > /tmp/$@.date.tmp
	$(HC) $(GHCOPTS) $(EXTRAOPTS) $(GHCPROFOPTS) --make $(MAIN) -o $@
	touch -t `cat /tmp/$@.date.tmp` $@

jhc: $(BUILTSOURCES) $(HSFILES)
	date '+%y%m%d%H%M.%S' > /tmp/$@.date.tmp
	$(HC) $(GHCOPTS) $(EXTRAOPTS) --make $(MAIN) -o $@
	touch -t `cat /tmp/$@.date.tmp` $@

i:
	ghci $(GHCOPTS) $(EXTRAOPTS) Main.hs

LIBRARYPATH="$(PREFIX)/lib/jhc-$(JHC_VERSION)"
DP=$(PREFIX)

base-1.0.hl: jhc lib/base/base.cabal
	-[ -e base.log ] && mv -f base.log base.log.bak
	./jhc -v $(JHC_TEST) -ilib/base --noauto --build-hl lib/base/base.cabal -o base-1.0.hl 2>&1 | tee base.log

install: jhc base-1.0.hl
	install -d "$(DP)/bin"
	install jhc "$(DP)/bin"
	ln -sf "$(DP)/bin/jhc" "$(DP)/bin/jhci"
	install -d $(LIBRARYPATH)
	install base-1.0.hl $(LIBRARYPATH)

tags: $(HSFILES)
	hasktags $(HSFILES)


hsdocs:
	haddock -h $(filter-out DataConstructors.hs SelfTest.hs %/HsParser.hs FrontEnd/Representation.hs C/Gen.hs , $(HSFILES)) -o hsdocs

printos:
	echo $(HSFILES)


depend: $(BUILTSOURCES)
	$(HC) -M -optdep-f -optdepdep.tmp $(HC_OPTS) $(MAIN)
	echo HSFILES=`egrep -o '[A-Za-z0-9/.]+.hs' dep.tmp | sed -e 's/^\.\///' | sort` > depend.make
	rm -f dep.tmp

clean:<commit_msg>add profiling library support<commit_after>JHC_VERSION=0.1
PREFIX=/usr/local

all: jhc

GHCDEBUGOPTS= -W -fno-warn-unused-matches -fno-warn-unused-binds    # -O2 -ddump-simpl-stats -ddump-rules
GHCPROFOPTS=   -prof -auto-all -osuf prof.o -hisuf prof.hi
GHCINC=  -iFrontEnd
PACKAGES= -package mtl  -package unix -package QuickCheck
GHCOPTS=   -O -ignore-package lang  -pgmF drift-ghc  -F $(GHCDEBUGOPTS) $(GHCINC) $(PACKAGES) -fwarn-type-defaults   -fallow-undecidable-instances  -fglasgow-exts -fallow-overlapping-instances

HC = ghc
HCI = ghci
HC_OPTS = $(GHCOPTS)

PROF_OPTS = -P

BUILTSOURCES= PrimitiveOperators.hs RawFiles.hs FrontEnd/HsParser.hs FlagDump.hs FlagOpts.hs Version/Raw.hs Version/Ctx.hs

# HSFILES is defined here, it can be updated with 'make depend' whenever a new source file is added
-include depend.make


SUFFIXES= .hs .lhs .o .hi .hsc .c .h .ly .hi-boot .hs-boot .o-boot


MAIN=Main.hs

jhcp: $(BUILTSOURCES) $(HSFILES)
	date '+%y%m%d%H%M.%S' > /tmp/$@.date.tmp
	$(HC) $(GHCOPTS) $(EXTRAOPTS) $(GHCPROFOPTS) --make $(MAIN) -o $@
	touch -t `cat /tmp/$@.date.tmp` $@

jhc: $(BUILTSOURCES) $(HSFILES)
	date '+%y%m%d%H%M.%S' > /tmp/$@.date.tmp
	$(HC) $(GHCOPTS) $(EXTRAOPTS) --make $(MAIN) -o $@
	touch -t `cat /tmp/$@.date.tmp` $@

i:
	ghci $(GHCOPTS) $(EXTRAOPTS) Main.hs

LIBRARYPATH="$(PREFIX)/lib/jhc-$(JHC_VERSION)"
DP=$(PREFIX)

base-1.0.hl: jhc lib/base/base.cabal
	-[ -e base.log ] && mv -f base.log base.log.bak
	./jhc -v $(JHC_TEST) -ilib/base --noauto --build-hl lib/base/base.cabal -o base-1.0.hl 2>&1 | tee base.log

base-1.0.prof.hl: jhc lib/base/base.cabal
	-[ -e base.prof.log ] && mv -f base.prof.log base.prof.log.bak
	./jhcp -v $(JHC_TEST) -ilib/base --noauto --build-hl lib/base/base.cabal -o base-1.0.prof.hl +RTS $(PROF_OPTS)  2>&1 | tee base.log

install: jhc base-1.0.hl
	install -d "$(DP)/bin"
	install jhc "$(DP)/bin"
	ln -sf "$(DP)/bin/jhc" "$(DP)/bin/jhci"
	install -d $(LIBRARYPATH)
	install base-1.0.hl $(LIBRARYPATH)

tags: $(HSFILES)
	hasktags $(HSFILES)


hsdocs:
	haddock -h $(filter-out DataConstructors.hs SelfTest.hs %/HsParser.hs FrontEnd/Representation.hs C/Gen.hs , $(HSFILES)) -o hsdocs

printos:
	echo $(HSFILES)


depend: $(BUILTSOURCES)
	$(HC) -M -optdep-f -optdepdep.tmp $(HC_OPTS) $(MAIN)
	echo HSFILES=`egrep -o '[A-Za-z0-9/.]+.hs' dep.tmp | sed -e 's/^\.\///' | sort` > depend.make
	rm -f dep.tmp

clean:
{'fraction_non_alphanumeric': 0.1927199642697633, 'fraction_numerical': 0.0080393032603841, 'mean_word_length': 3.4346534653465346, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '1703343', 'n_tokens_mistral': 2097, 'n_tokens_neox': 1978, 'n_words': 445}