<commit_before>PREFIX=prefix/$(TARGET)

PREFIX_BASE_INSTALL=$(PREFIX)/binutils-install
PREFIX_FREESTANDING_INSTALL=$(PREFIX)/gcc-freestanding-install
PREFIX_INSTALL=$(PREFIX)/relibc-install

ifeq ($(PREFIX_RUSTC),1)
	PREFIX_BASE_INSTALL=$(PREFIX)/rust-freestanding-install
	export RUSTUP_TOOLCHAIN=$(ROOT)/$(PREFIX)/rust-freestanding-install
endif

PREFIX_BASE_PATH=$(ROOT)/$(PREFIX_BASE_INSTALL)/bin
PREFIX_FREESTANDING_PATH=$(ROOT)/$(PREFIX_FREESTANDING_INSTALL)/bin
PREFIX_PATH=$(ROOT)/$(PREFIX_INSTALL)/bin

prefix-base: $(PREFIX_BASE_INSTALL)

prefix-freestanding: $(PREFIX_FREESTANDING_INSTALL)

prefix: $(PREFIX_INSTALL)

PREFIX_STRIP=\
	mkdir -p bin libexec "$(TARGET)/bin" && \
	find bin libexec "$(TARGET)/bin" -type f -exec strip {} ';' 2> /dev/null

$(PREFIX)/relibc-install: $(ROOT)/relibc | $(PREFIX)/gcc-install
	rm -rf "$@.partial" "$@"
	cp -r "$(PREFIX)/gcc-install" "$@.partial"
	cd "$<" && \
	export PATH="$(ROOT)/$@.partial/bin:$$PATH" && \
	export CARGO=xargo && \
	make -j `$(NPROC)` headers && \
	make -j `$(NPROC)` install-headers DESTDIR="$(ROOT)/$@.partial/$(TARGET)" && \
	make -j `$(NPROC)` all && \
	make -j `$(NPROC)` install DESTDIR="$(ROOT)/$@.partial/$(TARGET)"
	cd "$@.partial" && $(PREFIX_STRIP)
	touch "$@.partial"
	mv "$@.partial" "$@"

$(PREFIX)/relibc-install.tar.gz: $(PREFIX)/relibc-install
	tar \
		--create \
		--gzip \<commit_msg>Also strip libraries using --strip-unneeded<commit_after>PREFIX=prefix/$(TARGET)

PREFIX_BASE_INSTALL=$(PREFIX)/binutils-install
PREFIX_FREESTANDING_INSTALL=$(PREFIX)/gcc-freestanding-install
PREFIX_INSTALL=$(PREFIX)/relibc-install

ifeq ($(PREFIX_RUSTC),1)
	PREFIX_BASE_INSTALL=$(PREFIX)/rust-freestanding-install
	export RUSTUP_TOOLCHAIN=$(ROOT)/$(PREFIX)/rust-freestanding-install
endif

PREFIX_BASE_PATH=$(ROOT)/$(PREFIX_BASE_INSTALL)/bin
PREFIX_FREESTANDING_PATH=$(ROOT)/$(PREFIX_FREESTANDING_INSTALL)/bin
PREFIX_PATH=$(ROOT)/$(PREFIX_INSTALL)/bin

prefix-base: $(PREFIX_BASE_INSTALL)

prefix-freestanding: $(PREFIX_FREESTANDING_INSTALL)

prefix: $(PREFIX_INSTALL)

PREFIX_STRIP=\
	mkdir -p bin libexec "$(TARGET)/bin" && \
	find bin libexec "$(TARGET)/bin" "$(TARGET)/lib" \
		-type f \
		-exec strip --strip-unneeded {} ';' \
		2> /dev/null

$(PREFIX)/relibc-install: $(ROOT)/relibc | $(PREFIX)/gcc-install
	rm -rf "$@.partial" "$@"
	cp -r "$(PREFIX)/gcc-install" "$@.partial"
	cd "$<" && \
	export PATH="$(ROOT)/$@.partial/bin:$$PATH" && \
	export CARGO=xargo && \
	make -j `$(NPROC)` headers && \
	make -j `$(NPROC)` install-headers DESTDIR="$(ROOT)/$@.partial/$(TARGET)" && \
	make -j `$(NPROC)` all && \
	make -j `$(NPROC)` install DESTDIR="$(ROOT)/$@.partial/$(TARGET)"
	cd "$@.partial" && $(PREFIX_STRIP)
	touch "$@.partial"
	mv "$@.partial" "$@"

$(PREFIX)/relibc-install.tar.gz: $(PREFIX)/relibc-install
	tar \
		--create \
		--gzip \
{'fraction_non_alphanumeric': 0.2128940843074743, 'fraction_numerical': 0.0014169323414806943, 'mean_word_length': 5.275555555555556, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '447633', 'n_tokens_mistral': 1114, 'n_tokens_neox': 1024, 'n_words': 166}