Makefile revision 1.95
11.95Sriastrad# $NetBSD: Makefile,v 1.95 2025/04/27 16:22:26 riastradh Exp $
21.1Sjmmv
31.1SjmmvNOMAN=		# defined
41.1Sjmmv
51.1Sjmmv.include <bsd.own.mk>
61.1Sjmmv
71.1SjmmvTESTSDIR=	${TESTSBASE}/kernel
81.1Sjmmv
91.43SkamilTESTS_SUBDIRS+=	kqueue
101.83SriastradTESTS_C+=	t_cloexec
111.83Sriastrad#TESTS_C+=	t_epoll
121.85SriastradTESTS_C+=	t_execregs
131.73SchristosTESTS_C+=	t_fcntl
141.77Srjs.if ${MKRUMP} != "no"
151.76SriastradTESTS_C+=	t_fdrestart
161.77Srjs.endif
171.80SchristosTESTS_C+=	t_kauth_pr_47598
181.80SchristosTESTS_C+=	t_ksem
191.62SchristosTESTS_C+=	t_lock
201.31SpgoyetteTESTS_C+=	t_lockf
211.74SchristosTESTS_C+=	t_memfd_create
221.27SpgoyetteTESTS_C+=	t_mqueue
231.82SkreTESTS_C+=	t_nanosleep
241.80SchristosTESTS_C+=	t_open_pr_57260
251.59SkamilTESTS_C+=	t_proccwd
261.80SchristosTESTS_C+=	t_pty
271.80SchristosTESTS_C+=	t_semtimedop
281.78SphoTESTS_C+=	t_signal_and_sp
291.28SpgoyetteTESTS_C+=	t_sysv
301.22SchristosTESTS_C+=	t_subr_prf
311.35SgsonTESTS_C+=	t_sysctl
321.49SchristosTESTS_C+=	t_timeleft
331.79Sbad.if ${MKRUMP} != "no"
341.79SbadTESTS_C+=	t_unmount
351.79Sbad.endif
361.53SkamilTESTS_C+=	t_zombie
371.1Sjmmv
381.81SmsaitohTESTS_SH=	t_fexecve
391.80SchristosTESTS_SH+=	t_fpufork
401.47SchristosTESTS_SH+=	t_interp
411.68SjruohoTESTS_SH+=	t_magic_symlinks
421.67SjruohoTESTS_SH+=	t_nointerpreter
431.60SchristosTESTS_SH+=	t_origin
441.50SchristosTESTS_SH+=	t_procpath
451.80SchristosTESTS_SH+=	t_ps_strings
461.95Sriastrad.if ${MKKMOD} != "no"
471.95SriastradTESTS_SH+=	t_setjmp
481.95Sriastrad.endif
491.70Smartin.if ${MKRUMP} != "no"
501.69SyamaguchTESTS_SH+=	t_simplehook
511.70Smartin.endif
521.80SchristosTESTS_SH+=	t_trapsignal
531.80SchristosTESTS_SH+=	t_umountstress
541.81SmsaitohTESTS_SH+=	t_umount
551.10Spgoyette
561.10SpgoyetteBINDIR=		${TESTSDIR}
571.83SriastradPROGS+=		h_cloexec
581.85SriastradPROGS+=		h_execregs
591.88SriastradPROGS+=		h_execsp_dynamic
601.88SriastradPROGS+=		h_execsp_static
611.83SriastradPROGS+=		h_fexecve
621.80SchristosPROGS+=		h_fpufork
631.80SchristosPROGS+=		h_getprocpath
641.63SchristosPROGS+=		h_ps_strings1
651.10SpgoyettePROGS+=		h_ps_strings2
661.48SchristosPROGS+=		h_segv
671.52Snakayama
681.52SnakayamaSCRIPTSDIR=	${TESTSDIR}
691.52SnakayamaSCRIPTS=	h_interpreter.sh
701.1Sjmmv
711.76SriastradLDADD.t_fdrestart+=	-lpthread
721.76SriastradLDADD.t_fdrestart+=	-lrumpnet_local
731.76SriastradLDADD.t_fdrestart+=	-lrumpnet_net
741.76SriastradLDADD.t_fdrestart+=	-lrumpnet_netinet
751.76SriastradLDADD.t_fdrestart+=	-lrumpnet
761.76SriastradLDADD.t_fdrestart+=	${LIBRUMPBASE}
771.76Sriastrad
781.29SnakayamaLDADD.t_mqueue+= -lrt
791.29Snakayama
801.79SbadLDADD.t_unmount+=	-lrumpfs_tmpfs
811.79SbadLDADD.t_unmount+=	${LIBRUMPBASE}
821.79Sbad
831.26Schristos
841.37Smatt.if (${MKRUMP} != "no") && !defined(BSD_MK_COMPAT_FILE)
851.26SchristosTESTS_SUBDIRS+=	tty
861.26Schristos
871.26SchristosTESTS_C+=	t_extattrctl
881.26SchristosTESTS_C+=	t_filedesc
891.26SchristosTESTS_C+=	t_rnd
901.66SchristosLDADD.t_extattrctl+= ${LIBRUMPBASE}
911.26SchristosLDADD.t_filedesc+=  ${LDADD.t_rnd}
921.66SchristosLDADD.t_rnd+=  -lrumpdev_rnd -lrumpdev ${LIBRUMPBASE}
931.26Schristos
941.26Schristos.endif
951.26Schristos
961.51SchristosLDADD.t_timeleft+=	-lpthread
971.51Schristos
981.44SkamilCPPFLAGS+=	-D_KERNTYPES
991.79SbadCPPFLAGS.t_unmount.c+=	-D_KMEMUSER -D__EXPOSE_MOUNT
1001.2Spooka
1011.89Sriastrad.if exists(${.PARSEDIR}/arch/${MACHINE_ARCH})
1021.88SriastradARCHDIR:=		${.PARSEDIR}/arch/${MACHINE_ARCH}
1031.89Sriastrad.else
1041.89SriastradARCHDIR:=		${.PARSEDIR}/arch/${MACHINE_CPU}
1051.89Sriastrad.endif
1061.88Sriastrad.PATH:			${ARCHDIR}
1071.88Sriastrad
1081.88Sriastrad.if exists(${ARCHDIR}/stack_pointer.h)
1091.88SriastradCPPFLAGS.t_signal_and_sp.c+=	-I${ARCHDIR} -DHAVE_STACK_POINTER_H
1101.88Sriastrad.endif
1111.88Sriastrad
1121.88SriastradSRCS.t_signal_and_sp+=		t_signal_and_sp.c
1131.90Sriastrad.if exists(${ARCHDIR}/contextspfunc.S)
1141.90SriastradCPPFLAGS.t_signal_and_sp.c+=	-DHAVE_CONTEXTSPFUNC
1151.90SriastradSRCS.t_signal_and_sp+=		contextspfunc.S
1161.90Sriastrad.endif
1171.88Sriastrad.if exists(${ARCHDIR}/signalsphandler.S)
1181.88SriastradCPPFLAGS.t_signal_and_sp.c+=	-DHAVE_SIGNALSPHANDLER
1191.88SriastradSRCS.t_signal_and_sp+=		signalsphandler.S
1201.88Sriastrad.endif
1211.90Sriastrad.if exists(${ARCHDIR}/threadspfunc.S)
1221.90SriastradCPPFLAGS.t_signal_and_sp.c+=	-DHAVE_THREADSPFUNC
1231.90SriastradSRCS.t_signal_and_sp+=		threadspfunc.S
1241.90SriastradLDADD.t_signal_and_sp+=		-pthread
1251.90Sriastrad.endif
1261.88Sriastrad
1271.88SriastradSRCS.h_execsp_dynamic+=		h_execsp.c
1281.88SriastradSRCS.h_execsp_static+=		h_execsp.c
1291.88Sriastrad.if exists(${ARCHDIR}/execsp.S)
1301.88SriastradCPPFLAGS.t_signal_and_sp.c+=	-DHAVE_EXECSP
1311.88SriastradSRCS.h_execsp_dynamic+=		execsp.S
1321.88SriastradSRCS.h_execsp_static+=		execsp.S
1331.88SriastradLDFLAGS.h_execsp_dynamic+=	-Wl,-e,execsp_start
1341.88SriastradLDFLAGS.h_execsp_static+=	-Wl,-e,execsp_start
1351.88Sriastrad.else
1361.88SriastradCPPFLAGS.h_execsp.c+=		-Dexecsp_main=main
1371.78Spho.endif
1381.88SriastradLDSTATIC.h_execsp_static=	-static
1391.78Spho
1401.89Sriastrad.if ${MACHINE_CPU} == "mips"
1411.90SriastradCPPFLAGS.contextspfunc.S+=	-I${NETBSDSRCDIR}/lib/libc/arch/mips
1421.89SriastradCPPFLAGS.execsp.S+=		-I${NETBSDSRCDIR}/lib/libc/arch/mips
1431.89SriastradCPPFLAGS.signalsphandler.S+=	-I${NETBSDSRCDIR}/lib/libc/arch/mips
1441.89Sriastrad.endif
1451.89Sriastrad
1461.1Sjmmv.PATH:			${NETBSDSRCDIR}/sys/kern
1471.1SjmmvTESTS_C+=		t_extent
1481.1SjmmvSRCS.t_extent=		t_extent.c subr_extent.c
1491.39SchristosCPPFLAGS.t_extent.c=	-D_EXTENT_TESTING -D__POOL_EXPOSE -D_KERNTYPES
1501.39SchristosCPPFLAGS.subr_extent.c=	-D_EXTENT_TESTING -D__POOL_EXPOSE -D_KERNTYPES
1511.1Sjmmv
1521.84SriastradTESTS_C+=		t_time_arith
1531.84SriastradSRCS.t_time_arith=	t_time_arith.c subr_time_arith.c
1541.84SriastradCPPFLAGS.t_time_arith.c+=	-I${NETBSDSRCDIR}/sys -D_TIME_TESTING
1551.84SriastradCPPFLAGS.subr_time_arith.c+=	-I${NETBSDSRCDIR}/sys -D_TIME_TESTING
1561.84SriastradLDADD.t_time_arith+=	-lutil
1571.84Sriastrad
1581.22Schristost_subr_prf.c: gen_t_subr_prf ${NETBSDSRCDIR}/sys/kern/subr_prf.c
1591.22Schristos	${HOST_SH} ${.ALLSRC} ${.TARGET}
1601.61Skamil.if ${MKSANITIZER:Uno} == "yes"
1611.61Skamil	# These symbols will be redefined by MKSANITIZER
1621.61Skamil	${TOOL_SED} -i '/undef .*printf/d' ${.TARGET}
1631.61Skamil.endif
1641.61Skamil
1651.36StlsCPPFLAGS.t_subr_prf.c=	-Wno-pointer-sign	# XXX platform vs kernel SHA2
1661.22Schristos
1671.58Smrg# Test explicitly tests failure modes.
1681.72SlukemCPPFLAGS.t_subr_prf.c+=	${CC_WNO_FORMAT_TRUNCATION}
1691.58Smrg
1701.61SkamilSANITIZER_RENAME_CLASSES+=		t_subr_prf
1711.61SkamilSANITIZER_RENAME_FILES.t_subr_prf+=	t_subr_prf.c
1721.61SkamilSANITIZER_RENAME_SYMBOL.t_subr_prf+=	snprintf
1731.61SkamilSANITIZER_RENAME_SYMBOL.t_subr_prf+=	vsnprintf
1741.61SkamilSANITIZER_RENAME_SYMBOL.t_subr_prf+=	sprintf
1751.61SkamilSANITIZER_RENAME_SYMBOL.t_subr_prf+=	vsnprintf
1761.61SkamilSANITIZER_RENAME_SYMBOL.t_subr_prf+=	vasprintf
1771.61Skamil
1781.22SchristosCLEANFILES+=	t_subr_prf.c
1791.22Schristos
1801.54SriastradLDADD.h_segv+=	-lm
1811.54Sriastrad
1821.85Sriastrad.if exists(arch/${MACHINE_ARCH}/execregs.h)
1831.85SriastradCPPFLAGS.t_execregs.c+=	-I${ARCHDIR}
1841.86SriastradCPPFLAGS.t_execregs.c+=	-I${.CURDIR}/../lib/libc/gen # isqemu.h
1851.85SriastradCPPFLAGS.t_execregs.c+=	-DHAVE_EXECREGS_TEST
1861.85SriastradSRCS.t_execregs+=	t_execregs.c
1871.85SriastradSRCS.t_execregs+=	execregs.c
1881.87SriastradLDSTATIC.h_execregs=	-static
1891.87SriastradLDFLAGS.h_execregs+=	-Wl,-e,execregs_start
1901.85Sriastrad.else
1911.85SriastradSRCS.h_execregs=	h_execregs_unimpl.c
1921.85Sriastrad.endif
1931.85Sriastrad
1941.95Sriastrad.if ${MKKMOD} != "no"
1951.95SriastradSUBDIR+=	setjmp_tester
1961.95Sriastrad.endif
1971.95Sriastrad
1981.1Sjmmv.include <bsd.test.mk>
199