<commit_before>#
# Makefile to prepare releases and run tests
#

.PHONY: all clean check dist dist-all dist-bzip2 dist-gzip dist-zip distcheck

DIST_DIR=dist
LUA_BIN=lua


all:
	@echo Building nothing - no binaries

clean:
	@echo Cleaning nothing - no binaries


dist dist-all: distdir dist-bzip2 dist-gzip dist-zip

distdir:
	mkdir -p dist

VERSION=luajson-$(shell git describe --abbrev=4 HEAD 2>/dev/null)
dist-bzip2: distdir
	git archive --format=tar --prefix=$(VERSION)/ HEAD | bzip2 -9v > $(DIST_DIR)/$(VERSION).tar.bz2
dist-gzip: distdir
	git archive --format=tar --prefix=$(VERSION)/ HEAD | gzip -9v > $(DIST_DIR)/$(VERSION).tar.gz
dist-zip: distdir
	git archive --format=zip --prefix=$(VERSION)/ HEAD > $(DIST_DIR)/$(VERSION).zip

# Config to make sure that Lua uses the contained Lua code
LUA_PATH_SETUP=LUA_PATH="?/init.lua;../lua/?.lua;../lua/?/init.lua;$(LUA_PATH);"
LUA_SETUP=LUA_OLD_INIT="$(LUA_INIT)" LUA_INIT="@hook_require.lua" $(LUA_PATH_SETUP)
check-regression:
	cd tests && $(LUA_SETUP) lua regressionTest.lua
check-unit:
	cd tests && $(LUA_SETUP) lunit lunit-*.lua
check: check-regression check-unit


distcheck: dist-bzip2
	mkdir -p tmp
	tar -C tmp -xf $(DIST_DIR)/$(VERSION).tar.bz2
	cd tmp/$(VERSION) && make check
	rm -rf tmp<commit_msg>base: Makefile learns LUNIT_BIN value<commit_after>#
# Makefile to prepare releases and run tests
#

.PHONY: all clean check dist dist-all dist-bzip2 dist-gzip dist-zip distcheck

DIST_DIR=dist
LUA_BIN=lua
LUNIT_BIN=lunit


all:
	@echo Building nothing - no binaries

clean:
	@echo Cleaning nothing - no binaries


dist dist-all: distdir dist-bzip2 dist-gzip dist-zip

distdir:
	mkdir -p dist

VERSION=luajson-$(shell git describe --abbrev=4 HEAD 2>/dev/null)
dist-bzip2: distdir
	git archive --format=tar --prefix=$(VERSION)/ HEAD | bzip2 -9v > $(DIST_DIR)/$(VERSION).tar.bz2
dist-gzip: distdir
	git archive --format=tar --prefix=$(VERSION)/ HEAD | gzip -9v > $(DIST_DIR)/$(VERSION).tar.gz
dist-zip: distdir
	git archive --format=zip --prefix=$(VERSION)/ HEAD > $(DIST_DIR)/$(VERSION).zip

# Config to make sure that Lua uses the contained Lua code
LUA_PATH_SETUP=LUA_PATH="?/init.lua;../lua/?.lua;../lua/?/init.lua;$(LUA_PATH);"
LUA_SETUP=LUA_OLD_INIT="$(LUA_INIT)" LUA_INIT="@hook_require.lua" $(LUA_PATH_SETUP)
check-regression:
	cd tests && $(LUA_SETUP) lua regressionTest.lua
check-unit:
	cd tests && $(LUA_SETUP) $(LUNIT_BIN) lunit-*.lua
check: check-regression check-unit


distcheck: dist-bzip2
	mkdir -p tmp
	tar -C tmp -xf $(DIST_DIR)/$(VERSION).tar.bz2
	cd tmp/$(VERSION) && make check
	rm -rf tmp
{'fraction_non_alphanumeric': 0.15130299494360172, 'fraction_numerical': 0.008556981719175419, 'mean_word_length': 4.4261603375527425, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '6210115', 'n_tokens_mistral': 1005, 'n_tokens_neox': 953, 'n_words': 250}