<commit_before># Installation directories following GNU conventions
prefix ?= /usr/local
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
sbindir = $(exec_prefix)/sbin
datarootdir = $(prefix)/share
datadir = $(datarootdir)
includedir = $(prefix)/include
mandir = $(datarootdir)/man
libdir = $(prefix)/lib

BIN=bin
OBJ=obj
SRC=src
LIB=lib

CC ?= gcc
CFLAGS ?= -Wextra -Wall -iquote$(SRC) -fpic

.PHONY: all install uninstall clean

HEADERS = libnms.h
LIBRARIES = libnms.so

all: $(LIBRARIES)
	
libnms.so: $(OBJ)/libnms.o | $(LIB)
	$(CC) -shared -o $(LIB)/$@ $^

$(OBJ)/%.o: $(SRC)/%.c | $(OBJ)
	$(CC) $(CFLAGS) -o $@ -c $<

$(LIB):
	mkdir -p $(LIB)

$(OBJ):
	mkdir -p $(OBJ)

clean:
	rm -rf $(LIB)
	rm -rf $(OBJ)

install:
	install -d $(DESTDIR)$(libdir)
	install -d $(DESTDIR)$(includedir)
	cd $(LIB) && install $(LIBRARIES) $(DESTDIR)$(libdir)
	cd $(SRC) && install $(HEADERS) $(DESTDIR)$(includedir)

uninstall:
	for library in $(LIBRARIES); do rm $(DESTDIR)$(libdir)/$$library; done
	for header in $(HEADERS); do rm $(DESTDIR)$(includedir)/$$header; done<commit_msg>Add /usr/local/lib to ldconfig when installing. Remove when uninstalling.<commit_after># Installation directories following GNU conventions
prefix ?= /usr/local
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
sbindir = $(exec_prefix)/sbin
datarootdir = $(prefix)/share
datadir = $(datarootdir)
includedir = $(prefix)/include
mandir = $(datarootdir)/man
libdir = $(prefix)/lib

BIN=bin
OBJ=obj
SRC=src
LIB=lib

CC ?= gcc
CFLAGS ?= -Wextra -Wall -iquote$(SRC) -fpic

HEADERS = libnms.h
LIBRARIES = libnms.so

.PHONY: all install uninstall clean

all: $(LIBRARIES)
	
libnms.so: $(OBJ)/libnms.o | $(LIB)
	$(CC) -shared -o $(LIB)/$@ $^

$(OBJ)/%.o: $(SRC)/%.c | $(OBJ)
	$(CC) $(CFLAGS) -o $@ -c $<

$(LIB):
	mkdir -p $(LIB)

$(OBJ):
	mkdir -p $(OBJ)

clean:
	rm -rf $(LIB)
	rm -rf $(OBJ)

install:
	install -d $(DESTDIR)$(libdir)
	install -d $(DESTDIR)$(includedir)
	cd $(LIB) && install $(LIBRARIES) $(DESTDIR)$(libdir)
	cd $(SRC) && install $(HEADERS) $(DESTDIR)$(includedir)
	if [ -d /etc/ld.so.conf.d ]; then \
		echo "$(DESTDIR)$(libdir)" > /etc/ld.so.conf.d/libnms.conf ; \
	fi
	ldconfig

uninstall:
	for library in $(LIBRARIES); do rm $(DESTDIR)$(libdir)/$$library; done
	for header in $(HEADERS); do rm $(DESTDIR)$(includedir)/$$header; done
	if [ -a /etc/ld.so.conf.d/libnms.conf ] ; then \
		rm /etc/ld.so.conf.d/libnms.conf ; \
	fi
{'fraction_non_alphanumeric': 0.2055532532117696, 'fraction_numerical': 0.0, 'mean_word_length': 4.2592592592592595, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '4339836', 'n_tokens_mistral': 1030, 'n_tokens_neox': 978, 'n_words': 241}