<commit_before>RUSTC ?= rustc
ifdef DEBUG
RUSTFLAGS ?= -g
else
RUSTFLAGS ?= -O --cfg ndebug
endif

TARGETS := c64

LIBSDL2 := libsdl2-79c1f430-0.0.1.rlib

all: $(TARGETS)

$(TARGETS): %: build/%

run: build/$(firstword $(TARGETS))
	RUST_LOG=$(firstword $(TARGETS)) $<

check: build/test
	$<

clean:
	rm -rf build sdl2/build

distclean: clean
	$(MAKE) -C vendor/sdl2 clean

.PHONY: all $(TARGETS) run check clean distclean

$(patsubst %,build/%,$(TARGETS)): build/%: src/bin.rs build/$(LIBSDL2)
	mkdir -p build
	$(RUSTC) $(RUSTFLAGS) --dep-info build/$*.d -L build --cfg $* -o $@ $<

build/test: src/test.rs build/$(LIBSDL2)
	mkdir -p build
	$(RUSTC) $(RUSTFLAGS) --dep-info build/test.d -L build --test -o $@ $<

-include $(patsubst %,build/%.d,$(TARGETS))
-include build/test.d

build/$(LIBSDL2):
	$(MAKE) -C vendor/sdl2 build/tmp/libsdl2.dummy
	mkdir -p build<commit_msg>Remove obsolete directory from clean target<commit_after>RUSTC ?= rustc
ifdef DEBUG
RUSTFLAGS ?= -g
else
RUSTFLAGS ?= -O --cfg ndebug
endif

TARGETS := c64

LIBSDL2 := libsdl2-79c1f430-0.0.1.rlib

all: $(TARGETS)

$(TARGETS): %: build/%

run: build/$(firstword $(TARGETS))
	RUST_LOG=$(firstword $(TARGETS)) $<

check: build/test
	$<

clean:
	rm -rf build

distclean: clean
	$(MAKE) -C vendor/sdl2 clean

.PHONY: all $(TARGETS) run check clean distclean

$(patsubst %,build/%,$(TARGETS)): build/%: src/bin.rs build/$(LIBSDL2)
	mkdir -p build
	$(RUSTC) $(RUSTFLAGS) --dep-info build/$*.d -L build --cfg $* -o $@ $<

build/test: src/test.rs build/$(LIBSDL2)
	mkdir -p build
	$(RUSTC) $(RUSTFLAGS) --dep-info build/test.d -L build --test -o $@ $<

-include $(patsubst %,build/%.d,$(TARGETS))
-include build/test.d

build/$(LIBSDL2):
	$(MAKE) -C vendor/sdl2 build/tmp/libsdl2.dummy
	mkdir -p build
{'fraction_non_alphanumeric': 0.1943342776203966, 'fraction_numerical': 0.02209631728045326, 'mean_word_length': 3.7989130434782608, 'pattern_counts': {'":': 0, '<': 11, '<?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': '3236749', 'n_tokens_mistral': 770, 'n_tokens_neox': 728, 'n_words': 179}