<commit_before>IMAGE = builder-sarg

USERID = $(shell id -u)
GROUPID = $(shell id -g)

.PHONY: all show clean build package shell

ifndef BUILD_NUMBER
BUILD_NUMBER = 0
endif

ifndef TARGET
$(error TARGET is not set)
endif

all: show image package clean

show:
	@echo '==> IMAGE=$(IMAGE) BUILD_NUMBER=$(BUILD_NUMBER) TARGET=$(TARGET)'

Dockerfile:
	@cat Dockerfile.template | \
		sed -e "s@{userid}@$(USERID)@" -e "s@{groupid}@$(GROUPID)@" -e "s@{target}@$(TARGET)@" | \
		tee Dockerfile

image: show Dockerfile
	docker build -t $(IMAGE) .

clean:
	@rm -f Dockerfile
	@rm -rf build-env

build-env:
	cp -r volume build-env

package: build-env
	docker run --rm -v $(PWD)/build-env/:/home/builder/build \
		-e BUILD_NUMBER=$(BUILD_NUMBER) -e TARGET=$(TARGET) -t $(IMAGE)

shell: build-env
	docker run -it --rm -v $(PWD)/build-env/:/home/builder/build \
		-e BUILD_NUMBER=$(BUILD_NUMBER) -e TARGET=$(TARGET) -t $(IMAGE) /bin/bash<commit_msg>Include Makefile<commit_after>IMAGE = builder-sarg
TARGET = sarg.spec

include ../../include/Makefile
{'fraction_non_alphanumeric': 0.1677917068466731, 'fraction_numerical': 0.0009643201542912247, 'mean_word_length': 4.038834951456311, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '7613799', 'n_tokens_mistral': 401, 'n_tokens_neox': 383, 'n_words': 105}