<commit_before># SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2010-2014 Intel Corporation

.PHONY: showversion
showversion:
	@set -- \
		$$(sed -rne 's,^#define RTE_VER_[A-Z_]*[[:space:]]+([0-9]+).*,\1,p' \
			-e 's,^#define RTE_VER_SUFFIX[[:space:]]+"(.*)",\1,p' \
			$(RTE_SRCDIR)/lib/librte_eal/common/include/rte_version.h) ;\
		printf '%d.%02d.%d' "$$1" "$$2" "$$3"; \
		if [ -z "$$5" ]; then echo; \
		else printf '%s' "$$4"; \
			if [ $$5 -lt 16 ] ; then echo $$5; \
			else echo $$(($$5 - 16)); fi; \
		fi

.PHONY: showversionum
showversionum:
	@set -- \
		$$(sed -rne 's,^#define RTE_VER_[A-Z_]*[[:space:]]+([0-9]+).*,\1,p' \
			$(RTE_SRCDIR)/lib/librte_eal/common/include/rte_version.h); \
		printf '%02d%02d\n' "$$1" "$$2"

INSTALL_CONFIGS := $(sort $(filter-out %~,\
	$(patsubst $(RTE_SRCDIR)/config/defconfig_%,%,\
	$(wildcard $(RTE_SRCDIR)/config/defconfig_*))))
INSTALL_TARGETS := $(addsuffix _install,$(INSTALL_CONFIGS))

.PHONY: showconfigs
showconfigs:
	@$(foreach CONFIG, $(INSTALL_CONFIGS), echo $(CONFIG);)

.PHONY: notemplate
notemplate:
	@printf "No template specified. Use 'make defconfig' or "
	@echo "use T=template from the following list:"
	@$(MAKE) -rR showconfigs | sed 's,^,  ,'


.PHONY: defconfig
defconfig:
	@$(MAKE) config T=$(shell \
                uname -m | awk '{ \
                if ($$0 == "aarch64") { \
                        print "arm64-armv8a"} \
                else if ($$0 == "armv7l") { \
                        print "arm-armv7a"} \
                else if ($$0 == "ppc64") { \
                        print "ppc_64-power8"} \
                else { \
                        printf "%s-native", $$0} }')-$(shell \
                uname | awk '{ \
                if ($$0 == "Linux") { \
                        print "linuxapp"} \
                else { \
                        print "bsdapp"} }')-$(shell \
                ${CC} -v 2>&1 | \
                grep " version " | cut -d ' ' -f 1)

.PHONY: config
ifeq ($(RTE_CONFIG_TEMPLATE),)
config: notemplate
else
config: $(RTE_OUTPUT)/include/rte_config.h $(RTE_OUTPUT)/Makefile
	@echo "Configuration done using" \
		$(patsubst defconfig_%,%,$(notdir $(RTE_CONFIG_TEMPLATE)))<commit_msg>mk: fix make defconfig on FreeBSD<commit_after># SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2010-2014 Intel Corporation

.PHONY: showversion
showversion:
	@set -- \
		$$(sed -rne 's,^#define RTE_VER_[A-Z_]*[[:space:]]+([0-9]+).*,\1,p' \
			-e 's,^#define RTE_VER_SUFFIX[[:space:]]+"(.*)",\1,p' \
			$(RTE_SRCDIR)/lib/librte_eal/common/include/rte_version.h) ;\
		printf '%d.%02d.%d' "$$1" "$$2" "$$3"; \
		if [ -z "$$5" ]; then echo; \
		else printf '%s' "$$4"; \
			if [ $$5 -lt 16 ] ; then echo $$5; \
			else echo $$(($$5 - 16)); fi; \
		fi

.PHONY: showversionum
showversionum:
	@set -- \
		$$(sed -rne 's,^#define RTE_VER_[A-Z_]*[[:space:]]+([0-9]+).*,\1,p' \
			$(RTE_SRCDIR)/lib/librte_eal/common/include/rte_version.h); \
		printf '%02d%02d\n' "$$1" "$$2"

INSTALL_CONFIGS := $(sort $(filter-out %~,\
	$(patsubst $(RTE_SRCDIR)/config/defconfig_%,%,\
	$(wildcard $(RTE_SRCDIR)/config/defconfig_*))))
INSTALL_TARGETS := $(addsuffix _install,$(INSTALL_CONFIGS))

.PHONY: showconfigs
showconfigs:
	@$(foreach CONFIG, $(INSTALL_CONFIGS), echo $(CONFIG);)

.PHONY: notemplate
notemplate:
	@printf "No template specified. Use 'make defconfig' or "
	@echo "use T=template from the following list:"
	@$(MAKE) -rR showconfigs | sed 's,^,  ,'

.PHONY: defconfig
defconfig:
	@$(MAKE) config T=$(shell \
                uname -m | awk '{ \
                if ($$0 == "aarch64") { \
                        print "arm64-armv8a"} \
                else if ($$0 == "armv7l") { \
                        print "arm-armv7a"} \
                else if ($$0 == "ppc64") { \
                        print "ppc_64-power8"} \
                else if ($$0 == "amd64") { \
                        print "x86_64-native"} \
                else { \
                        printf "%s-native", $$0} }' \
		)-$(shell \
                uname | awk '{ \
                if ($$0 == "Linux") { \
                        print "linuxapp"} \
                else { \
                        print "bsdapp"} }' \
		)-$(shell \
		${CC} --version | grep -o 'cc\|gcc\|icc\|clang' | awk \
		'{ \
		if ($$1 == "cc") { \
			print "gcc" } \
		else { \
			print $$1 } \
		}' \
		)

.PHONY: config
ifeq ($(RTE_CONFIG_TEMPLATE),)
config: notemplate
else
config: $(RTE_OUTPUT)/include/rte_config.h $(RTE_OUTPUT)/Makefile
	@echo "Configuration done using" \
		$(patsubst defconfig_%,%,$(notdir $(RTE_CONFIG_TEMPLATE)))
{'fraction_non_alphanumeric': 0.21032005225342912, 'fraction_numerical': 0.025691269322882647, 'mean_word_length': 2.1814404432132966, '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': '5768119', 'n_tokens_mistral': 1902, 'n_tokens_neox': 1760, 'n_words': 351}