<commit_before>ifeq ($(LUA_VERSION),)
LUA_VERSION=5.2
endif

LUA_CPPFLAGS=-I/usr/include/lua$(LUA_VERSION)

ifneq ($(DEBUG),)
EXTRA_CFLAGS+= -g -O0
endif

CFLAGS=-Wall -Werror -pedantic -std=c99 -fPIC $(EXTRA_CFLAGS) $(LUA_CPPFLAGS)
LDFLAGS=-Wl,--no-undefined
LIBS=-llua$(LUA_VERSION)

.PHONY: all
all: lextlib.o

lextlib.o: lextlib.c lextlib.h lextlib_global.h lextlib_lua52.h

.PHONY: clean
clean:
	$(RM) *.so *.o

.SUFFIXES: .c .o .so

.c.o:
	$(CC) $(CFLAGS) -o $@ -c $<

.o.so:
	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ $(LIBS)
<commit_msg>Allow building against LuaJIT<commit_after>ifneq ($(USE_LUAJIT),)
LUA_CPPFLAGS=-I/usr/include/luajit-2.0
LUA_LIBS=-lluajit-2.0
else
ifeq ($(LUA_VERSION),)
LUA_VERSION=5.2
endif
LUA_CPPFLAGS=-I/usr/include/lua$(LUA_VERSION)
LUA_LIBS=-llua$(LUA_VERSION)
endif

ifneq ($(DEBUG),)
EXTRA_CFLAGS+= -g -O0
endif

CFLAGS=-Wall -Werror -pedantic -std=c99 -fPIC $(EXTRA_CFLAGS) $(LUA_CPPFLAGS)
LDFLAGS=-Wl,--no-undefined
LIBS=$(LUA_LIBS)

.PHONY: all
all: lextlib.o

lextlib.o: lextlib.c lextlib.h lextlib_global.h lextlib_lua52.h

.PHONY: clean
clean:
	$(RM) *.so *.o

.SUFFIXES: .c .o .so

.c.o:
	$(CC) $(CFLAGS) -o $@ -c $<

.o.so:
	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ $(LIBS)

{'fraction_non_alphanumeric': 0.20326530612244897, 'fraction_numerical': 0.014693877551020407, 'mean_word_length': 4.307359307359308, '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': '6994979', 'n_tokens_mistral': 621, 'n_tokens_neox': 597, 'n_words': 112}