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