2020-06-15 14:18:57 +00:00
|
|
|
#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐
|
|
|
|
#───vi: set et ft=make ts=8 tw=8 fenc=utf-8 :vi───────────────────────┘
|
|
|
|
|
|
|
|
PKGS += TEST_LIBC_CALLS
|
|
|
|
|
2022-06-19 08:13:03 +00:00
|
|
|
TEST_LIBC_CALLS_SRCS := \
|
2021-02-03 06:17:53 +00:00
|
|
|
$(wildcard test/libc/calls/*.c)
|
2020-06-15 14:18:57 +00:00
|
|
|
|
2022-06-19 08:13:03 +00:00
|
|
|
TEST_LIBC_CALLS_SRCS_TEST = \
|
|
|
|
$(filter %_test.c,$(TEST_LIBC_CALLS_SRCS))
|
|
|
|
|
|
|
|
TEST_LIBC_CALLS_OBJS = \
|
2020-06-15 14:18:57 +00:00
|
|
|
$(TEST_LIBC_CALLS_SRCS:%.c=o/$(MODE)/%.o)
|
|
|
|
|
2022-06-19 08:13:03 +00:00
|
|
|
TEST_LIBC_CALLS_COMS = \
|
|
|
|
$(TEST_LIBC_CALLS_SRCS_TEST:%.c=o/$(MODE)/%.com)
|
2020-08-25 11:23:25 +00:00
|
|
|
|
2022-06-19 08:13:03 +00:00
|
|
|
TEST_LIBC_CALLS_BINS = \
|
|
|
|
$(TEST_LIBC_CALLS_COMS) \
|
2022-08-11 01:00:45 +00:00
|
|
|
$(TEST_LIBC_CALLS_COMS:%=%.dbg) \
|
|
|
|
o/$(MODE)/test/libc/calls/life-nomod.com \
|
2023-03-30 01:16:46 +00:00
|
|
|
o/$(MODE)/test/libc/calls/life-classic.com \
|
2023-05-10 10:38:43 +00:00
|
|
|
o/$(MODE)/test/libc/calls/zipread.com.dbg \
|
2023-03-30 01:16:46 +00:00
|
|
|
o/$(MODE)/test/libc/calls/zipread.com
|
2020-06-15 14:18:57 +00:00
|
|
|
|
2022-06-19 08:13:03 +00:00
|
|
|
TEST_LIBC_CALLS_TESTS = \
|
2020-06-15 14:18:57 +00:00
|
|
|
$(TEST_LIBC_CALLS_SRCS_TEST:%.c=o/$(MODE)/%.com.ok)
|
|
|
|
|
2022-06-19 08:13:03 +00:00
|
|
|
TEST_LIBC_CALLS_CHECKS = \
|
2020-06-15 14:18:57 +00:00
|
|
|
$(TEST_LIBC_CALLS_SRCS_TEST:%.c=o/$(MODE)/%.com.runs)
|
|
|
|
|
2022-06-19 08:13:03 +00:00
|
|
|
TEST_LIBC_CALLS_DIRECTDEPS = \
|
|
|
|
DSP_CORE \
|
|
|
|
LIBC_CALLS \
|
|
|
|
LIBC_TINYMATH \
|
|
|
|
LIBC_SOCK \
|
|
|
|
LIBC_FMT \
|
|
|
|
LIBC_INTRIN \
|
|
|
|
LIBC_LOG \
|
|
|
|
LIBC_MEM \
|
|
|
|
LIBC_NEXGEN32E \
|
|
|
|
LIBC_STDIO \
|
2022-09-15 04:29:50 +00:00
|
|
|
LIBC_NT_KERNEL32 \
|
2022-06-19 08:13:03 +00:00
|
|
|
LIBC_SYSV_CALLS \
|
|
|
|
LIBC_RUNTIME \
|
|
|
|
LIBC_STR \
|
|
|
|
LIBC_SYSV \
|
2022-07-10 11:01:17 +00:00
|
|
|
LIBC_THREAD \
|
2022-06-19 08:13:03 +00:00
|
|
|
LIBC_TIME \
|
|
|
|
LIBC_TESTLIB \
|
|
|
|
LIBC_X \
|
2022-08-16 02:52:00 +00:00
|
|
|
TOOL_DECODE_LIB \
|
2023-05-13 05:42:57 +00:00
|
|
|
THIRD_PARTY_COMPILER_RT \
|
2021-02-26 02:30:17 +00:00
|
|
|
THIRD_PARTY_XED
|
2020-06-15 14:18:57 +00:00
|
|
|
|
2022-06-19 08:13:03 +00:00
|
|
|
TEST_LIBC_CALLS_DEPS := \
|
2020-06-15 14:18:57 +00:00
|
|
|
$(call uniq,$(foreach x,$(TEST_LIBC_CALLS_DIRECTDEPS),$($(x))))
|
|
|
|
|
2022-06-19 08:13:03 +00:00
|
|
|
o/$(MODE)/test/libc/calls/calls.pkg: \
|
|
|
|
$(TEST_LIBC_CALLS_OBJS) \
|
2020-06-15 14:18:57 +00:00
|
|
|
$(foreach x,$(TEST_LIBC_CALLS_DIRECTDEPS),$($(x)_A).pkg)
|
|
|
|
|
2022-06-19 08:13:03 +00:00
|
|
|
o/$(MODE)/test/libc/calls/%.com.dbg: \
|
|
|
|
$(TEST_LIBC_CALLS_DEPS) \
|
|
|
|
o/$(MODE)/test/libc/calls/%.o \
|
2023-06-09 08:23:18 +00:00
|
|
|
o/$(MODE)/test/libc/calls/calls.pkg \
|
|
|
|
$(LIBC_TESTMAIN) \
|
|
|
|
$(CRT) \
|
|
|
|
$(APE_NO_MODIFY_SELF)
|
|
|
|
@$(APELINK)
|
|
|
|
|
|
|
|
o/$(MODE)/test/libc/calls/stat_test.com.dbg: \
|
|
|
|
$(TEST_LIBC_CALLS_DEPS) \
|
|
|
|
o/$(MODE)/test/libc/calls/stat_test.o \
|
|
|
|
o/$(MODE)/third_party/python/Lib/test/tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt.zip.o \
|
|
|
|
o/$(MODE)/test/libc/calls/calls.pkg \
|
|
|
|
$(LIBC_TESTMAIN) \
|
|
|
|
$(CRT) \
|
|
|
|
$(APE_NO_MODIFY_SELF)
|
|
|
|
@$(APELINK)
|
|
|
|
|
|
|
|
o/$(MODE)/test/libc/calls/unveil_test.com.dbg: \
|
|
|
|
$(TEST_LIBC_CALLS_DEPS) \
|
|
|
|
o/$(MODE)/test/libc/calls/unveil_test.o \
|
|
|
|
o/$(MODE)/test/libc/mem/prog/life.elf.zip.o \
|
|
|
|
o/$(MODE)/test/libc/mem/prog/sock.elf.zip.o \
|
|
|
|
o/$(MODE)/test/libc/calls/calls.pkg \
|
|
|
|
$(LIBC_TESTMAIN) \
|
|
|
|
$(CRT) \
|
|
|
|
$(APE_NO_MODIFY_SELF)
|
|
|
|
@$(APELINK)
|
|
|
|
|
|
|
|
o/$(MODE)/test/libc/calls/pledge_test.com.dbg: \
|
|
|
|
$(TEST_LIBC_CALLS_DEPS) \
|
|
|
|
o/$(MODE)/test/libc/calls/pledge_test.o \
|
|
|
|
o/$(MODE)/test/libc/mem/prog/life.elf.zip.o \
|
|
|
|
o/$(MODE)/test/libc/mem/prog/sock.elf.zip.o \
|
|
|
|
o/$(MODE)/test/libc/calls/calls.pkg \
|
|
|
|
$(LIBC_TESTMAIN) \
|
|
|
|
$(CRT) \
|
|
|
|
$(APE_NO_MODIFY_SELF)
|
|
|
|
@$(APELINK)
|
|
|
|
|
|
|
|
o/$(MODE)/test/libc/calls/execve_test.com.dbg: \
|
|
|
|
$(TEST_LIBC_CALLS_DEPS) \
|
|
|
|
o/$(MODE)/test/libc/calls/execve_test.o \
|
2022-06-19 08:13:03 +00:00
|
|
|
o/$(MODE)/test/libc/calls/life-nomod.com.zip.o \
|
2022-07-25 02:40:32 +00:00
|
|
|
o/$(MODE)/test/libc/mem/prog/life.elf.zip.o \
|
|
|
|
o/$(MODE)/test/libc/mem/prog/sock.elf.zip.o \
|
2022-06-19 08:13:03 +00:00
|
|
|
o/$(MODE)/test/libc/calls/calls.pkg \
|
|
|
|
$(LIBC_TESTMAIN) \
|
|
|
|
$(CRT) \
|
2022-05-25 18:31:08 +00:00
|
|
|
$(APE_NO_MODIFY_SELF)
|
2020-06-15 14:18:57 +00:00
|
|
|
@$(APELINK)
|
|
|
|
|
2022-06-19 08:13:03 +00:00
|
|
|
o/$(MODE)/test/libc/calls/life-classic.com.dbg: \
|
|
|
|
$(LIBC_RUNTIME) \
|
|
|
|
o/$(MODE)/test/libc/calls/life.o \
|
|
|
|
$(CRT) \
|
|
|
|
$(APE)
|
|
|
|
@$(APELINK)
|
|
|
|
|
|
|
|
o/$(MODE)/test/libc/calls/life-nomod.com.dbg: \
|
|
|
|
$(LIBC_RUNTIME) \
|
|
|
|
o/$(MODE)/test/libc/calls/life.o \
|
|
|
|
$(CRT) \
|
|
|
|
$(APE_NO_MODIFY_SELF)
|
|
|
|
@$(APELINK)
|
|
|
|
|
2022-10-02 15:30:39 +00:00
|
|
|
o/$(MODE)/test/libc/calls/fexecve_test.com.dbg: \
|
|
|
|
$(TEST_LIBC_CALLS_DEPS) \
|
|
|
|
o/$(MODE)/test/libc/calls/fexecve_test.o \
|
|
|
|
o/$(MODE)/test/libc/calls/calls.pkg \
|
2023-02-24 19:48:24 +00:00
|
|
|
o/$(MODE)/test/libc/mem/prog/life.elf.zip.o \
|
2023-02-23 02:58:23 +00:00
|
|
|
o/$(MODE)/test/libc/calls/life-nomod.com.zip.o \
|
2023-03-30 01:16:46 +00:00
|
|
|
o/$(MODE)/test/libc/calls/zipread.com.zip.o \
|
2022-10-02 15:30:39 +00:00
|
|
|
$(LIBC_TESTMAIN) \
|
|
|
|
$(CRT) \
|
|
|
|
$(APE_NO_MODIFY_SELF)
|
|
|
|
@$(APELINK)
|
|
|
|
|
2022-08-11 01:00:45 +00:00
|
|
|
o/$(MODE)/test/libc/calls/tiny64.elf.zip.o \
|
|
|
|
o/$(MODE)/test/libc/calls/life-nomod.com.zip.o \
|
2023-03-30 01:16:46 +00:00
|
|
|
o/$(MODE)/test/libc/calls/life-classic.com.zip.o \
|
|
|
|
o/$(MODE)/test/libc/calls/zipread.com.zip.o: private \
|
2022-08-11 01:00:45 +00:00
|
|
|
ZIPOBJ_FLAGS += \
|
|
|
|
-B
|
|
|
|
|
2022-08-15 05:19:46 +00:00
|
|
|
# TODO(jart): Have pledge() support SIOCGIFCONF
|
2023-07-11 11:29:33 +00:00
|
|
|
o/$(MODE)/test/libc/calls/ioctl_test.com.runs: \
|
2022-08-15 05:19:46 +00:00
|
|
|
private .PLEDGE =
|
|
|
|
|
2022-08-16 02:52:00 +00:00
|
|
|
o/$(MODE)/test/libc/calls/poll_test.com.runs: \
|
|
|
|
private .PLEDGE = stdio rpath wpath cpath fattr proc inet
|
|
|
|
|
2023-06-03 15:12:13 +00:00
|
|
|
o/$(MODE)/test/libc/calls/fcntl_test.com.runs \
|
|
|
|
o/$(MODE)/test/libc/calls/lock_test.com.runs \
|
|
|
|
o/$(MODE)/test/libc/calls/lock2_test.com.runs \
|
2022-10-17 18:02:04 +00:00
|
|
|
o/$(MODE)/test/libc/calls/lock_ofd_test.com.runs: \
|
|
|
|
private .PLEDGE = stdio rpath wpath cpath fattr proc flock
|
|
|
|
|
2023-06-03 15:12:13 +00:00
|
|
|
o/$(MODE)/test/libc/calls/unveil_test.com.runs \
|
2022-09-04 01:01:38 +00:00
|
|
|
o/$(MODE)/test/libc/calls/openbsd_test.com.runs: \
|
|
|
|
private .PLEDGE = stdio rpath wpath cpath fattr proc unveil
|
|
|
|
|
2022-11-03 12:45:33 +00:00
|
|
|
o/$(MODE)/test/libc/calls/fexecve_test.com.runs: \
|
|
|
|
private .UNSANDBOXED = 1 # for memfd_create()
|
|
|
|
|
2023-06-03 15:12:13 +00:00
|
|
|
o/$(MODE)/test/libc/calls/execve_test.com.runs: \
|
2023-03-02 06:32:15 +00:00
|
|
|
private .UNSANDBOXED = 1 # for memfd_create()
|
|
|
|
|
2022-10-10 05:38:28 +00:00
|
|
|
o/$(MODE)/test/libc/calls/read_test.com.runs: \
|
|
|
|
private .UNVEIL += /dev/zero
|
|
|
|
|
2022-08-20 19:32:51 +00:00
|
|
|
# TODO(jart): Update nointernet() to allow AF_INET6
|
|
|
|
o/$(MODE)/test/libc/calls/pledge_test.com.runs: \
|
|
|
|
private .INTERNET = 1
|
|
|
|
o/$(MODE)/test/libc/calls/pledge_test.com.runs: \
|
|
|
|
private .PLEDGE =
|
|
|
|
|
2020-06-15 14:18:57 +00:00
|
|
|
.PHONY: o/$(MODE)/test/libc/calls
|
2022-06-19 08:13:03 +00:00
|
|
|
o/$(MODE)/test/libc/calls: \
|
|
|
|
$(TEST_LIBC_CALLS_BINS) \
|
2020-06-15 14:18:57 +00:00
|
|
|
$(TEST_LIBC_CALLS_CHECKS)
|