asterinas/test/apps/Makefile

70 lines
1.3 KiB
Makefile
Raw Normal View History

# SPDX-License-Identifier: MPL-2.0
# Prevent the implicit rules from compiling ".c" or ".s" files automatically.
MAKEFLAGS += --no-builtin-rules
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
2024-06-28 11:12:24 +00:00
TEST_BUILD_DIR ?= $(INITRAMFS)/test
# These test apps are sorted by name
TEST_APPS := \
alarm \
2024-05-06 05:35:13 +00:00
capability \
2023-12-14 02:33:23 +00:00
clone3 \
2024-05-25 20:42:16 +00:00
cpu_affinity \
2024-05-16 11:05:32 +00:00
epoll \
2023-12-04 07:21:31 +00:00
eventfd2 \
2024-05-15 04:00:14 +00:00
execve \
2024-11-25 00:09:18 +00:00
exit \
2024-06-27 02:46:58 +00:00
fdatasync \
2024-05-15 04:00:14 +00:00
file_io \
fork \
fork_c \
getcpu \
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 \
2024-06-30 18:34:55 +00:00
pipe \
pthread \
pty \
shm \
signal_c \
2024-04-07 15:08:18 +00:00
vsock \
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:
2024-06-28 11:12:24 +00:00
@echo "Fixing code format for general tests..."
@clang-format -i $(C_SOURCES)
.PHONY: check
check:
2024-06-28 11:12:24 +00:00
@echo "Checking code format for general tests..."
@clang-format --dry-run --Werror $(C_SOURCES)
2024-06-28 11:12:24 +00:00
$(TEST_BUILD_DIR):
2024-02-29 09:05:35 +00:00
@mkdir -p $@
.PHONY: scripts
2024-06-28 11:12:24 +00:00
scripts: | $(TEST_BUILD_DIR)
@make --no-print-directory BUILD_DIR=$(TEST_BUILD_DIR) -C scripts