11.1Schristos#	$NetBSD: Makefile,v 1.1 2023/08/19 22:56:44 christos Exp $
21.1Schristos
31.1Schristos.include <bsd.own.mk>
41.1Schristos
51.1SchristosTESTSDIR=	${TESTSBASE}/compat/linux
61.1SchristosTESTS_SH=	t_inotify
71.1Schristos
81.1SchristosTC_PROGS=	h_inotify_init
91.1SchristosTC_PROGS+=	h_inotify_directory
101.1SchristosTC_PROGS+=	h_inotify_single_file
111.1SchristosTC_PROGS+=	h_inotify_watch_change
121.1Schristos
131.1Schristos.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}
141.1Schristos
151.1SchristosLDFLAGS+=	-nostartfiles -static
161.1SchristosCFLAGS+=	-I${.CURDIR}/../../../sys
171.1SchristosCFLAGS+=	-I${.CURDIR}
181.1SchristosCFLAGS+=	-D_STANDALONE
191.1Schristos
201.1SchristosFILESDIR=	${TESTSDIR}
211.1Schristos
221.1Schristos.for _P in ${TESTS_SH}
231.1Schristos.if ${MACHINE_ARCH} == "x86_64"
241.1SchristosTESTS_SH_SRC_${_P}=	h_common.sh
251.1Schristos.else
261.1SchristosTESTS_SH_SRC_${_P}=	h_not_supported.sh
271.1Schristos.endif
281.1SchristosTESTS_SH_SRC_${_P}+=	${_P}.sh
291.1Schristos.endfor
301.1Schristos
311.1Schristos.for _P in ${TC_PROGS}
321.1SchristosCLEANFILES+=		${_P}
331.1SchristosFILES+=			${_P}
341.1Schristos
351.1Schristos.if ${MACHINE_ARCH} == "x86_64"
361.1SchristosPROGS+=			${_P}.out
371.1SchristosSRCS.${_P}.out=		${_P}.c
381.1SchristosSRCS.${_P}.out+=	h_linux.c
391.1SchristosSRCS.${_P}.out+=	h_syscall.c
401.1SchristosMAN.${_P}.out=		# empty
411.1SchristosFILESMODE_${_P}=	${BINMODE}
421.1Schristos
431.1Schristosproginstall-${_P}.out:
441.1Schristos	# Do not install
451.1Schristos
461.1Schristos${_P}: ${_P}.out
471.1Schristos	${_MKTARGET_CREATE}
481.1Schristos	cp ${.ALLSRC} ${.TARGET}
491.1Schristos	${ELFEDIT} --output-osabi Linux ${.TARGET}
501.1Schristos.else
511.1Schristos${_P}:
521.1Schristos	echo '' > ${.TARGET}
531.1Schristos.endif
541.1Schristos
551.1Schristosrealall: ${_P}
561.1Schristos.endfor
571.1Schristos
581.1SchristosCLEANFILES+=	${TESTS_SH}
591.1SchristosCLEANFILES+=	Atffile
601.1Schristos
611.1Schristos.include <bsd.test.mk>
62