<commit_before>SRC = kernel/closure.c kernel/vtable.c kernel/object.c kernel/message.c kernel/string.c kernel/number.c kernel/array.c kernel/lobby.c kernel/grammar.c kernel/scanner.c kernel/min.c
OBJ = ${SRC:.c=.o}
OBJ_MIN = kernel/min.o

CC = gcc
CFLAGS = -Wall -fno-strict-aliasing -DDEBUG -g -O2
INCS = -Ikernel
LEMON = tools/lemon
LIBS = -lm
RAGEL = ragel

all: min

.c.o:
	${CC} -c ${CFLAGS} ${INCS} -o $@ $<

min: ${OBJ_MIN} ${OBJ}
	${CC} ${CFLAGS} ${OBJ_POTION} ${OBJ} ${LIBS} -o min

kernel/scanner.c: kernel/scanner.rl
	${RAGEL} kernel/scanner.rl -C -o $@

kernel/grammar.c: tools/lemon kernel/grammar.y
	${LEMON} kernel/grammar.y

tools/lemon: tools/lemon.c
	${CC} -o tools/lemon tools/lemon.c

clean:
	rm -f kernel/*.o kernel/scanner.c kernel/grammar.{c,h,out}

test: min
	@ruby test/run.rb

sloc: clean
	@cp kernel/scanner.rl kernel/scanner.rl.c
	sloccount kernel
	@rm kernel/scanner.rl.c

size: clean
	@ruby -e 'puts "%0.2fK" % (Dir["kernel/**.{c,rb,h}"].inject(0) {|s,f| s += File.size(f)} / 1024.0)'

rebuild: clean min

.PHONY: all clean test sloc size rebuild<commit_msg>Fix size target<commit_after>SRC = kernel/closure.c kernel/vtable.c kernel/object.c kernel/message.c kernel/string.c kernel/number.c kernel/array.c kernel/lobby.c kernel/grammar.c kernel/scanner.c kernel/min.c
OBJ = ${SRC:.c=.o}
OBJ_MIN = kernel/min.o

CC = gcc
CFLAGS = -Wall -fno-strict-aliasing -DDEBUG -g -O2
INCS = -Ikernel
LEMON = tools/lemon
LIBS = -lm
RAGEL = ragel

all: min

.c.o:
	${CC} -c ${CFLAGS} ${INCS} -o $@ $<

min: ${OBJ_MIN} ${OBJ}
	${CC} ${CFLAGS} ${OBJ_POTION} ${OBJ} ${LIBS} -o min

kernel/scanner.c: kernel/scanner.rl
	${RAGEL} kernel/scanner.rl -C -o $@

kernel/grammar.c: tools/lemon kernel/grammar.y
	${LEMON} kernel/grammar.y

tools/lemon: tools/lemon.c
	${CC} -o tools/lemon tools/lemon.c

clean:
	rm -f kernel/*.o kernel/scanner.c kernel/grammar.{c,h,out}

test: min
	@ruby test/run.rb

sloc: clean
	@cp kernel/scanner.rl kernel/scanner.rl.c
	sloccount kernel
	@rm kernel/scanner.rl.c

size: clean
	@ruby -e 'puts "%0.2fK" % (Dir["kernel/**.{c,rl,h}"].inject(0) {|s,f| s += File.size(f)} / 1024.0)'

rebuild: clean min

.PHONY: all clean test sloc size rebuild
{'fraction_non_alphanumeric': 0.18457300275482094, 'fraction_numerical': 0.008264462809917356, 'mean_word_length': 3.626326963906582, 'pattern_counts': {'":': 0, '<': 5, '<?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': '27580', 'n_tokens_mistral': 989, 'n_tokens_neox': 950, 'n_words': 215}