<commit_before># Kore Makefile

CC=gcc
BIN=kore

S_SRC+=	src/kore.c src/accesslog.c src/auth.c src/buf.c src/config.c \
	src/connection.c src/domain.c src/http.c src/mem.c src/module.c \
	src/net.c src/pool.c src/spdy.c src/validator.c src/utils.c \
	src/worker.c src/zlib_dict.c
S_OBJS=	$(S_SRC:.c=.o)

CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes
CFLAGS+=-Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual
CFLAGS+=-Wsign-compare -Iincludes -g
LDFLAGS+=-rdynamic -lssl -lcrypto -lz

ifneq ("$(DEBUG)", "")
	CFLAGS+=-DKORE_DEBUG
endif

ifneq ("$(KORE_PEDANTIC_MALLOC)", "")
	CFLAGS+=-DKORE_PEDANTIC_MALLOC
endif

ifneq ("$(PGSQL)", "")
	S_SRC+=src/pgsql.c
	LDFLAGS+=-L$(shell pg_config --libdir) -lpq
	CFLAGS+=-I$(shell pg_config --includedir) -DKORE_USE_PGSQL
endif

ifneq ("$(TASKS)", "")
	S_SRC+=src/tasks.c
	LDFLAGS+=-lpthread
	CFLAGS+=-DKORE_USE_TASKS
endif

OSNAME=$(shell uname -s | sed -e 's/[-_].*//g' | tr A-Z a-z)
ifeq ("$(OSNAME)", "darwin")
	CFLAGS+=-I/opt/local/include/
	LDFLAGS+=-L/opt/local/lib
	S_SRC+=src/bsd.c
else ifeq ("$(OSNAME)", "linux")
	CFLAGS+=-D_GNU_SOURCE=1
	LDFLAGS+=-ldl
	S_SRC+=src/linux.c
else
	S_SRC+=src/bsd.c
endif

all: $(S_OBJS)
	$(CC) $(CFLAGS) $(S_OBJS) $(LDFLAGS) -o $(BIN)

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

clean:
	find . -type f -name \*.o -exec rm {} \;
	rm -f $(BIN)

.PHONY: clean<commit_msg>Add install/uninstall targets.<commit_after># Kore Makefile

CC=gcc
BIN=kore
INSTALL_DIR=/usr/local/bin

S_SRC+=	src/kore.c src/accesslog.c src/auth.c src/buf.c src/config.c \
	src/connection.c src/domain.c src/http.c src/mem.c src/module.c \
	src/net.c src/pool.c src/spdy.c src/validator.c src/utils.c \
	src/worker.c src/zlib_dict.c
S_OBJS=	$(S_SRC:.c=.o)

CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes
CFLAGS+=-Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual
CFLAGS+=-Wsign-compare -Iincludes -g
LDFLAGS+=-rdynamic -lssl -lcrypto -lz

ifneq ("$(DEBUG)", "")
	CFLAGS+=-DKORE_DEBUG
endif

ifneq ("$(KORE_PEDANTIC_MALLOC)", "")
	CFLAGS+=-DKORE_PEDANTIC_MALLOC
endif

ifneq ("$(PGSQL)", "")
	S_SRC+=src/pgsql.c
	LDFLAGS+=-L$(shell pg_config --libdir) -lpq
	CFLAGS+=-I$(shell pg_config --includedir) -DKORE_USE_PGSQL
endif

ifneq ("$(TASKS)", "")
	S_SRC+=src/tasks.c
	LDFLAGS+=-lpthread
	CFLAGS+=-DKORE_USE_TASKS
endif

OSNAME=$(shell uname -s | sed -e 's/[-_].*//g' | tr A-Z a-z)
ifeq ("$(OSNAME)", "darwin")
	CFLAGS+=-I/opt/local/include/
	LDFLAGS+=-L/opt/local/lib
	S_SRC+=src/bsd.c
else ifeq ("$(OSNAME)", "linux")
	CFLAGS+=-D_GNU_SOURCE=1
	LDFLAGS+=-ldl
	S_SRC+=src/linux.c
else
	S_SRC+=src/bsd.c
endif

all: $(S_OBJS)
	$(CC) $(CFLAGS) $(S_OBJS) $(LDFLAGS) -o $(BIN)

install:
	install -m 555 $(BIN) $(INSTALL_DIR)/$(BIN)

uninstall:
	rm -f $(INSTALL_DIR)/$(BIN)

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

clean:
	find . -type f -name \*.o -exec rm {} \;
	rm -f $(BIN)

.PHONY: clean
{'fraction_non_alphanumeric': 0.20789657582110413, 'fraction_numerical': 0.0017470300489168414, 'mean_word_length': 3.9108061749571186, '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': '385631', 'n_tokens_mistral': 1350, 'n_tokens_neox': 1306, 'n_words': 244}