<commit_before>TARGET = sango

DATE := $(shell date "+%Y%m%d_%H%M%S")
BUILD_DATE := $(shell date)

DEST_PATH := $(shell pwd)

REVISION :=$(shell git log --pretty=format:'' | wc -l | sed 's/\ //g')

REVERT := git checkout
GIT_SHA1 := $(shell git log -1 --pretty=format:'%h')

all:
	@echo "Targets:"
	@echo "   distro"
	@echo "   install"
	@echo "   run"
	@echo "   clean"

_clean_temps:
	@rm -rdf temp
	@rm -rdf temp_ios
	@rm -rdf temp_android
	
clean: _clean_temps clear_build
	@xcodebuild clean &>/dev/null
	@rm -rdf build
	@rm -f $(TARGET)

distro: clean set_build
	@xcodebuild
	@cp ./build/Release/Sango $(TARGET)
	@$(MAKE) clear_build
	@echo done!

set_build:
	@echo "public let BUILD_DATE = "\"$(BUILD_DATE)\" > Source/Version.swift
	@echo "public let BUILD_REVISION = $(REVISION)" >> Source/Version.swift

clear_build:
	@$(REVERT) Source/Version.swift

install: distro
	@sudo cp $(TARGET) /usr/local/bin/$(TARGET)

test1: _clean_temps
	@./$(TARGET) -config brand1_config.json -verbose

test2: _clean_temps
	@./$(TARGET) -config brand2_config.json -verbose

test3: _clean_temps
	@./$(TARGET) -config brand1_android.json -verbose

run: distro
	@./$(TARGET) -input example/source.json \
				-swift \
				-out_source temp_ios/Constants.swift \
				-input_assets example/assets \
				-out_assets temp_ios/Resources
	@./$(TARGET) -input example/source.json \
				-java \
				-out_source temp_android/Constants.java \
				-input_assets example/assets \
				-out_assets temp_android

<commit_msg>Make use of sudo for install step optional, depending upon whether the target dir is user-writable<commit_after>TARGET = sango

DATE := $(shell date "+%Y%m%d_%H%M%S")
BUILD_DATE := $(shell date)

DEST_PATH := $(shell pwd)

REVISION :=$(shell git log --pretty=format:'' | wc -l | sed 's/\ //g')

REVERT := git checkout
GIT_SHA1 := $(shell git log -1 --pretty=format:'%h')

all:
	@echo "Targets:"
	@echo "   distro"
	@echo "   install"
	@echo "   run"
	@echo "   clean"

_clean_temps:
	@rm -rdf temp
	@rm -rdf temp_ios
	@rm -rdf temp_android
	
clean: _clean_temps clear_build
	@xcodebuild clean &>/dev/null
	@rm -rdf build
	@rm -f $(TARGET)

distro: clean set_build
	@xcodebuild
	@cp ./build/Release/Sango $(TARGET)
	@$(MAKE) clear_build
	@echo done!

set_build:
	@echo "public let BUILD_DATE = "\"$(BUILD_DATE)\" > Source/Version.swift
	@echo "public let BUILD_REVISION = $(REVISION)" >> Source/Version.swift

clear_build:
	@$(REVERT) Source/Version.swift

install: distro
	@if [ -w /usr/local/bin ]; then \
	cp $(TARGET) /usr/local/bin/$(TARGET); \
	else \
	echo "/usr/local/bin not writable; need permission to install."; \
	sudo cp $(TARGET) /usr/local/bin/$(TARGET); \
	fi


test1: _clean_temps
	@./$(TARGET) -config brand1_config.json -verbose

test2: _clean_temps
	@./$(TARGET) -config brand2_config.json -verbose

test3: _clean_temps
	@./$(TARGET) -config brand1_android.json -verbose

run: distro
	@./$(TARGET) -input example/source.json \
				-swift \
				-out_source temp_ios/Constants.swift \
				-input_assets example/assets \
				-out_assets temp_ios/Resources
	@./$(TARGET) -input example/source.json \
				-java \
				-out_source temp_android/Constants.java \
				-input_assets example/assets \
				-out_assets temp_android


{'fraction_non_alphanumeric': 0.15465511908444168, 'fraction_numerical': 0.0049489638107021346, 'mean_word_length': 3.554929577464789, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '1603991', 'n_tokens_mistral': 1299, 'n_tokens_neox': 1225, 'n_words': 306}