<commit_before>PREFIX       ?= /usr/local
LIBDIR       ?= $(PREFIX)/lib
INCLUDEDIR   ?= $(PREFIX)/include
MAKE_DIR     ?= install -d
INSTALL_DATA ?= install

CC?=gcc
CFLAGS?=-O2 -Wall -g -D_FORTIFY_SOURCE=2 -fstack-protector -fPIC
LDFLAGS?=-Wl,-z,now -Wl,-z,relro -Wl,-soname,libscrypt.so.0 -Wl,--version-script=libscrypt.version
CFLAGS_EXTRA?=-Wl,-rpath=.

all: reference

OBJS= crypto_scrypt-nosse.o sha256.o crypto-mcf.o b64.o crypto-scrypt-saltgen.o crypto_scrypt-check.o crypto_scrypt-hash.o slowequals.o

libscrypt.so.0: $(OBJS) 
	$(CC)  $(LDFLAGS) -shared -o libscrypt.so.0  $(OBJS) -lm -lc
	ar rcs libscrypt.a  $(OBJS)

reference: libscrypt.so.0 main.o crypto_scrypt-hexconvert.o
	ln -s -f libscrypt.so.0 libscrypt.so
	$(CC) -Wall -o reference main.o b64.o crypto_scrypt-hexconvert.o $(CFLAGS_EXTRA) -L.  -lscrypt

clean:
	rm -f *.o reference libscrypt.so* libscrypt.a endian.h

check: all
	./reference

devtest:
	splint crypto_scrypt-hexconvert.c 
	splint crypto-mcf.c crypto_scrypt-check.c crypto_scrypt-hash.c -unrecog
	splint crypto-scrypt-saltgen.c +posixlib -compdef
	valgrind ./reference

asan: main.c
	clang -O1 -g -fsanitize=address -fno-omit-frame-pointer  *.c -o asantest
	./asantest
	scan-build clang -O1 -g -fsanitize=memory -fno-omit-frame-pointer  *.c -o asantest<commit_msg>Memory sanitize is still beta - remove it.<commit_after>PREFIX       ?= /usr/local
LIBDIR       ?= $(PREFIX)/lib
INCLUDEDIR   ?= $(PREFIX)/include
MAKE_DIR     ?= install -d
INSTALL_DATA ?= install

CC?=gcc
CFLAGS?=-O2 -Wall -g -D_FORTIFY_SOURCE=2 -fstack-protector -fPIC
LDFLAGS?=-Wl,-z,now -Wl,-z,relro -Wl,-soname,libscrypt.so.0 -Wl,--version-script=libscrypt.version
CFLAGS_EXTRA?=-Wl,-rpath=.

all: reference

OBJS= crypto_scrypt-nosse.o sha256.o crypto-mcf.o b64.o crypto-scrypt-saltgen.o crypto_scrypt-check.o crypto_scrypt-hash.o slowequals.o

libscrypt.so.0: $(OBJS) 
	$(CC)  $(LDFLAGS) -shared -o libscrypt.so.0  $(OBJS) -lm -lc
	ar rcs libscrypt.a  $(OBJS)

reference: libscrypt.so.0 main.o crypto_scrypt-hexconvert.o
	ln -s -f libscrypt.so.0 libscrypt.so
	$(CC) -Wall -o reference main.o b64.o crypto_scrypt-hexconvert.o $(CFLAGS_EXTRA) -L.  -lscrypt

clean:
	rm -f *.o reference libscrypt.so* libscrypt.a endian.h

check: all
	./reference

devtest:
	splint crypto_scrypt-hexconvert.c 
	splint crypto-mcf.c crypto_scrypt-check.c crypto_scrypt-hash.c -unrecog
	splint crypto-scrypt-saltgen.c +posixlib -compdef
	valgrind ./reference

asan: main.c
	clang -O1 -g -fsanitize=address -fno-omit-frame-pointer  *.c -o asantest
	./asantest
	scan-build clang -O1 -g -fsanitize=undefined -fno-omit-frame-pointer  *.c -o asantest
{'fraction_non_alphanumeric': 0.14383561643835616, 'fraction_numerical': 0.0121765601217656, 'mean_word_length': 3.6448763250883394, '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': '5403492', 'n_tokens_mistral': 1139, 'n_tokens_neox': 1104, 'n_words': 229}