<commit_before>
.PHONY: $$(image_prerequisites)

include $(MKGEN_DIR)/build.mk
include mk/flags.mk
include $(SRCGEN_DIR)/image.rule.mk

rootdir := $(abspath $(ROOT_DIR))
EMBOX_IMPORTED_CPPFLAGS := $(filter -D% -U% -I% -nostdinc,$(EMBOX_EXPORT_CPPFLAGS))

EMBOX_IMPORTED_CFLAGS   := $(filter -g% -f% -m% -O%,$(CFLAGS))
EMBOX_IMPORTED_CXXFLAGS := $(filter -g% -f% -m% -O%,$(CFLAGS))

EMBOX_IMPORTED_LDFLAGS :=
EMBOX_IMPORTED_LDFLAGS += $(filter -static,$(LDFLAGS))
EMBOX_IMPORTED_LDFLAGS += $(filter -nostdlib,$(LDFLAGS))
EMBOX_IMPORTED_LDFLAGS += $(foreach w,$(filter -m elf_i386,$(LDFLAGS)),-Wl,$w)

EMBOX_IMPORTED_LDFLAGS_FULL :=
EMBOX_IMPORTED_LDFLAGS_FULL += -Wl,--relax
EMBOX_IMPORTED_LDFLAGS_FULL += -Wl,-T,$(rootdir)/build/base/obj/mk/image.lds
EMBOX_IMPORTED_LDFLAGS_FULL += -Wl,--defsym=__symbol_table=0,--defsym=__symbol_table_size=0
EMBOX_IMPORTED_LDFLAGS_FULL += $(rootdir)/build/base/obj/embox.o
EMBOX_IMPORTED_LDFLAGS_FULL += -Wl,--start-group
EMBOX_IMPORTED_LDFLAGS_FULL += $(__image_ld_libs1:.%=-Wl,$(rootdir)%)
EMBOX_IMPORTED_LDFLAGS_FULL += -Wl,--end-group

# We are not including user ld scripts in flags, since it is not required to do
# working object, only compilation errors are matter. If required, place it below
# --relax flag and perfrom 2 phase link at arch-unknown-embox, first with user lds,
# next with image.lds
#EMBOX_IMPORTED_LDFLAGS_FULL += $(__image_ld_scripts1:.%=-Wl,-T,$(rootdir)%)

EMBOX_IMPORTED_MAKEFLAGS :=
ifneq (,$(filter -j,$(MAKEFLAGS)))
EMBOX_IMPORTED_MAKEFLAGS += -j $(shell nproc)
endif

$(EMBOX_GCC_ENV): $(MKGEN_DIR)/build.mk mk/flags.mk $(SRCGEN_DIR)/image.rule.mk
$(EMBOX_GCC_ENV): | $(dir $(EMBOX_GCC_ENV))
	@echo EMBOX_CROSS_COMPILE="'"$(CROSS_COMPILE)"'"                       >> $@
	@echo EMBOX_IMPORTED_CPPFLAGS="'"$(EMBOX_IMPORTED_CPPFLAGS)"'"         >> $@
	@echo EMBOX_IMPORTED_CFLAGS="'"$(EMBOX_IMPORTED_CFLAGS)"'"             >> $@
	@echo EMBOX_IMPORTED_CXXFLAGS="'"$(EMBOX_IMPORTED_CXXFLAGS)"'"         >> $@
	@echo EMBOX_IMPORTED_LDFLAGS="'"$(EMBOX_IMPORTED_LDFLAGS)"'"           >> $@
	@echo EMBOX_IMPORTED_LDFLAGS_FULL="'"$(EMBOX_IMPORTED_LDFLAGS_FULL)"'" >> $@

$$(image_prerequisites):

TOOLCHAIN_TEST_SRC := $(ROOT_DIR)/mk/extbld/toolchain_test.c
TOOLCHAIN_TEST_OUT := $(OBJ_DIR)/toolchain_test

include $(EXTBLD_LIB)
include $(SRCGEN_DIR)/build.mk

.PHONY : do_test
do_test : $(TOOLCHAIN_TEST_OUT)

$(TOOLCHAIN_TEST_OUT): $(EMBOX_GCC_ENV)
ifeq ($(filter usermode%,$(ARCH)),)
	EMBOX_GCC_LINK=full $(EMBOX_GCC) $(TOOLCHAIN_TEST_SRC) -o $(TOOLCHAIN_TEST_OUT)
else
	@echo "Full linking mode isn't supported for usermode arch!"
endif

<commit_msg>mk extbld comlex defines arent' exported<commit_after>
.PHONY: $$(image_prerequisites)

include $(MKGEN_DIR)/build.mk
include mk/flags.mk
include $(SRCGEN_DIR)/image.rule.mk

rootdir := $(abspath $(ROOT_DIR))
EMBOX_IMPORTED_CPPFLAGS := $(filter -D% -U% -I% -nostdinc,$(filter-out -D"% -D'%,$(EMBOX_EXPORT_CPPFLAGS)))

EMBOX_IMPORTED_CFLAGS   := $(filter -g% -f% -m% -O%,$(CFLAGS))
EMBOX_IMPORTED_CXXFLAGS := $(filter -g% -f% -m% -O%,$(CFLAGS))

EMBOX_IMPORTED_LDFLAGS :=
EMBOX_IMPORTED_LDFLAGS += $(filter -static,$(LDFLAGS))
EMBOX_IMPORTED_LDFLAGS += $(filter -nostdlib,$(LDFLAGS))
EMBOX_IMPORTED_LDFLAGS += $(foreach w,$(filter -m elf_i386,$(LDFLAGS)),-Wl,$w)

EMBOX_IMPORTED_LDFLAGS_FULL :=
EMBOX_IMPORTED_LDFLAGS_FULL += -Wl,--relax
EMBOX_IMPORTED_LDFLAGS_FULL += -Wl,-T,$(rootdir)/build/base/obj/mk/image.lds
EMBOX_IMPORTED_LDFLAGS_FULL += -Wl,--defsym=__symbol_table=0,--defsym=__symbol_table_size=0
EMBOX_IMPORTED_LDFLAGS_FULL += $(rootdir)/build/base/obj/embox.o
EMBOX_IMPORTED_LDFLAGS_FULL += -Wl,--start-group
EMBOX_IMPORTED_LDFLAGS_FULL += $(__image_ld_libs1:.%=-Wl,$(rootdir)%)
EMBOX_IMPORTED_LDFLAGS_FULL += -Wl,--end-group

# We are not including user ld scripts in flags, since it is not required to do
# working object, only compilation errors are matter. If required, place it below
# --relax flag and perfrom 2 phase link at arch-unknown-embox, first with user lds,
# next with image.lds
#EMBOX_IMPORTED_LDFLAGS_FULL += $(__image_ld_scripts1:.%=-Wl,-T,$(rootdir)%)

EMBOX_IMPORTED_MAKEFLAGS :=
ifneq (,$(filter -j,$(MAKEFLAGS)))
EMBOX_IMPORTED_MAKEFLAGS += -j $(shell nproc)
endif

$(EMBOX_GCC_ENV): $(MKGEN_DIR)/build.mk mk/flags.mk $(SRCGEN_DIR)/image.rule.mk
$(EMBOX_GCC_ENV): | $(dir $(EMBOX_GCC_ENV))
	@echo EMBOX_CROSS_COMPILE="'"$(CROSS_COMPILE)"'"                       >> $@
	@echo EMBOX_IMPORTED_CPPFLAGS="'"$(EMBOX_IMPORTED_CPPFLAGS)"'"         >> $@
	@echo EMBOX_IMPORTED_CFLAGS="'"$(EMBOX_IMPORTED_CFLAGS)"'"             >> $@
	@echo EMBOX_IMPORTED_CXXFLAGS="'"$(EMBOX_IMPORTED_CXXFLAGS)"'"         >> $@
	@echo EMBOX_IMPORTED_LDFLAGS="'"$(EMBOX_IMPORTED_LDFLAGS)"'"           >> $@
	@echo EMBOX_IMPORTED_LDFLAGS_FULL="'"$(EMBOX_IMPORTED_LDFLAGS_FULL)"'" >> $@

$$(image_prerequisites):

TOOLCHAIN_TEST_SRC := $(ROOT_DIR)/mk/extbld/toolchain_test.c
TOOLCHAIN_TEST_OUT := $(OBJ_DIR)/toolchain_test

include $(EXTBLD_LIB)
include $(SRCGEN_DIR)/build.mk

.PHONY : do_test
do_test : $(TOOLCHAIN_TEST_OUT)

$(TOOLCHAIN_TEST_OUT): $(EMBOX_GCC_ENV)
ifeq ($(filter usermode%,$(ARCH)),)
	EMBOX_GCC_LINK=full $(EMBOX_GCC) $(TOOLCHAIN_TEST_SRC) -o $(TOOLCHAIN_TEST_OUT)
else
	@echo "Full linking mode isn't supported for usermode arch!"
endif


{'fraction_non_alphanumeric': 0.16638241425052114, 'fraction_numerical': 0.0030320257722190637, 'mean_word_length': 6.00929614873838, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, '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': '3357186', 'n_tokens_mistral': 2069, 'n_tokens_neox': 2101, 'n_words': 337}