2024-01-03 06:40:54 +00:00
|
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2023-05-29 05:29:53 +00:00
|
|
|
MAKEFLAGS += --no-builtin-rules # Prevent the implicit rules from compiling ".c" or ".s" files automatically.
|
2024-03-15 16:15:19 +00:00
|
|
|
|
2023-05-29 05:29:53 +00:00
|
|
|
MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
|
|
|
|
CUR_DIR := $(patsubst %/,%,$(dir $(MKFILE_PATH)))
|
2024-03-15 16:15:19 +00:00
|
|
|
|
2023-05-29 05:29:53 +00:00
|
|
|
INITRAMFS ?= $(CUR_DIR)/../build/initramfs
|
2023-07-05 06:08:58 +00:00
|
|
|
REGRESSION_BUILD_DIR ?= $(INITRAMFS)/regression
|
2024-03-15 16:15:19 +00:00
|
|
|
|
2024-03-26 02:43:25 +00:00
|
|
|
TEST_APPS := signal_c pthread network hello_world hello_pie hello_c fork_c fork execve pty mongoose
|
2023-05-29 05:29:53 +00:00
|
|
|
|
2024-03-15 16:15:19 +00:00
|
|
|
C_SOURCES := $(shell find . -type f \( -name "*.c" -or -name "*.h" \) )
|
|
|
|
|
2023-05-29 05:29:53 +00:00
|
|
|
.PHONY: all
|
2024-02-29 09:05:35 +00:00
|
|
|
all: $(TEST_APPS) scripts
|
|
|
|
|
|
|
|
.PHONY: $(TEST_APPS)
|
|
|
|
$(TEST_APPS):
|
|
|
|
@make --no-print-directory -C $@
|
|
|
|
|
2024-03-15 16:15:19 +00:00
|
|
|
.PHONY: format
|
|
|
|
format:
|
|
|
|
@echo "Fixing code format for regression tests..."
|
|
|
|
@clang-format -i $(C_SOURCES)
|
|
|
|
|
|
|
|
.PHONY: check
|
|
|
|
check:
|
|
|
|
@echo "Checking code format for regression tests..."
|
|
|
|
@clang-format --dry-run --Werror $(C_SOURCES)
|
|
|
|
|
2024-02-29 09:05:35 +00:00
|
|
|
$(REGRESSION_BUILD_DIR):
|
|
|
|
@mkdir -p $@
|
|
|
|
|
|
|
|
.PHONY: scripts
|
|
|
|
scripts: | $(REGRESSION_BUILD_DIR)
|
2023-07-05 06:08:58 +00:00
|
|
|
@make --no-print-directory BUILD_DIR=$(REGRESSION_BUILD_DIR) -C scripts
|