<commit_before>SHELL = /bin/sh
.SUFFIXES:

SRCDIR = src
FINDIR = fin
BUILDDIR = build

IDRIS = idris
NODEJS = nodejs

IDRISFLAGS_NONJS = -i $(BUILDDIR)/src/idris -p contrib -p effects
IDRISFLAGS = $(IDRISFLAGS_NONJS) --codegen javascript

.PHONY: all clean html nonjs run-nonjs run check-nonjs check

all: $(FINDIR)/contrivertext.js

$(BUILDDIR):
	mkdir -p $@

# thanks to http://stackoverflow.com/questions/3100776/how-to-copy-a-directory-in-a-makefile/3100872#3100872
SRC_FILES := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/src/%,$(shell find $(SRCDIR) -type f))
$(BUILDDIR)/src/%: $(SRCDIR)/%
	mkdir -p $(@D)
	cp $< $@

$(BUILDDIR)/ContriverText_doc: $(SRC_FILES)
	cd $(BUILDDIR) && $(IDRIS) --mkdoc src/idris/contrivertext.ipkg

$(BUILDDIR)/contrivertext-tests: $(SRC_FILES)
	$(IDRIS) $(BUILDDIR)/src/test/Main.idr -o $@ $(IDRISFLAGS_NONJS)

$(BUILDDIR)/contrivertext-tests.js: $(SRC_FILES)
	$(IDRIS) $(BUILDDIR)/src/test/Main.idr -o $@ $(IDRISFLAGS)

$(FINDIR):
	mkdir -p $@

$(FINDIR)/html: $(BUILDDIR)/ContriverText_doc $(FINDIR)
	rsync -urtpE $</ $@

$(FINDIR)/contrivertext: $(SRC_FILES) $(FINDIR)
	$(IDRIS) $(BUILDDIR)/src/main/Main.idr -o $@ $(IDRISFLAGS_NONJS)

$(FINDIR)/contrivertext.js: $(SRC_FILES) $(FINDIR)
	$(IDRIS) $(BUILDDIR)/src/main/Main.idr -o $@ $(IDRISFLAGS)

clean:
	rm -rf $(BUILDDIR)/ContriverText_doc
	rm -rf $(BUILDDIR)/src
	rm -f $(BUILDDIR)/contrivertext-tests.js
	rm -rf $(FINDIR)/html
	rm -f $(FINDIR)/contrivertext.js

html: $(FINDIR)/html
<commit_msg>Made the unit tests build specifically for Node.js.<commit_after>SHELL = /bin/sh
.SUFFIXES:

SRCDIR = src
FINDIR = fin
BUILDDIR = build

IDRIS = idris
NODEJS = nodejs

IDRISFLAGS = -i $(BUILDDIR)/src/idris -p contrib -p effects

.PHONY: all clean html nonjs run-nonjs run check-nonjs check

all: $(FINDIR)/contrivertext.js

$(BUILDDIR):
	mkdir -p $@

# thanks to http://stackoverflow.com/questions/3100776/how-to-copy-a-directory-in-a-makefile/3100872#3100872
SRC_FILES := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/src/%,$(shell find $(SRCDIR) -type f))
$(BUILDDIR)/src/%: $(SRCDIR)/%
	mkdir -p $(@D)
	cp $< $@

$(BUILDDIR)/ContriverText_doc: $(SRC_FILES)
	cd $(BUILDDIR) && $(IDRIS) --mkdoc src/idris/contrivertext.ipkg

$(BUILDDIR)/contrivertext-tests: $(SRC_FILES)
	$(IDRIS) $(BUILDDIR)/src/test/Main.idr -o $@ $(IDRISFLAGS)

$(BUILDDIR)/contrivertext-tests.js: $(SRC_FILES)
	$(IDRIS) $(BUILDDIR)/src/test/Main.idr -o $@ $(IDRISFLAGS) --codegen node

$(FINDIR):
	mkdir -p $@

$(FINDIR)/html: $(BUILDDIR)/ContriverText_doc $(FINDIR)
	rsync -urtpE $</ $@

$(FINDIR)/contrivertext: $(SRC_FILES) $(FINDIR)
	$(IDRIS) $(BUILDDIR)/src/main/Main.idr -o $@ $(IDRISFLAGS)

$(FINDIR)/contrivertext.js: $(SRC_FILES) $(FINDIR)
	$(IDRIS) $(BUILDDIR)/src/main/Main.idr -o $@ $(IDRISFLAGS) --codegen javascript

clean:
	rm -rf $(BUILDDIR)/ContriverText_doc
	rm -rf $(BUILDDIR)/src
	rm -f $(BUILDDIR)/contrivertext-tests.js
	rm -rf $(FINDIR)/html
	rm -f $(FINDIR)/contrivertext.js

html: $(FINDIR)/html

{'fraction_non_alphanumeric': 0.19851451721809588, 'fraction_numerical': 0.014179608372721135, 'mean_word_length': 4.665391969407266, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '2900950', 'n_tokens_mistral': 1270, 'n_tokens_neox': 1303, 'n_words': 233}