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