Makefile revision 1.90
11.90Sriastrad# $NetBSD: Makefile,v 1.90 2025/04/21 02:33:44 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.70Smartin.if ${MKRUMP} != "no" 471.69SyamaguchTESTS_SH+= t_simplehook 481.70Smartin.endif 491.80SchristosTESTS_SH+= t_trapsignal 501.80SchristosTESTS_SH+= t_umountstress 511.81SmsaitohTESTS_SH+= t_umount 521.10Spgoyette 531.10SpgoyetteBINDIR= ${TESTSDIR} 541.83SriastradPROGS+= h_cloexec 551.85SriastradPROGS+= h_execregs 561.88SriastradPROGS+= h_execsp_dynamic 571.88SriastradPROGS+= h_execsp_static 581.83SriastradPROGS+= h_fexecve 591.80SchristosPROGS+= h_fpufork 601.80SchristosPROGS+= h_getprocpath 611.63SchristosPROGS+= h_ps_strings1 621.10SpgoyettePROGS+= h_ps_strings2 631.48SchristosPROGS+= h_segv 641.52Snakayama 651.52SnakayamaSCRIPTSDIR= ${TESTSDIR} 661.52SnakayamaSCRIPTS= h_interpreter.sh 671.1Sjmmv 681.76SriastradLDADD.t_fdrestart+= -lpthread 691.76SriastradLDADD.t_fdrestart+= -lrumpnet_local 701.76SriastradLDADD.t_fdrestart+= -lrumpnet_net 711.76SriastradLDADD.t_fdrestart+= -lrumpnet_netinet 721.76SriastradLDADD.t_fdrestart+= -lrumpnet 731.76SriastradLDADD.t_fdrestart+= ${LIBRUMPBASE} 741.76Sriastrad 751.29SnakayamaLDADD.t_mqueue+= -lrt 761.29Snakayama 771.79SbadLDADD.t_unmount+= -lrumpfs_tmpfs 781.79SbadLDADD.t_unmount+= ${LIBRUMPBASE} 791.79Sbad 801.26Schristos 811.37Smatt.if (${MKRUMP} != "no") && !defined(BSD_MK_COMPAT_FILE) 821.26SchristosTESTS_SUBDIRS+= tty 831.26Schristos 841.26SchristosTESTS_C+= t_extattrctl 851.26SchristosTESTS_C+= t_filedesc 861.26SchristosTESTS_C+= t_rnd 871.66SchristosLDADD.t_extattrctl+= ${LIBRUMPBASE} 881.26SchristosLDADD.t_filedesc+= ${LDADD.t_rnd} 891.66SchristosLDADD.t_rnd+= -lrumpdev_rnd -lrumpdev ${LIBRUMPBASE} 901.26Schristos 911.26Schristos.endif 921.26Schristos 931.51SchristosLDADD.t_timeleft+= -lpthread 941.51Schristos 951.44SkamilCPPFLAGS+= -D_KERNTYPES 961.79SbadCPPFLAGS.t_unmount.c+= -D_KMEMUSER -D__EXPOSE_MOUNT 971.2Spooka 981.89Sriastrad.if exists(${.PARSEDIR}/arch/${MACHINE_ARCH}) 991.88SriastradARCHDIR:= ${.PARSEDIR}/arch/${MACHINE_ARCH} 1001.89Sriastrad.else 1011.89SriastradARCHDIR:= ${.PARSEDIR}/arch/${MACHINE_CPU} 1021.89Sriastrad.endif 1031.88Sriastrad.PATH: ${ARCHDIR} 1041.88Sriastrad 1051.88Sriastrad.if exists(${ARCHDIR}/stack_pointer.h) 1061.88SriastradCPPFLAGS.t_signal_and_sp.c+= -I${ARCHDIR} -DHAVE_STACK_POINTER_H 1071.88Sriastrad.endif 1081.88Sriastrad 1091.88SriastradSRCS.t_signal_and_sp+= t_signal_and_sp.c 1101.90Sriastrad.if exists(${ARCHDIR}/contextspfunc.S) 1111.90SriastradCPPFLAGS.t_signal_and_sp.c+= -DHAVE_CONTEXTSPFUNC 1121.90SriastradSRCS.t_signal_and_sp+= contextspfunc.S 1131.90Sriastrad.endif 1141.88Sriastrad.if exists(${ARCHDIR}/signalsphandler.S) 1151.88SriastradCPPFLAGS.t_signal_and_sp.c+= -DHAVE_SIGNALSPHANDLER 1161.88SriastradSRCS.t_signal_and_sp+= signalsphandler.S 1171.88Sriastrad.endif 1181.90Sriastrad.if exists(${ARCHDIR}/threadspfunc.S) 1191.90SriastradCPPFLAGS.t_signal_and_sp.c+= -DHAVE_THREADSPFUNC 1201.90SriastradSRCS.t_signal_and_sp+= threadspfunc.S 1211.90SriastradLDADD.t_signal_and_sp+= -pthread 1221.90Sriastrad.endif 1231.88Sriastrad 1241.88SriastradSRCS.h_execsp_dynamic+= h_execsp.c 1251.88SriastradSRCS.h_execsp_static+= h_execsp.c 1261.88Sriastrad.if exists(${ARCHDIR}/execsp.S) 1271.88SriastradCPPFLAGS.t_signal_and_sp.c+= -DHAVE_EXECSP 1281.88SriastradSRCS.h_execsp_dynamic+= execsp.S 1291.88SriastradSRCS.h_execsp_static+= execsp.S 1301.88SriastradLDFLAGS.h_execsp_dynamic+= -Wl,-e,execsp_start 1311.88SriastradLDFLAGS.h_execsp_static+= -Wl,-e,execsp_start 1321.88Sriastrad.else 1331.88SriastradCPPFLAGS.h_execsp.c+= -Dexecsp_main=main 1341.78Spho.endif 1351.88SriastradLDSTATIC.h_execsp_static= -static 1361.78Spho 1371.89Sriastrad.if ${MACHINE_CPU} == "mips" 1381.90SriastradCPPFLAGS.contextspfunc.S+= -I${NETBSDSRCDIR}/lib/libc/arch/mips 1391.89SriastradCPPFLAGS.execsp.S+= -I${NETBSDSRCDIR}/lib/libc/arch/mips 1401.89SriastradCPPFLAGS.signalsphandler.S+= -I${NETBSDSRCDIR}/lib/libc/arch/mips 1411.89Sriastrad.endif 1421.89Sriastrad 1431.1Sjmmv.PATH: ${NETBSDSRCDIR}/sys/kern 1441.1SjmmvTESTS_C+= t_extent 1451.1SjmmvSRCS.t_extent= t_extent.c subr_extent.c 1461.39SchristosCPPFLAGS.t_extent.c= -D_EXTENT_TESTING -D__POOL_EXPOSE -D_KERNTYPES 1471.39SchristosCPPFLAGS.subr_extent.c= -D_EXTENT_TESTING -D__POOL_EXPOSE -D_KERNTYPES 1481.1Sjmmv 1491.84SriastradTESTS_C+= t_time_arith 1501.84SriastradSRCS.t_time_arith= t_time_arith.c subr_time_arith.c 1511.84SriastradCPPFLAGS.t_time_arith.c+= -I${NETBSDSRCDIR}/sys -D_TIME_TESTING 1521.84SriastradCPPFLAGS.subr_time_arith.c+= -I${NETBSDSRCDIR}/sys -D_TIME_TESTING 1531.84SriastradLDADD.t_time_arith+= -lutil 1541.84Sriastrad 1551.22Schristost_subr_prf.c: gen_t_subr_prf ${NETBSDSRCDIR}/sys/kern/subr_prf.c 1561.22Schristos ${HOST_SH} ${.ALLSRC} ${.TARGET} 1571.61Skamil.if ${MKSANITIZER:Uno} == "yes" 1581.61Skamil # These symbols will be redefined by MKSANITIZER 1591.61Skamil ${TOOL_SED} -i '/undef .*printf/d' ${.TARGET} 1601.61Skamil.endif 1611.61Skamil 1621.36StlsCPPFLAGS.t_subr_prf.c= -Wno-pointer-sign # XXX platform vs kernel SHA2 1631.22Schristos 1641.58Smrg# Test explicitly tests failure modes. 1651.72SlukemCPPFLAGS.t_subr_prf.c+= ${CC_WNO_FORMAT_TRUNCATION} 1661.58Smrg 1671.61SkamilSANITIZER_RENAME_CLASSES+= t_subr_prf 1681.61SkamilSANITIZER_RENAME_FILES.t_subr_prf+= t_subr_prf.c 1691.61SkamilSANITIZER_RENAME_SYMBOL.t_subr_prf+= snprintf 1701.61SkamilSANITIZER_RENAME_SYMBOL.t_subr_prf+= vsnprintf 1711.61SkamilSANITIZER_RENAME_SYMBOL.t_subr_prf+= sprintf 1721.61SkamilSANITIZER_RENAME_SYMBOL.t_subr_prf+= vsnprintf 1731.61SkamilSANITIZER_RENAME_SYMBOL.t_subr_prf+= vasprintf 1741.61Skamil 1751.22SchristosCLEANFILES+= t_subr_prf.c 1761.22Schristos 1771.54SriastradLDADD.h_segv+= -lm 1781.54Sriastrad 1791.85Sriastrad.if exists(arch/${MACHINE_ARCH}/execregs.h) 1801.85SriastradCPPFLAGS.t_execregs.c+= -I${ARCHDIR} 1811.86SriastradCPPFLAGS.t_execregs.c+= -I${.CURDIR}/../lib/libc/gen # isqemu.h 1821.85SriastradCPPFLAGS.t_execregs.c+= -DHAVE_EXECREGS_TEST 1831.85SriastradSRCS.t_execregs+= t_execregs.c 1841.85SriastradSRCS.t_execregs+= execregs.c 1851.87SriastradLDSTATIC.h_execregs= -static 1861.87SriastradLDFLAGS.h_execregs+= -Wl,-e,execregs_start 1871.85Sriastrad.else 1881.85SriastradSRCS.h_execregs= h_execregs_unimpl.c 1891.85Sriastrad.endif 1901.85Sriastrad 1911.1Sjmmv.include <bsd.test.mk> 192