asterinas/regression/apps/Makefile

59 lines
1.3 KiB
Makefile
Raw Normal View History

# 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.
2023-05-29 05:29:53 +00:00
MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
CUR_DIR := $(patsubst %/,%,$(dir $(MKFILE_PATH)))
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
# These test apps are sorted by name
TEST_APPS := \
alarm \
2023-12-14 02:33:23 +00:00
clone3 \
2024-05-25 20:42:16 +00:00
cpu_affinity \
2023-12-04 07:21:31 +00:00
eventfd2 \
2024-05-15 04:00:14 +00:00
execve \
file_io \
fork \
fork_c \
getpid \
hello_c \
hello_pie \
hello_world \
2024-05-31 10:24:20 +00:00
itimer \
2023-12-04 07:32:38 +00:00
mmap \
mongoose \
network \
pthread \
pty \
signal_c \
2023-05-29 05:29:53 +00:00
2024-05-08 02:33:25 +00:00
# The C head and source files of all the apps, excluding the downloaded mongoose files
C_SOURCES := $(shell find . -type f \( -name "*.c" -or -name "*.h" \) ! -name "mongoose.c" ! -name "mongoose.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 $@
.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