<commit_before>CC=gcc
CFLAGS=-g -Wall
LDFLAGS=-lcrypto
SRC=src
OBJS=ntru.o poly.o hash.o idxgen.o bitstring.o mgf.o key.o encparams.o
TEST_OBJS=test.o test_util.o test_ntru.o test_poly.o test_idxgen.o test_bitstring.o test_key.o

# Use -install_name on Mac OS, -soname everywhere else
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
	SONAME=-install_name
else
	SONAME=-soname
endif

lib: $(OBJS)
	$(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,$(SONAME),libntru.so -o libntru.so $(OBJS)

test: lib $(TEST_OBJS)
	$(CC) $(CFLAGS) -o test -L. -lntru $(TEST_OBJS)
	LD_LIBRARY_PATH=. ./test

%.c %.o:
	$(CC) $(CFLAGS) $(LDFLAGS) -c -fPIC $(SRC)/$*.c -o $@

clean:
	rm -f $(OBJS) $(TEST_OBJS) libntru.so test<commit_msg>Fix for newer versions of gcc<commit_after>CC=gcc
CFLAGS=-g -Wall
LDFLAGS=-lcrypto
SRC=src
OBJS=ntru.o poly.o hash.o idxgen.o bitstring.o mgf.o key.o encparams.o
TEST_OBJS=test.o test_util.o test_ntru.o test_poly.o test_idxgen.o test_bitstring.o test_key.o

# Use -install_name on Mac OS, -soname everywhere else
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
	SONAME=-install_name
else
	SONAME=-soname
endif

lib: $(OBJS)
	$(CC) $(CFLAGS) -shared -Wl,$(SONAME),libntru.so -o libntru.so $(OBJS) $(LDFLAGS)

test: lib $(TEST_OBJS)
	$(CC) $(CFLAGS) -o test $(TEST_OBJS) -L. -lntru
	LD_LIBRARY_PATH=. ./test

%.c %.o:
	$(CC) $(CFLAGS) $(LDFLAGS) -c -fPIC $(SRC)/$*.c -o $@

clean:
	rm -f $(OBJS) $(TEST_OBJS) libntru.so test
{'fraction_non_alphanumeric': 0.1792717086834734, 'fraction_numerical': 0.0, 'mean_word_length': 4.2536764705882355, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7597308', 'n_tokens_mistral': 649, 'n_tokens_neox': 627, 'n_words': 156}