<commit_before># Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Location of sel4test sources and binary output files
SEL4TEST_SRC_DIR  := $(ROOTDIR)/kata/projects/sel4test
SEL4TEST_OUT_DIR := $(OUT)/sel4test/$(KATA_TARGET_ARCH)
SEL4TEST_OUT_RELEASE := $(SEL4TEST_OUT_DIR)/release
SEL4TEST_OUT_DEBUG := $(SEL4TEST_OUT_DIR)/debug

SEL4TEST_KERNEL_DEBUG := $(SEL4TEST_OUT_DEBUG)/kernel/kernel.elf
SEL4TEST_KERNEL_RELEASE := $(SEL4TEST_OUT_RELEASE)/kernel/kernel.elf

SEL4TEST_ROOTSERVER_DEBUG := $(SEL4TEST_OUT_DEBUG)/apps/sel4test-driver/sel4test-driver
SEL4TEST_ROOTSERVER_RELEASE := $(SEL4TEST_OUT_RELEASE)/apps/sel4test-driver/sel4test-driver

# NB: enables MCS for all runs; might want to run both w/ & w/o MCS
# NB: enables PRINTING for all runs; user space doesn't seem to setup the
#   console properly so we need seL4_DebugPutChar to display test results.
SEL4TEST_CMAKE_ARGS := \
	-G Ninja \
	-DCROSS_COMPILER_PREFIX=$(KATA_TARGET_ARCH)- \
	-DSIMULATION=TRUE \
	-DPLATFORM=sparrow \
	-DRISCV32=1 \
	-DKernelPrinting=1 \
	-DMCS=ON \
	$(SEL4TEST_SRC_DIR)

# NB: no Rust code included, sel4test is pure C
SEL4TEST_SOURCES := $(shell find \
	$(SEL4TEST_SRC_DIR) \
	${SEL4TEST_SRC_DIR}/../sel4runtime \
	${SEL4TEST_SRC_DIR}/../seL4_libs \
	${SEL4TEST_SRC_DIR}/../musllibc \
	${SEL4TEST_SRC_DIR}/../util_libs \
	-name \*.c -or -name \*.h -or -name \*.cpp -type f)

SEL4TEST_SOURCES := $(shell find \
        $(SEL4TEST_SRC_DIR) \
        ${SEL4TEST_SRC_DIR}/../sel4runtime \
        ${SEL4TEST_SRC_DIR}/../seL4_libs \
        ${SEL4TEST_SRC_DIR}/../musllibc \
        ${SEL4TEST_SRC_DIR}/../util_libs \
	-name \*.rs -or \
	-name \*.c -or \
	-name \*.h -or \
	-name \*.cpp \
	-type f)

sel4test-gen-headers: $(TIMER_HEADER) $(UART_HEADER)

# Generates seltest release build.ninja
${SEL4TEST_OUT_RELEASE}/build.ninja: ${SEL4TEST_SOURCES}
${SEL4TEST_OUT_RELEASE}/build.ninja: sel4test-gen-headers
	mkdir -p $(SEL4TEST_OUT_RELEASE)
	ln -sf $(KATA_OUT_DIR)/opentitan-gen $(SEL4TEST_OUT_RELEASE)/
	cmake -B $(SEL4TEST_OUT_RELEASE) \
		-DSEL4_CACHE_DIR=$(CACHE)/sel4test-release \
		-DRELEASE=ON \
        ${SEL4TEST_CMAKE_ARGS}

# Generates sel4test release kernel
$(SEL4TEST_KERNEL_RELEASE): ${SEL4TEST_OUT_RELEASE}/build.ninja
	ninja -C $(SEL4TEST_OUT_RELEASE) kernel.elf

# Generates sel4test release rootserver, requries kernel<commit_msg>build: fix kata_sel4test.mk marge botch<commit_after># Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Location of sel4test sources and binary output files
SEL4TEST_SRC_DIR  := $(ROOTDIR)/kata/projects/sel4test
SEL4TEST_OUT_DIR := $(OUT)/sel4test/$(KATA_TARGET_ARCH)
SEL4TEST_OUT_RELEASE := $(SEL4TEST_OUT_DIR)/release
SEL4TEST_OUT_DEBUG := $(SEL4TEST_OUT_DIR)/debug

SEL4TEST_KERNEL_DEBUG := $(SEL4TEST_OUT_DEBUG)/kernel/kernel.elf
SEL4TEST_KERNEL_RELEASE := $(SEL4TEST_OUT_RELEASE)/kernel/kernel.elf

SEL4TEST_ROOTSERVER_DEBUG := $(SEL4TEST_OUT_DEBUG)/apps/sel4test-driver/sel4test-driver
SEL4TEST_ROOTSERVER_RELEASE := $(SEL4TEST_OUT_RELEASE)/apps/sel4test-driver/sel4test-driver

# NB: enables MCS for all runs; might want to run both w/ & w/o MCS
# NB: enables PRINTING for all runs; user space doesn't seem to setup the
#   console properly so we need seL4_DebugPutChar to display test results.
SEL4TEST_CMAKE_ARGS := \
	-G Ninja \
	-DCROSS_COMPILER_PREFIX=$(KATA_TARGET_ARCH)- \
	-DSIMULATION=TRUE \
	-DPLATFORM=sparrow \
	-DRISCV32=1 \
	-DKernelPrinting=1 \
	-DMCS=ON \
	$(SEL4TEST_SRC_DIR)

# NB: no Rust code included, sel4test is pure C
SEL4TEST_SOURCES := $(shell find \
	$(SEL4TEST_SRC_DIR) \
	${SEL4TEST_SRC_DIR}/../sel4runtime \
	${SEL4TEST_SRC_DIR}/../seL4_libs \
	${SEL4TEST_SRC_DIR}/../musllibc \
	${SEL4TEST_SRC_DIR}/../util_libs \
	-name \*.c -or -name \*.h -or -name \*.cpp -type f)

sel4test-gen-headers: $(TIMER_HEADER) $(UART_HEADER)

# Generates seltest release build.ninja
${SEL4TEST_OUT_RELEASE}/build.ninja: ${SEL4TEST_SOURCES}
${SEL4TEST_OUT_RELEASE}/build.ninja: sel4test-gen-headers
	mkdir -p $(SEL4TEST_OUT_RELEASE)
	ln -sf $(KATA_OUT_DIR)/opentitan-gen $(SEL4TEST_OUT_RELEASE)/
	cmake -B $(SEL4TEST_OUT_RELEASE) \
		-DSEL4_CACHE_DIR=$(CACHE)/sel4test-release \
		-DRELEASE=ON \
        ${SEL4TEST_CMAKE_ARGS}

# Generates sel4test release kernel
$(SEL4TEST_KERNEL_RELEASE): ${SEL4TEST_OUT_RELEASE}/build.ninja
	ninja -C $(SEL4TEST_OUT_RELEASE) kernel.elf

# Generates sel4test release rootserver, requries kernel
{'fraction_non_alphanumeric': 0.11801470588235294, 'fraction_numerical': 0.024080882352941178, 'mean_word_length': 4.540733197556008, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '606543', 'n_tokens_mistral': 2017, 'n_tokens_neox': 1930, 'n_words': 466}