<commit_before>include Makefile.DEF

CFLAGS=-O3 -std=c11 $(OPTFLAGS)
LIBS=$(OPTLIBS)
PREFIX?=/usr/local

SOURCES=$(wildcard src/**/*.c src/*.c)
OBJECTS=$(patsubst %.c,%.o,$(SOURCES))

TEST_SRC=$(wildcard tests/**/*_tests.c)
TESTS=$(patsubst %.c,%,$(TEST_SRC))

SAMPLES_SRC=$(wildcard samples/**/*.c)
SAMPLES=$(patsubst samples/%.c,bin/%,$(SAMPLES_SRC))

LIB_VERSION=$(MAJOR).$(MINOR)
TARGET=build/lib$(LIB_NAME).a
SO_TARGET=build/lib$(LIB_NAME).so.$(LIB_VERSION)

# The Target Build

all: CFLAGS += -Isrc -DNDEBUG
all: $(TARGET) $(SO_TARGET)

dev: CFLAGS += -g -Isrc -Wall -Wextra -Werror -pedantic
dev: $(TARGET) $(SO_TARGET)
	cd lib; \
	ln -fs ../$(SO_TARGET) lib$(LIB_NAME).so.$(MAJOR); \
	ln -fs lib$(LIB_NAME).so.$(MAJOR) lib$(LIB_NAME).so

$(SO_TARGET): BUILD_DYNAMIC=1
$(SO_TARGET): $(TARGET) $(OBJECTS)
	$(CC) -shared -Wl,-soname,lib$(LIB_NAME).so.$(MAJOR) $(OBJECTS) -o $@ -lc

$(TARGET): CFLAGS += -fPIC
$(TARGET): build $(OBJECTS)
	ar rcs $@ $(OBJECTS)
	ranlib $@

build:
	@mkdir -p build
	@mkdir -p bin
	@mkdir -p lib

# The Unit Tests
.PHONY: tests
tests: LDLIBS = -l$(LIB_NAME)
tests: LDFLAGS = -Wl,-rpath,./lib/ -L./lib/
tests: CFLAGS += -g -Isrc -Wall -Wextra -Werror
tests: lib $(TESTS)
	sh ./tests/basic_tests.sh

samples: $(SAMPLES)
<commit_msg>renamed Makefile targets<commit_after>include Makefile.DEF

CFLAGS=-O3 -std=c11 $(OPTFLAGS)
LIBS=$(OPTLIBS)
PREFIX?=/usr/local

SOURCES=$(wildcard src/**/*.c src/*.c)
OBJECTS=$(patsubst %.c,%.o,$(SOURCES))

TEST_SRC=$(wildcard tests/**/*_tests.c)
TESTS=$(patsubst %.c,%,$(TEST_SRC))

SAMPLES_SRC=$(wildcard samples/**/*.c)
SAMPLES=$(patsubst samples/%.c,bin/%,$(SAMPLES_SRC))

LIB_VERSION=$(MAJOR).$(MINOR)
TARGET=build/lib$(LIB_NAME).a
SO_TARGET=build/lib$(LIB_NAME).so.$(LIB_VERSION)

# The Target Build

release: CFLAGS += -Isrc -DNDEBUG
release: $(TARGET) $(SO_TARGET)

debug: CFLAGS += -g -Isrc -Wall -Wextra -Werror -pedantic
debug: $(TARGET) $(SO_TARGET)
	cd lib; \
	ln -fs ../$(SO_TARGET) lib$(LIB_NAME).so.$(MAJOR); \

$(SO_TARGET): BUILD_DYNAMIC=1
$(SO_TARGET): $(TARGET) $(OBJECTS)
	$(CC) -shared -Wl,-soname,lib$(LIB_NAME).so.$(MAJOR) $(OBJECTS) -o $@ -lc
	cd build; ln -sf lib$(LIB_NAME).so.$(MAJOR) lib$(LIB_NAME).so

$(TARGET): CFLAGS += -fPIC
$(TARGET): build $(OBJECTS)
	ar rcs $@ $(OBJECTS)
	ranlib $@

build:
	@mkdir -p build
	@mkdir -p bin
	@mkdir -p lib

# The Unit Tests
.PHONY: tests
tests: LDLIBS = -l$(LIB_NAME)
tests: LDFLAGS = -Wl,-rpath,./lib/ -L./lib/
tests: CFLAGS += -g -Isrc -Wall -Wextra -Werror
tests: lib $(TESTS)
	sh ./tests/basic_tests.sh

samples: $(SAMPLES)

{'fraction_non_alphanumeric': 0.22217883639203437, 'fraction_numerical': 0.0031237797735259665, 'mean_word_length': 4.606126914660831, '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': '2413049', 'n_tokens_mistral': 1117, 'n_tokens_neox': 1091, 'n_words': 226}