<commit_before># either linux or dragonfly
SYSTEM?=linux

# either openssl or gcrypt
PBKDF_BACKEND?=openssl

# system compiler, normally gcc
CC?=gcc

# whether to enable debugging or not
DEBUG?=no

WARNFLAGS= -Wsystem-headers -Werror -Wall -W -Wno-unused-parameter \
	-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \
	-Wold-style-definition -Wreturn-type -Wcast-qual -Wwrite-strings \
	-Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts \
	-Winline -Wnested-externs

SRCS=	tcplay.c crc32.c safe_mem.c io.c hdr.c humanize.c
SRCS+=	crypto.c generic_xts.c
OBJS=	tcplay.o crc32.o safe_mem.o io.o hdr.o humanize.o
OBJS+=	crypto.o generic_xts.o

CFLAGS+= $(WARNFLAGS)

ifeq (${DEBUG}, yes)
  CFLAGS+= -O0 -g -DDEBUG
else
  CFLAGS+= -O3
endif

ifeq (${SYSTEM}, linux)
  CFLAGS+=	-D_GNU_SOURCE
  LIBS+=	-lgcrypt -ldevmapper -luuid
  SRCS+=	crypto-gcrypt.c
  OBJS+=	crypto-gcrypt.o
  ifeq (${PBKDF_BACKEND}, gcrypt)
    SRCS+=	pbkdf2-gcrypt.c
    OBJS+=	pbkdf2-gcrypt.o
  endif
  ifeq (${PBKDF_BACKEND}, openssl)
    SRCS+=	pbkdf2-openssl.c
    OBJS+=	pbkdf2-openssl.o
    LIBS+=	-lcrypto
  endif
endif

ifeq (${SYSTEM}, dragonfly)
  LIBS+=	-lcrypto -ldm -lprop
  SRCS+=	crypto-dev.c
  OBJS+=	crypto-dev.o
  SRCS+=	pbkdf2-openssl.c
  OBJS+=	pbkdf2-openssl.o
endif

program:
	$(CC) $(CFLAGS) -o tc-play main.c $(SRCS) $(LIBS)
lib:
	$(CC) $(CFLAGS) -c -fPIC tcplay_api.c $(SRCS)
	$(CC) -shared -Wl,-version-script=tcplay.map -o libtcplay.so tcplay_api.o $(OBJS)

test:
	gcc -O0 -g -L. -I. tcplay_api_test.c -ltcplay -lcrypto -ldm -lprop
clean:
	rm -f tc-play libtcplay.so tc-play.core *.o ktrace.out
<commit_msg>complete the namechange to tcplay<commit_after># either linux or dragonfly
SYSTEM?=linux

# either openssl or gcrypt
PBKDF_BACKEND?=openssl

# system compiler, normally gcc
CC?=gcc

# whether to enable debugging or not
DEBUG?=no

WARNFLAGS= -Wsystem-headers -Werror -Wall -W -Wno-unused-parameter \
	-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \
	-Wold-style-definition -Wreturn-type -Wcast-qual -Wwrite-strings \
	-Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts \
	-Winline -Wnested-externs

SRCS=	tcplay.c crc32.c safe_mem.c io.c hdr.c humanize.c
SRCS+=	crypto.c generic_xts.c
OBJS=	tcplay.o crc32.o safe_mem.o io.o hdr.o humanize.o
OBJS+=	crypto.o generic_xts.o

CFLAGS+= $(WARNFLAGS)

ifeq (${DEBUG}, yes)
  CFLAGS+= -O0 -g -DDEBUG
else
  CFLAGS+= -O3
endif

ifeq (${SYSTEM}, linux)
  CFLAGS+=	-D_GNU_SOURCE
  LIBS+=	-lgcrypt -ldevmapper -luuid
  SRCS+=	crypto-gcrypt.c
  OBJS+=	crypto-gcrypt.o
  ifeq (${PBKDF_BACKEND}, gcrypt)
    SRCS+=	pbkdf2-gcrypt.c
    OBJS+=	pbkdf2-gcrypt.o
  endif
  ifeq (${PBKDF_BACKEND}, openssl)
    SRCS+=	pbkdf2-openssl.c
    OBJS+=	pbkdf2-openssl.o
    LIBS+=	-lcrypto
  endif
endif

ifeq (${SYSTEM}, dragonfly)
  LIBS+=	-lcrypto -ldm -lprop
  SRCS+=	crypto-dev.c
  OBJS+=	crypto-dev.o
  SRCS+=	pbkdf2-openssl.c
  OBJS+=	pbkdf2-openssl.o
endif

program:
	$(CC) $(CFLAGS) -o tcplay main.c $(SRCS) $(LIBS)
lib:
	$(CC) $(CFLAGS) -c -fPIC tcplay_api.c $(SRCS)
	$(CC) -shared -Wl,-version-script=tcplay.map -o libtcplay.so tcplay_api.o $(OBJS)

test:
	gcc -O0 -g -L. -I. tcplay_api_test.c -ltcplay -lcrypto -ldm -lprop
clean:
	rm -f tcplay libtcplay.so tcplay.core *.o ktrace.out

{'fraction_non_alphanumeric': 0.1469599755575924, 'fraction_numerical': 0.007943782462572564, 'mean_word_length': 3.5346260387811634, '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': '1125106', 'n_tokens_mistral': 1480, 'n_tokens_neox': 1446, 'n_words': 334}