<commit_before>.PHONY: test

ROGUEC_SRC = $(shell find Source/RogueC | grep ".rogue$$" )
ROGUEC_ROGUE_FLAGS =
ROGUEC_CPP_FLAGS = -Wall -std=gnu++11 -fno-strict-aliasing -Wno-invalid-offsetof

DEFAULT_CXX = \"$(CXX) $(ROGUEC_CPP_FLAGS)\"

BINDIR = /usr/local/bin

ifeq ($(OS),Windows_NT)
  SUDO_CMD =
  PLATFORM = Windows
else
  SUDO_CMD = sudo
  UNAME_S := $(shell uname -s)
  ifeq ($(UNAME_S),Darwin)
    PLATFORM = macOS
  else
    PLATFORM = Linux
  endif
endif

all: roguec

-include Local.mk

remake: libraries touch_roguec roguec

debug: libraries
	@echo -------------------------------------------------------------------------------
	@echo "Recompiling RogueC.rogue -> RogueC.cpp with --debug..."
	@echo -------------------------------------------------------------------------------
	cd Source/RogueC && mkdir -p Build
	cd Source/RogueC && roguec RogueC.rogue --gc=manual --main --output=Build/RogueC --debug $(ROGUEC_ROGUE_FLAGS)
	mkdir -p Programs
	$(CXX) $(ROGUEC_CPP_FLAGS) -DDEFAULT_CXX="$(DEFAULT_CXX)" Source/RogueC/Build/RogueC.cpp -o Programs/RogueC/$(PLATFORM)/roguec

exhaustive: libraries
	@echo -------------------------------------------------------------------------------
	@echo "Recompiling RogueC.rogue -> RogueC.cpp with --exhaustive..."
	@echo -------------------------------------------------------------------------------
	cd Source/RogueC && mkdir -p Build
	cd Source/RogueC && roguec RogueC.rogue --gc=manual --main --output=Build/RogueC --exhaustive $(ROGUEC_ROGUE_FLAGS)
	mkdir -p Programs
	$(CXX) $(ROGUEC_CPP_FLAGS) -DDEFAULT_CXX="$(DEFAULT_CXX)" Source/RogueC/Build/RogueC.cpp -o Programs/RogueC/$(PLATFORM)/roguec

roguec: bootstrap_roguec $(BINDIR)/roguec libraries Source/RogueC/Build/RogueC.cpp Programs/RogueC/$(PLATFORM)/roguec

update_bootstrap:
	mkdir -p Source/RogueC/Bootstrap
	cp Source/RogueC/Build/RogueC.h Source/RogueC/Build/RogueC.cpp Source/RogueC/Bootstrap

touch_roguec:
	touch Source/RogueC/RogueC.rogue

bootstrap:
	@echo -------------------------------------------------------------------------------
	@echo Recompiling Programs/RogueC/$(PLATFORM)/roguec from C++ bootstrap source...
	@echo -------------------------------------------------------------------------------
	mkdir -p Programs/RogueC/$(PLATFORM);
	$(CXX) $(ROGUEC_CPP_FLAGS) -DDEFAULT_CXX="$(DEFAULT_CXX)" Source/RogueC/Bootstrap/RogueC.cpp -o Programs/RogueC/$(PLATFORM)/roguec


bootstrap_roguec:
	@if [ ! -f "Programs/RogueC/$(PLATFORM)/roguec" ]; \
	then \
	  if [ -f "Programs/RogueC/roguec" ]; \
	  then \
	    echo "\nRemoving executable from old location Programs/RogueC/roguec"; \
	    rm -f Programs/RogueC/roguec; \
	    echo "\nRemoving libraries from old location Programs/RogueC/Libraries"; \
	    rm -r Programs/RogueC/Libraries; \
	  fi; \
	  if [ -f "$(BINDIR)/roguec" ]; \
	  then \
	    echo "\nUnlinking old program location by removing $(BINDIR)/roguec"; \
	    $(SUDO_CMD) rm $(BINDIR)/roguec; \
	  fi; \
	  echo -------------------------------------------------------------------------------; \
	  echo Compiling Programs/RogueC/$(PLATFORM)/roguec from C++ bootstrap source...; \
	  echo -------------------------------------------------------------------------------; \
	  echo $(CXX) $(ROGUEC_CPP_FLAGS) -DDEFAULT_CXX="$(DEFAULT_CXX)" Source/RogueC/Bootstrap/RogueC.cpp -o Programs/RogueC/$(PLATFORM)/roguec; \
	  mkdir -p Programs/RogueC/$(PLATFORM); \
	  $(CXX) $(ROGUEC_CPP_FLAGS) -DDEFAULT_CXX="$(DEFAULT_CXX)" Source/RogueC/Bootstrap/RogueC.cpp -o Programs/RogueC/$(PLATFORM)/roguec; \
	fi;<commit_msg>Tweaked bootstrap_roguec to recompile RogueC after the initial compile from Bootstrap/.<commit_after>.PHONY: test

ROGUEC_SRC = $(shell find Source/RogueC | grep ".rogue$$" )
ROGUEC_ROGUE_FLAGS =
ROGUEC_CPP_FLAGS = -Wall -std=gnu++11 -fno-strict-aliasing -Wno-invalid-offsetof

DEFAULT_CXX = \"$(CXX) $(ROGUEC_CPP_FLAGS)\"

BINDIR = /usr/local/bin

ifeq ($(OS),Windows_NT)
  SUDO_CMD =
  PLATFORM = Windows
else
  SUDO_CMD = sudo
  UNAME_S := $(shell uname -s)
  ifeq ($(UNAME_S),Darwin)
    PLATFORM = macOS
  else
    PLATFORM = Linux
  endif
endif

all: roguec

-include Local.mk

remake: libraries touch_roguec roguec

debug: libraries
	@echo -------------------------------------------------------------------------------
	@echo "Recompiling RogueC.rogue -> RogueC.cpp with --debug..."
	@echo -------------------------------------------------------------------------------
	cd Source/RogueC && mkdir -p Build
	cd Source/RogueC && roguec RogueC.rogue --gc=manual --main --output=Build/RogueC --debug $(ROGUEC_ROGUE_FLAGS)
	mkdir -p Programs
	$(CXX) $(ROGUEC_CPP_FLAGS) -DDEFAULT_CXX="$(DEFAULT_CXX)" Source/RogueC/Build/RogueC.cpp -o Programs/RogueC/$(PLATFORM)/roguec

exhaustive: libraries
	@echo -------------------------------------------------------------------------------
	@echo "Recompiling RogueC.rogue -> RogueC.cpp with --exhaustive..."
	@echo -------------------------------------------------------------------------------
	cd Source/RogueC && mkdir -p Build
	cd Source/RogueC && roguec RogueC.rogue --gc=manual --main --output=Build/RogueC --exhaustive $(ROGUEC_ROGUE_FLAGS)
	mkdir -p Programs
	$(CXX) $(ROGUEC_CPP_FLAGS) -DDEFAULT_CXX="$(DEFAULT_CXX)" Source/RogueC/Build/RogueC.cpp -o Programs/RogueC/$(PLATFORM)/roguec

roguec: bootstrap_roguec $(BINDIR)/roguec libraries Source/RogueC/Build/RogueC.cpp Programs/RogueC/$(PLATFORM)/roguec

update_bootstrap:
	mkdir -p Source/RogueC/Bootstrap
	cp Source/RogueC/Build/RogueC.h Source/RogueC/Build/RogueC.cpp Source/RogueC/Bootstrap

touch_roguec:
	touch Source/RogueC/RogueC.rogue

bootstrap:
	@echo -------------------------------------------------------------------------------
	@echo Recompiling Programs/RogueC/$(PLATFORM)/roguec from C++ bootstrap source...
	@echo -------------------------------------------------------------------------------
	mkdir -p Programs/RogueC/$(PLATFORM);
	$(CXX) $(ROGUEC_CPP_FLAGS) -DDEFAULT_CXX="$(DEFAULT_CXX)" Source/RogueC/Bootstrap/RogueC.cpp -o Programs/RogueC/$(PLATFORM)/roguec


bootstrap_roguec:
	@if [ ! -f "Programs/RogueC/$(PLATFORM)/roguec" ]; \
	then \
	  if [ -f "Programs/RogueC/roguec" ]; \
	  then \
	    echo "\nRemoving executable from old location Programs/RogueC/roguec"; \
	    rm -f Programs/RogueC/roguec; \
	    echo "\nRemoving libraries from old location Programs/RogueC/Libraries"; \
	    rm -r Programs/RogueC/Libraries; \
	  fi; \
	  if [ -f "$(BINDIR)/roguec" ]; \
	  then \
	    echo "\nUnlinking old program location by removing $(BINDIR)/roguec"; \
	    $(SUDO_CMD) rm $(BINDIR)/roguec; \
	  fi; \
	  echo -------------------------------------------------------------------------------; \
	  echo Compiling Programs/RogueC/$(PLATFORM)/roguec from C++ bootstrap source...; \
	  echo -------------------------------------------------------------------------------; \
	  echo $(CXX) $(ROGUEC_CPP_FLAGS) -DDEFAULT_CXX="$(DEFAULT_CXX)" Source/RogueC/Bootstrap/RogueC.cpp -o Programs/RogueC/$(PLATFORM)/roguec; \
	  mkdir -p Programs/RogueC/$(PLATFORM); \
	  $(CXX) $(ROGUEC_CPP_FLAGS) -DDEFAULT_CXX="$(DEFAULT_CXX)" Source/RogueC/Bootstrap/RogueC.cpp -o Programs/RogueC/$(PLATFORM)/roguec; \
	  echo touch Source/RogueC/RogueC.rogue; \
	  touch Source/RogueC/RogueC.rogue; \
	fi;
{'fraction_non_alphanumeric': 0.2958579881656805, 'fraction_numerical': 0.0005504334663547544, 'mean_word_length': 1.9165329052969502, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1124915', 'n_tokens_mistral': 2556, 'n_tokens_neox': 2398, 'n_words': 458}