1 1.96 kre # $NetBSD: Makefile,v 1.96 2025/07/17 19:50:40 kre Exp $ 2 1.1 jmmv 3 1.1 jmmv NOMAN= # defined 4 1.1 jmmv 5 1.1 jmmv .include <bsd.own.mk> 6 1.1 jmmv 7 1.1 jmmv TESTSDIR= ${TESTSBASE}/kernel 8 1.1 jmmv 9 1.43 kamil TESTS_SUBDIRS+= kqueue 10 1.83 riastrad TESTS_C+= t_cloexec 11 1.96 kre TESTS_C+= t_clofork 12 1.83 riastrad #TESTS_C+= t_epoll 13 1.85 riastrad TESTS_C+= t_execregs 14 1.73 christos TESTS_C+= t_fcntl 15 1.77 rjs .if ${MKRUMP} != "no" 16 1.76 riastrad TESTS_C+= t_fdrestart 17 1.77 rjs .endif 18 1.80 christos TESTS_C+= t_kauth_pr_47598 19 1.80 christos TESTS_C+= t_ksem 20 1.62 christos TESTS_C+= t_lock 21 1.31 pgoyette TESTS_C+= t_lockf 22 1.74 christos TESTS_C+= t_memfd_create 23 1.27 pgoyette TESTS_C+= t_mqueue 24 1.82 kre TESTS_C+= t_nanosleep 25 1.80 christos TESTS_C+= t_open_pr_57260 26 1.59 kamil TESTS_C+= t_proccwd 27 1.80 christos TESTS_C+= t_pty 28 1.80 christos TESTS_C+= t_semtimedop 29 1.78 pho TESTS_C+= t_signal_and_sp 30 1.28 pgoyette TESTS_C+= t_sysv 31 1.22 christos TESTS_C+= t_subr_prf 32 1.35 gson TESTS_C+= t_sysctl 33 1.49 christos TESTS_C+= t_timeleft 34 1.79 bad .if ${MKRUMP} != "no" 35 1.79 bad TESTS_C+= t_unmount 36 1.79 bad .endif 37 1.53 kamil TESTS_C+= t_zombie 38 1.1 jmmv 39 1.81 msaitoh TESTS_SH= t_fexecve 40 1.80 christos TESTS_SH+= t_fpufork 41 1.47 christos TESTS_SH+= t_interp 42 1.68 jruoho TESTS_SH+= t_magic_symlinks 43 1.67 jruoho TESTS_SH+= t_nointerpreter 44 1.60 christos TESTS_SH+= t_origin 45 1.50 christos TESTS_SH+= t_procpath 46 1.80 christos TESTS_SH+= t_ps_strings 47 1.95 riastrad .if ${MKKMOD} != "no" 48 1.95 riastrad TESTS_SH+= t_setjmp 49 1.95 riastrad .endif 50 1.70 martin .if ${MKRUMP} != "no" 51 1.69 yamaguch TESTS_SH+= t_simplehook 52 1.70 martin .endif 53 1.80 christos TESTS_SH+= t_trapsignal 54 1.80 christos TESTS_SH+= t_umountstress 55 1.81 msaitoh TESTS_SH+= t_umount 56 1.10 pgoyette 57 1.10 pgoyette BINDIR= ${TESTSDIR} 58 1.83 riastrad PROGS+= h_cloexec 59 1.85 riastrad PROGS+= h_execregs 60 1.88 riastrad PROGS+= h_execsp_dynamic 61 1.88 riastrad PROGS+= h_execsp_static 62 1.83 riastrad PROGS+= h_fexecve 63 1.80 christos PROGS+= h_fpufork 64 1.80 christos PROGS+= h_getprocpath 65 1.63 christos PROGS+= h_ps_strings1 66 1.10 pgoyette PROGS+= h_ps_strings2 67 1.48 christos PROGS+= h_segv 68 1.52 nakayama 69 1.52 nakayama SCRIPTSDIR= ${TESTSDIR} 70 1.52 nakayama SCRIPTS= h_interpreter.sh 71 1.1 jmmv 72 1.76 riastrad LDADD.t_fdrestart+= -lpthread 73 1.76 riastrad LDADD.t_fdrestart+= -lrumpnet_local 74 1.76 riastrad LDADD.t_fdrestart+= -lrumpnet_net 75 1.76 riastrad LDADD.t_fdrestart+= -lrumpnet_netinet 76 1.76 riastrad LDADD.t_fdrestart+= -lrumpnet 77 1.76 riastrad LDADD.t_fdrestart+= ${LIBRUMPBASE} 78 1.76 riastrad 79 1.29 nakayama LDADD.t_mqueue+= -lrt 80 1.29 nakayama 81 1.79 bad LDADD.t_unmount+= -lrumpfs_tmpfs 82 1.79 bad LDADD.t_unmount+= ${LIBRUMPBASE} 83 1.79 bad 84 1.26 christos 85 1.37 matt .if (${MKRUMP} != "no") && !defined(BSD_MK_COMPAT_FILE) 86 1.26 christos TESTS_SUBDIRS+= tty 87 1.26 christos 88 1.26 christos TESTS_C+= t_extattrctl 89 1.26 christos TESTS_C+= t_filedesc 90 1.26 christos TESTS_C+= t_rnd 91 1.66 christos LDADD.t_extattrctl+= ${LIBRUMPBASE} 92 1.26 christos LDADD.t_filedesc+= ${LDADD.t_rnd} 93 1.66 christos LDADD.t_rnd+= -lrumpdev_rnd -lrumpdev ${LIBRUMPBASE} 94 1.26 christos 95 1.26 christos .endif 96 1.26 christos 97 1.51 christos LDADD.t_timeleft+= -lpthread 98 1.51 christos 99 1.44 kamil CPPFLAGS+= -D_KERNTYPES 100 1.79 bad CPPFLAGS.t_unmount.c+= -D_KMEMUSER -D__EXPOSE_MOUNT 101 1.2 pooka 102 1.89 riastrad .if exists(${.PARSEDIR}/arch/${MACHINE_ARCH}) 103 1.88 riastrad ARCHDIR:= ${.PARSEDIR}/arch/${MACHINE_ARCH} 104 1.89 riastrad .else 105 1.89 riastrad ARCHDIR:= ${.PARSEDIR}/arch/${MACHINE_CPU} 106 1.89 riastrad .endif 107 1.88 riastrad .PATH: ${ARCHDIR} 108 1.88 riastrad 109 1.88 riastrad .if exists(${ARCHDIR}/stack_pointer.h) 110 1.88 riastrad CPPFLAGS.t_signal_and_sp.c+= -I${ARCHDIR} -DHAVE_STACK_POINTER_H 111 1.88 riastrad .endif 112 1.88 riastrad 113 1.88 riastrad SRCS.t_signal_and_sp+= t_signal_and_sp.c 114 1.90 riastrad .if exists(${ARCHDIR}/contextspfunc.S) 115 1.90 riastrad CPPFLAGS.t_signal_and_sp.c+= -DHAVE_CONTEXTSPFUNC 116 1.90 riastrad SRCS.t_signal_and_sp+= contextspfunc.S 117 1.90 riastrad .endif 118 1.88 riastrad .if exists(${ARCHDIR}/signalsphandler.S) 119 1.88 riastrad CPPFLAGS.t_signal_and_sp.c+= -DHAVE_SIGNALSPHANDLER 120 1.88 riastrad SRCS.t_signal_and_sp+= signalsphandler.S 121 1.88 riastrad .endif 122 1.90 riastrad .if exists(${ARCHDIR}/threadspfunc.S) 123 1.90 riastrad CPPFLAGS.t_signal_and_sp.c+= -DHAVE_THREADSPFUNC 124 1.90 riastrad SRCS.t_signal_and_sp+= threadspfunc.S 125 1.90 riastrad LDADD.t_signal_and_sp+= -pthread 126 1.90 riastrad .endif 127 1.88 riastrad 128 1.88 riastrad SRCS.h_execsp_dynamic+= h_execsp.c 129 1.88 riastrad SRCS.h_execsp_static+= h_execsp.c 130 1.88 riastrad .if exists(${ARCHDIR}/execsp.S) 131 1.88 riastrad CPPFLAGS.t_signal_and_sp.c+= -DHAVE_EXECSP 132 1.88 riastrad SRCS.h_execsp_dynamic+= execsp.S 133 1.88 riastrad SRCS.h_execsp_static+= execsp.S 134 1.88 riastrad LDFLAGS.h_execsp_dynamic+= -Wl,-e,execsp_start 135 1.88 riastrad LDFLAGS.h_execsp_static+= -Wl,-e,execsp_start 136 1.88 riastrad .else 137 1.88 riastrad CPPFLAGS.h_execsp.c+= -Dexecsp_main=main 138 1.78 pho .endif 139 1.88 riastrad LDSTATIC.h_execsp_static= -static 140 1.78 pho 141 1.89 riastrad .if ${MACHINE_CPU} == "mips" 142 1.90 riastrad CPPFLAGS.contextspfunc.S+= -I${NETBSDSRCDIR}/lib/libc/arch/mips 143 1.89 riastrad CPPFLAGS.execsp.S+= -I${NETBSDSRCDIR}/lib/libc/arch/mips 144 1.89 riastrad CPPFLAGS.signalsphandler.S+= -I${NETBSDSRCDIR}/lib/libc/arch/mips 145 1.89 riastrad .endif 146 1.89 riastrad 147 1.1 jmmv .PATH: ${NETBSDSRCDIR}/sys/kern 148 1.1 jmmv TESTS_C+= t_extent 149 1.1 jmmv SRCS.t_extent= t_extent.c subr_extent.c 150 1.39 christos CPPFLAGS.t_extent.c= -D_EXTENT_TESTING -D__POOL_EXPOSE -D_KERNTYPES 151 1.39 christos CPPFLAGS.subr_extent.c= -D_EXTENT_TESTING -D__POOL_EXPOSE -D_KERNTYPES 152 1.1 jmmv 153 1.84 riastrad TESTS_C+= t_time_arith 154 1.84 riastrad SRCS.t_time_arith= t_time_arith.c subr_time_arith.c 155 1.84 riastrad CPPFLAGS.t_time_arith.c+= -I${NETBSDSRCDIR}/sys -D_TIME_TESTING 156 1.84 riastrad CPPFLAGS.subr_time_arith.c+= -I${NETBSDSRCDIR}/sys -D_TIME_TESTING 157 1.84 riastrad LDADD.t_time_arith+= -lutil 158 1.84 riastrad 159 1.22 christos t_subr_prf.c: gen_t_subr_prf ${NETBSDSRCDIR}/sys/kern/subr_prf.c 160 1.22 christos ${HOST_SH} ${.ALLSRC} ${.TARGET} 161 1.61 kamil .if ${MKSANITIZER:Uno} == "yes" 162 1.61 kamil # These symbols will be redefined by MKSANITIZER 163 1.61 kamil ${TOOL_SED} -i '/undef .*printf/d' ${.TARGET} 164 1.61 kamil .endif 165 1.61 kamil 166 1.36 tls CPPFLAGS.t_subr_prf.c= -Wno-pointer-sign # XXX platform vs kernel SHA2 167 1.22 christos 168 1.58 mrg # Test explicitly tests failure modes. 169 1.72 lukem CPPFLAGS.t_subr_prf.c+= ${CC_WNO_FORMAT_TRUNCATION} 170 1.58 mrg 171 1.61 kamil SANITIZER_RENAME_CLASSES+= t_subr_prf 172 1.61 kamil SANITIZER_RENAME_FILES.t_subr_prf+= t_subr_prf.c 173 1.61 kamil SANITIZER_RENAME_SYMBOL.t_subr_prf+= snprintf 174 1.61 kamil SANITIZER_RENAME_SYMBOL.t_subr_prf+= vsnprintf 175 1.61 kamil SANITIZER_RENAME_SYMBOL.t_subr_prf+= sprintf 176 1.61 kamil SANITIZER_RENAME_SYMBOL.t_subr_prf+= vsnprintf 177 1.61 kamil SANITIZER_RENAME_SYMBOL.t_subr_prf+= vasprintf 178 1.61 kamil 179 1.22 christos CLEANFILES+= t_subr_prf.c 180 1.22 christos 181 1.54 riastrad LDADD.h_segv+= -lm 182 1.54 riastrad 183 1.85 riastrad .if exists(arch/${MACHINE_ARCH}/execregs.h) 184 1.85 riastrad CPPFLAGS.t_execregs.c+= -I${ARCHDIR} 185 1.86 riastrad CPPFLAGS.t_execregs.c+= -I${.CURDIR}/../lib/libc/gen # isqemu.h 186 1.85 riastrad CPPFLAGS.t_execregs.c+= -DHAVE_EXECREGS_TEST 187 1.85 riastrad SRCS.t_execregs+= t_execregs.c 188 1.85 riastrad SRCS.t_execregs+= execregs.c 189 1.87 riastrad LDSTATIC.h_execregs= -static 190 1.87 riastrad LDFLAGS.h_execregs+= -Wl,-e,execregs_start 191 1.85 riastrad .else 192 1.85 riastrad SRCS.h_execregs= h_execregs_unimpl.c 193 1.85 riastrad .endif 194 1.85 riastrad 195 1.95 riastrad .if ${MKKMOD} != "no" 196 1.95 riastrad SUBDIR+= setjmp_tester 197 1.95 riastrad .endif 198 1.95 riastrad 199 1.1 jmmv .include <bsd.test.mk> 200