<commit_before>.PHONY: clean
all: link

INSTALL_PREFIX?=$(HOME)

OS=$(shell uname -s | tr A-Z a-z)
_ARCH=$(shell uname -m)
ifeq ($(_ARCH), armv6l)
ARCH=armv6l
else ifeq ($(_ARCH), armv7l)
# ARMv6 is upwards compatible with ARMv7
ARCH=armv6l
else ifeq ($(_ARCH), x86_64)
ARCH=amd64
else
ARCH=386
endif

VERSION=go1.13.8

ARCHIVE=$(VERSION).$(OS)-$(ARCH).tar.gz
INSTALL_DIR=$(INSTALL_PREFIX)/.local/opt
INSTALL_PATH=$(INSTALL_DIR)/$(VERSION)
INSTALL_LINK=$(INSTALL_DIR)/go

$(ARCHIVE):
	curl -L https://storage.googleapis.com/golang/$(ARCHIVE) -o $(ARCHIVE)

$(INSTALL_PATH):| $(ARCHIVE)
	tar -xzf $(ARCHIVE)
	mkdir -p $(INSTALL_DIR)
	mv go $(INSTALL_PATH)

clean:
	rm $(ARCHIVE)

$(INSTALL_LINK): $(INSTALL_PATH)
	@touch $(INSTALL_LINK)
	@rm $(INSTALL_LINK)
	ln -si $(INSTALL_PATH) $(INSTALL_LINK)

link: $(INSTALL_LINK)

src:
	@git clone https://go.googlesource.com/go src

.PHONY: update
update: src
	@cd src; git fetch
	$(eval NEW_VERSION := $(shell cd src && git tag | grep -E ^go[0-9]+\.[0-9]+\.[0-9]+$ | sort --version-sort | tail -n 1))
	@if [ "$(NEW_VERSION)" = "" ]; then echo failed to fetch tag; exit 1; fi
	@sed -i -e "s/VERSION=$(VERSION)/VERSION=$(NEW_VERSION)/" Makefile
	$(MAKE) link<commit_msg>go 1.14<commit_after>.PHONY: clean
all: link

INSTALL_PREFIX?=$(HOME)

OS=$(shell uname -s | tr A-Z a-z)
_ARCH=$(shell uname -m)
ifeq ($(_ARCH), armv6l)
ARCH=armv6l
else ifeq ($(_ARCH), armv7l)
# ARMv6 is upwards compatible with ARMv7
ARCH=armv6l
else ifeq ($(_ARCH), x86_64)
ARCH=amd64
else
ARCH=386
endif

VERSION=go1.14

ARCHIVE=$(VERSION).$(OS)-$(ARCH).tar.gz
INSTALL_DIR=$(INSTALL_PREFIX)/.local/opt
INSTALL_PATH=$(INSTALL_DIR)/$(VERSION)
INSTALL_LINK=$(INSTALL_DIR)/go

$(ARCHIVE):
	curl -L https://storage.googleapis.com/golang/$(ARCHIVE) -o $(ARCHIVE)

$(INSTALL_PATH):| $(ARCHIVE)
	tar -xzf $(ARCHIVE)
	mkdir -p $(INSTALL_DIR)
	mv go $(INSTALL_PATH)

clean:
	rm $(ARCHIVE)

$(INSTALL_LINK): $(INSTALL_PATH)
	@touch $(INSTALL_LINK)
	@rm $(INSTALL_LINK)
	ln -si $(INSTALL_PATH) $(INSTALL_LINK)

link: $(INSTALL_LINK)

src:
	@git clone https://go.googlesource.com/go src

.PHONY: update
update: src
	@cd src; git fetch
	$(eval NEW_VERSION := $(shell cd src && git tag | grep -E -e '^go[0-9]+\.[0-9]+\.[0-9]+$$' -e '^go[0-9]+\.[0-9]+$$' | sort --version-sort | tail -n 1))
	@if [ "$(NEW_VERSION)" = "" ]; then echo failed to fetch tag; exit 1; fi
	@sed -i -e "s/VERSION=$(VERSION)/VERSION=$(NEW_VERSION)/" Makefile
	$(MAKE) link
{'fraction_non_alphanumeric': 0.19975440032746622, 'fraction_numerical': 0.024559967253376995, 'mean_word_length': 4.805225653206651, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '6577025', 'n_tokens_mistral': 1048, 'n_tokens_neox': 973, 'n_words': 243}