<commit_before>#
# file: distortos-utilities.cmake
#
# author: Copyright (C) 2018 <NAME> http://www.distortec.com http://www.freddiechopin.info
#
# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
# distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

#
# Converts ELF file named `elfFilename` to binary file named `binFilename`.
#

function(bin elfFilename binFilename)
	add_custom_command(OUTPUT ${binFilename}
			COMMAND ${CMAKE_OBJCOPY} -O binary ${elfFilename} ${binFilename}
			DEPENDS ${elfFilename}
			USES_TERMINAL)
	add_custom_target(${elfFilename}-to-${binFilename} ALL DEPENDS ${binFilename})
endfunction()

#
# Dumps symbols from ELF file named `elfFilename` to file named `dmpFilename`.
#
<commit_msg>Use post-build event for bin() function<commit_after>#
# file: distortos-utilities.cmake
#
# author: Copyright (C) 2018 <NAME> http://www.distortec.com http://www.freddiechopin.info
#
# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
# distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

#
# Converts output file of `target` to binary file named `binFilename`.
#

function(bin target binFilename)
	add_custom_command(TARGET ${target} POST_BUILD
			COMMAND ${CMAKE_OBJCOPY} -O binary $<TARGET_FILE:${target}> ${binFilename}
			BYPRODUCTS ${binFilename}
			VERBATIM)
endfunction()

#
# Dumps symbols from ELF file named `elfFilename` to file named `dmpFilename`.
#

{'fraction_non_alphanumeric': 0.11607142857142858, 'fraction_numerical': 0.01020408163265306, 'mean_word_length': 4.705454545454545, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '2739009', 'n_tokens_mistral': 543, 'n_tokens_neox': 505, 'n_words': 170}