<commit_before>RUSTC ?= rustc
CC ?= gcc
AR ?= ar

PREFIX ?= /usr
DESTDIR ?=

LITHOSLIB = liblithos.rlib
QUIRELIB = rust-quire/libquire.rlib
ARGPARSELIB = rust-argparse/libargparse.rlib

all: quire argparse lithos_tree lithos_knot lithos_check lithos_cmd
test: lithos_test
	./lithos_test


$(LITHOSLIB): src/*.rs src/*/*.rs libcontainer.a
	$(RUSTC) src/lib.rs -g -o $@ \
		-L rust-quire -L rust-argparse -L .

lithos_test: $(ARGPARSELIB) $(QUIRELIB) src/*.rs src/*/*.rs libcontainer.a
	$(RUSTC) src/lib.rs --test -g -o $@ \
		-L rust-quire -L rust-argparse -L .

lithos_tree: $(ARGPARSELIB) $(QUIRELIB) $(LITHOSLIB) src/bin/lithos_tree.rs
	$(RUSTC) src/bin/lithos_tree.rs -g -o $@ \
		-L rust-quire -L rust-argparse -L .

lithos_check: $(ARGPARSELIB) $(QUIRELIB) $(LITHOSLIB) src/bin/lithos_check.rs
	$(RUSTC) src/bin/lithos_check.rs -g -o $@ \
		-L rust-quire -L rust-argparse -L .

lithos_knot: $(ARGPARSELIB) $(QUIRELIB) $(LITHOSLIB) src/bin/lithos_knot.rs
	$(RUSTC) src/bin/lithos_knot.rs -g -o $@ \
		-L rust-quire -L rust-argparse -L .

lithos_cmd: $(ARGPARSELIB) $(QUIRELIB) $(LITHOSLIB) src/bin/lithos_cmd.rs
	$(RUSTC) src/bin/lithos_cmd.rs -g -o $@ \
		-L rust-quire -L rust-argparse -L .

container.o: container.c
	$(CC) -c $< -o $@ -fPIC -D_GNU_SOURCE -std=c99

libcontainer.a: container.o
	$(AR) rcs $@ $^

quire:
	make -C rust-quire quire-lib

argparse:
	make -C rust-argparse argparse-lib

install:
	install -d $(DESTDIR)$(PREFIX)/bin
	install -m 755 lithos_tree $(DESTDIR)$(PREFIX)/bin/lithos_tree
	install -m 755 lithos_knot $(DESTDIR)$(PREFIX)/bin/lithos_knot
	install -m 755 lithos_check $(DESTDIR)$(PREFIX)/bin/lithos_check
	install -m 755 bin/lithos_mkdev $(DESTDIR)$(PREFIX)/bin/lithos_mkdev


.PHONY: all quire argparse install test
<commit_msg>Add `lithos_cmd` to installation script<commit_after>RUSTC ?= rustc
CC ?= gcc
AR ?= ar

PREFIX ?= /usr
DESTDIR ?=

LITHOSLIB = liblithos.rlib
QUIRELIB = rust-quire/libquire.rlib
ARGPARSELIB = rust-argparse/libargparse.rlib

all: quire argparse lithos_tree lithos_knot lithos_check lithos_cmd
test: lithos_test
	./lithos_test


$(LITHOSLIB): src/*.rs src/*/*.rs libcontainer.a
	$(RUSTC) src/lib.rs -g -o $@ \
		-L rust-quire -L rust-argparse -L .

lithos_test: $(ARGPARSELIB) $(QUIRELIB) src/*.rs src/*/*.rs libcontainer.a
	$(RUSTC) src/lib.rs --test -g -o $@ \
		-L rust-quire -L rust-argparse -L .

lithos_tree: $(ARGPARSELIB) $(QUIRELIB) $(LITHOSLIB) src/bin/lithos_tree.rs
	$(RUSTC) src/bin/lithos_tree.rs -g -o $@ \
		-L rust-quire -L rust-argparse -L .

lithos_check: $(ARGPARSELIB) $(QUIRELIB) $(LITHOSLIB) src/bin/lithos_check.rs
	$(RUSTC) src/bin/lithos_check.rs -g -o $@ \
		-L rust-quire -L rust-argparse -L .

lithos_knot: $(ARGPARSELIB) $(QUIRELIB) $(LITHOSLIB) src/bin/lithos_knot.rs
	$(RUSTC) src/bin/lithos_knot.rs -g -o $@ \
		-L rust-quire -L rust-argparse -L .

lithos_cmd: $(ARGPARSELIB) $(QUIRELIB) $(LITHOSLIB) src/bin/lithos_cmd.rs
	$(RUSTC) src/bin/lithos_cmd.rs -g -o $@ \
		-L rust-quire -L rust-argparse -L .

container.o: container.c
	$(CC) -c $< -o $@ -fPIC -D_GNU_SOURCE -std=c99

libcontainer.a: container.o
	$(AR) rcs $@ $^

quire:
	make -C rust-quire quire-lib

argparse:
	make -C rust-argparse argparse-lib

install:
	install -d $(DESTDIR)$(PREFIX)/bin
	install -m 755 lithos_tree $(DESTDIR)$(PREFIX)/bin/lithos_tree
	install -m 755 lithos_knot $(DESTDIR)$(PREFIX)/bin/lithos_knot
	install -m 755 lithos_check $(DESTDIR)$(PREFIX)/bin/lithos_check
	install -m 755 lithos_cmd $(DESTDIR)$(PREFIX)/bin/lithos_cmd
	install -m 755 bin/lithos_mkdev $(DESTDIR)$(PREFIX)/bin/lithos_mkdev


.PHONY: all quire argparse install test

{'fraction_non_alphanumeric': 0.1649171270718232, 'fraction_numerical': 0.00856353591160221, 'mean_word_length': 3.751968503937008, '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': '991882', 'n_tokens_mistral': 1696, 'n_tokens_neox': 1606, 'n_words': 333}