<commit_before>ifneq ($(MYRLIB),)
    _LIBNAME=lib$(MYRLIB).a
endif

all: subdirs $(_LIBNAME) $(MYRBIN) 

subdirs:
	@for i in $(SUB); do (\
	    cd $$i && \
	    $(MAKE) || \
	    exit 1 \
	) || exit 1; done

subdirs-clean:
	@for i in $(SUB); do (\
	    cd $$i && \
	    $(MAKE) clean|| \
	    exit 1 \
	); done

subdirs-install:
	@for i in $(SUB); do (\
	    cd $$i && \
	    $(MAKE) install|| \
	    exit 1 \
	); done

subdirs-uninstall:
	@for i in $(SUB); do (\
	    cd $$i && \
	    $(MAKE) uninstall|| \
	    exit 1 \
	); done

$(_LIBNAME): $(MYRSRC) $(ASMSRC)
	myrbuild -l $(MYRLIB) $^

$(MYRBIN): $(MYRSRC) $(ASMSRC)
	myrbuild -b $(MYRBIN) $^

OBJ=$(MYRSRC:.myr=.o) $(ASMSRC:.s=.o)
USE=$(MYRSRC:.myr=.use) $(MYRLIB)
.PHONY: clean
clean: subdirs-clean
	rm -f $(OBJ)
	rm -f $(USE)
	rm -f lib$(MYRLIB).a

install: subdirs-install install-bin install-lib install-man
uninstall: subdirs-uninstall uninstall-bin uninstall-lib uninstall-man

install-bin: $(MYRBIN)
	@if [ ! -z "$(MYRBIN)" ]; then \
	    echo install $(MYRBIN) $(INST_ROOT)/bin; \
	    mkdir -p $(INST_ROOT)/bin; \
	    install $(MYRBIN) $(INST_ROOT)/bin; \
	fi

install-lib: $(_LIBNAME)
	@if [ ! -z "$(_LIBNAME)" ]; then \
		echo install -m 644 $(_LIBNAME) $(INST_ROOT)/lib/myr; \
		echo install -m 644 $(MYRLIB) $(INST_ROOT)/lib/myr; \
		mkdir -p $(INST_ROOT)/lib/myr; \
		install -m 644 $(_LIBNAME) $(INST_ROOT)/lib/myr; \
		install -m 644 $(MYRLIB) $(INST_ROOT)/lib/myr; \
	fi

install-man:
	@for i in $(MAN); do \
	    MANSECT=$$(echo $$i | awk -F. '{print $$NF}'); \
	    echo mkdir -p $(INST_ROOT)/share/man/man$$MANSECT; \
	    echo install -m 644 $(MAN) $(INST_ROOT)/share/man/man$${MANSECT}; \
	    mkdir -p $(INST_ROOT)/share/man/man$$MANSECT; \
	    install -m 644 $(MAN) $(INST_ROOT)/share/man/man$${MANSECT}; \
	done \

uninstall-bin: $(MYRBIN)
	@for i in $(MYRBIN); do \
	    echo rm -f $(INST_ROOT)/bin/$$i; \
	    rm -f $(INST_ROOT)/bin/$$i; \
	done

uninstall-lib: $(_LIBNAME)
	@for i in $(_LIBNAME) $(MYRLIB); do \
	    echo rm -f $(INST_ROOT)/lib/myr/$$i; \
	    rm -f $(INST_ROOT)/lib/myr/$$i; \
	done

uninstall-man:
	@for i in $(MAN); do \
	    MANSECT=$$(echo $$i | awk -F. '{print $$NF}'); \
	    echo rm -f $(INST_ROOT)/share/man/man$${MANSECT}/$$i; \
	    rm -f $(INST_ROOT)/share/man/man$${MANSECT}/$$i; \<commit_msg>Update the makefile template<commit_after>ifneq ($(MYRLIB),)
    _LIBNAME=lib$(MYRLIB).a
endif

all: subdirs $(_LIBNAME) $(MYRBIN) 

subdirs:
	@for i in $(SUB); do (\
	    cd $$i && \
	    $(MAKE) || \
	    exit 1 \
	) || exit 1; done

subdirs-clean:
	@for i in $(SUB); do (\
	    cd $$i && \
	    $(MAKE) clean|| \
	    exit 1 \
	); done

subdirs-install:
	@for i in $(SUB); do (\
	    cd $$i && \
	    $(MAKE) install|| \
	    exit 1 \
	); done

subdirs-uninstall:
	@for i in $(SUB); do (\
	    cd $$i && \
	    $(MAKE) uninstall|| \
	    exit 1 \
	); done

$(_LIBNAME): $(MYRSRC) $(ASMSRC)
	myrbuild -l $(MYRLIB) $^

$(MYRBIN): $(MYRSRC) $(ASMSRC)
	myrbuild -b $(MYRBIN) $^

OBJ=$(MYRSRC:.myr=.o) $(ASMSRC:.s=.o)
USE=$(MYRSRC:.myr=.use) $(MYRLIB)
.PHONY: clean
clean: subdirs-clean
	rm -f $(OBJ)
	rm -f $(USE)
	@if [ ! -z "$(MYRLIB)" ]; then \
	    echo rm -f $(MYRLIB); \
	    rm -f $(MYRLIB); \
	    echo rm -f lib$(MYRLIB).a; \
	    rm -f lib$(MYRLIB).a; \
	fi
	@if [ ! -z "$(MYRBIN)" ]; then \
	    echo rm -f $(MYRBIN); \
	    rm -f $(MYRBIN); \
	    echo rm -f lib$(MYRBIN).a; \
	    rm -f lib$(MYRBIN).a; \
	fi

install: subdirs-install $(MYRBIN) $(_LIBNAME) $(MAN)
	@if [ ! -z "$(MYRBIN)" ]; then \
	    echo install $(MYRBIN) $(abspath $(DESTDIR)/$(INST_ROOT)/bin); \
	    mkdir -p $(abspath $(DESTDIR)/$(INST_ROOT)/bin); \
	    install $(MYRBIN) $(abspath $(DESTDIR)/$(INST_ROOT)/bin); \
	fi
	@if [ ! -z "$(_LIBNAME)" ]; then \
		echo install -m 644 $(_LIBNAME) $(abspath $(DESTDIR)/$(INST_ROOT)/lib/myr); \
		echo install -m 644 $(MYRLIB) $(abspath $(DESTDIR)/$(INST_ROOT)/lib/myr); \
		mkdir -p $(abspath $(DESTDIR)/$(INST_ROOT)/lib/myr; \
		install -m 644 $(_LIBNAME) $(abspath $(DESTDIR)/$(INST_ROOT)/lib/myr); \
		install -m 644 $(MYRLIB) $(abspath $(DESTDIR)/$(INST_ROOT)/lib/myr); \
	fi
	@for i in $(MAN); do \
	    MANSECT=$$(echo $$i | awk -F. '{print $$NF}'); \
	    echo mkdir -p $(abspath $(DESTDIR)/$(INST_ROOT)/share/man/man$$MANSECT); \
	    echo install -m 644 $(MAN) $(abspath $(DESTDIR)/$(INST_ROOT)/share/man/man$${MANSECT}); \
	    mkdir -p $(abspath $(DESTDIR)/$(INST_ROOT)/share/man/man$$MANSECT); \
	    install -m 644 $(MAN) $(abspath $(DESTDIR)/$(INST_ROOT)/share/man/man$${MANSECT}); \
	done \

uninstall: subdirs-uninstall
	@for i in $(MYRBIN); do \
	    echo rm -f $(abspath $(DESTDIR)/$(INST_ROOT)/bin/$$i); \
	    rm -f $(abspath $(DESTDIR)/$(INST_ROOT)/bin/$$i); \
	done
	@for i in $(_LIBNAME) $(MYRLIB); do \
	    echo rm -f $(abspath $(DESTDIR)/$(INST_ROOT)/lib/myr/$$i); \
	    rm -f $(abspath $(DESTDIR)/$(INST_ROOT)/lib/myr/$$i); \
	done
	@for i in $(MAN); do \
	    MANSECT=$$(echo $$i | awk -F. '{print $$NF}'); \
	    echo rm -f $(abspath $(DESTDIR)/$(INST_ROOT)/share/man/man$${MANSECT}/$$i); \
	    rm -f $(abspath $(DESTDIR)/$(INST_ROOT)/share/man/man$${MANSECT}/$$i); \
{'fraction_non_alphanumeric': 0.23500778816199377, 'fraction_numerical': 0.00895638629283489, 'mean_word_length': 2.7551169590643276, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6755896', 'n_tokens_mistral': 2357, 'n_tokens_neox': 2207, 'n_words': 503}