2024-01-03 06:40:54 +00:00
|
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
|
2024-12-10 02:08:58 +00:00
|
|
|
# Prevent the implicit rules from compiling ".c" or ".s" files automatically.
|
|
|
|
|
MAKEFLAGS += --no-builtin-rules
|
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
|
2024-06-28 11:12:24 +00:00
|
|
|
TEST_BUILD_DIR ?= $(INITRAMFS)/test
|
2024-03-15 16:15:19 +00:00
|
|
|
|
2024-04-19 08:32:19 +00:00
|
|
|
# These test apps are sorted by name
|
|
|
|
|
TEST_APPS := \
|
2024-06-01 08:10:51 +00:00
|
|
|
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 \
|
2024-04-19 08:32:19 +00:00
|
|
|
fork \
|
|
|
|
|
fork_c \
|
2025-02-25 09:24:28 +00:00
|
|
|
getcpu \
|
2024-04-19 08:32:19 +00:00
|
|
|
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 \
|
2024-04-19 08:32:19 +00:00
|
|
|
mongoose \
|
|
|
|
|
network \
|
2024-06-30 18:34:55 +00:00
|
|
|
pipe \
|
2024-04-19 08:32:19 +00:00
|
|
|
pthread \
|
|
|
|
|
pty \
|
2024-12-18 03:52:43 +00:00
|
|
|
shm \
|
2024-04-19 08:32:19 +00:00
|
|
|
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
|
2024-06-21 08:17:58 +00:00
|
|
|
C_SOURCES := \
|
|
|
|
|
$(shell find . -type f \( -name "*.c" -or -name "*.h" \) \
|
|
|
|
|
! -name "mongoose.c" ! -name "mongoose.h")
|
2024-03-15 16:15:19 +00:00
|
|
|
|
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:
|
2024-06-28 11:12:24 +00:00
|
|
|
@echo "Fixing code format for general tests..."
|
2024-03-15 16:15:19 +00:00
|
|
|
@clang-format -i $(C_SOURCES)
|
|
|
|
|
|
|
|
|
|
.PHONY: check
|
|
|
|
|
check:
|
2024-06-28 11:12:24 +00:00
|
|
|
@echo "Checking code format for general tests..."
|
2024-03-15 16:15:19 +00:00
|
|
|
@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
|