<commit_before>BUILD_DIR ?= build
BUILD_TYPE ?= Debug
BUILD_TESTS ?= OFF
CMAKE_DIR = $(CURDIR)

PROJECT_NAME = main
OUTPUT_EXEC = $(PROJECT_NAME)


all:
	@echo "Usage:"
	@echo "\tmake release"
	@echo "\tmake debug"
	@echo "\tmake test"
	@echo "\tmake test-memleaks"
.PHONY: all


build:
	mkdir -p $(BUILD_DIR) ; cd $(BUILD_DIR) ; \
		cmake \
		-D CMAKE_BUILD_TYPE=$(BUILD_TYPE) \
		-D PROJECT_NAME=$(PROJECT_NAME) \
		-D SKELETON_ENABLE_TESTS=$(BUILD_TESTS) \
		$(CMAKE_DIR) ; make
.PHONY: build


release:
	BUILD_TYPE=Release BUILD_DIR=build/release $(MAKE) build
.PHONY: release


debug:
	BUILD_TYPE=Debug BUILD_DIR=build/debug $(MAKE) build
.PHONY: debug


# Tests are build in the same directory so that we would not have to recompile
# everything jus to run the tests.
test:
	BUILD_TYPE=Release BUILD_DIR=build/release BUILD_TESTS=ON \
		$(MAKE) build
	cd $(BUILD_DIR)/release ; make run-tests
.PHONY: test


test-memleaks:
	BUILD_TYPE=Release BUILD_DIR=build/release BUILD_TESTS=ON \
		$(MAKE) build
	cd $(BUILD_DIR)/release ; make run-memleak-tests
.PHONY: test-memleaks


test-memleaks-debug:
	BUILD_TYPE=Debug BUILD_DIR=build/debug BUILD_TESTS=ON \
		$(MAKE) debug
	cd $(BUILD_DIR)/debug ; make run-memleak-tests
.PHONY: test-memleaks-debug


clean:
	rm -rf build
.PHONY: clean


run-release:
	./$(BUILD_DIR)/release/$(OUTPUT_EXEC)
.PHONY: run-release


run-debug:
	./$(BUILD_DIR)/debug/$(OUTPUT_EXEC)
.PHONY: run-debug<commit_msg>C++: adds make target to build in-source docs.<commit_after>BUILD_DIR ?= build
BUILD_TYPE ?= Debug
BUILD_TESTS ?= OFF
CMAKE_DIR = $(CURDIR)

PROJECT_NAME = main
OUTPUT_EXEC = $(PROJECT_NAME)


all:
	@echo "Usage:"
	@echo "\tmake release"
	@echo "\tmake debug"
	@echo "\tmake test"
	@echo "\tmake test-memleaks"
	@echo "\tmake docs"
.PHONY: all


build:
	mkdir -p $(BUILD_DIR) ; cd $(BUILD_DIR) ; \
		cmake \
		-D CMAKE_BUILD_TYPE=$(BUILD_TYPE) \
		-D PROJECT_NAME=$(PROJECT_NAME) \
		-D SKELETON_ENABLE_TESTS=$(BUILD_TESTS) \
		$(CMAKE_DIR) ; make
.PHONY: build


release:
	BUILD_TYPE=Release BUILD_DIR=build/release $(MAKE) build
.PHONY: release


debug:
	BUILD_TYPE=Debug BUILD_DIR=build/debug $(MAKE) build
.PHONY: debug


# Tests are build in the same directory so that we would not have to recompile
# everything jus to run the tests.
test:
	BUILD_TYPE=Release BUILD_DIR=build/release BUILD_TESTS=ON \
		$(MAKE) build
	cd $(BUILD_DIR)/release ; make run-tests
.PHONY: test


test-memleaks:
	BUILD_TYPE=Release BUILD_DIR=build/release BUILD_TESTS=ON \
		$(MAKE) build
	cd $(BUILD_DIR)/release ; make run-memleak-tests
.PHONY: test-memleaks


test-memleaks-debug:
	BUILD_TYPE=Debug BUILD_DIR=build/debug BUILD_TESTS=ON \
		$(MAKE) debug
	cd $(BUILD_DIR)/debug ; make run-memleak-tests
.PHONY: test-memleaks-debug


clean:
	rm -rf build
.PHONY: clean


run-release:
	./$(BUILD_DIR)/release/$(OUTPUT_EXEC)
.PHONY: run-release


run-debug:
	./$(BUILD_DIR)/debug/$(OUTPUT_EXEC)
.PHONY: run-debug


docs:
	mkdir -p $(BUILD_DIR)
	doxygen Doxyfile
.PHONY: docs
{'fraction_non_alphanumeric': 0.13351134846461948, 'fraction_numerical': 0.0, 'mean_word_length': 4.342245989304812, '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': '2050888', 'n_tokens_mistral': 1243, 'n_tokens_neox': 1180, 'n_words': 279}