xref: /freebsd/tools/regression/sockets/unix_cmsg/Makefile (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1# $FreeBSD$
2
3PROG=	unix_cmsg
4SRCS=	${AUTOSRCS} unix_cmsg.c uc_common.h uc_common.c \
5	t_generic.h t_generic.c t_peercred.h t_peercred.c \
6	t_cmsgcred.h t_cmsgcred.c t_sockcred.h t_sockcred.c \
7	t_cmsgcred_sockcred.h t_cmsgcred_sockcred.c t_cmsg_len.h t_cmsg_len.c \
8	uc_check_time.h uc_check_time.c
9CLEANFILES+=	${AUTOSRCS}
10MAN=
11CFLAGS+=	-I${.CURDIR} -I${.OBJDIR}
12WARNS?=	3
13
14REXP_bintime= 's|%%TTYPE%%|bintime|g ; s|%%DTYPE%%|bintime|g ; \
15    s|%%SCM_TTYPE%%|SCM_BINTIME|g ; \
16    s|%%MAJ_MEMB%%|sec|g ; s|%%MIN_MEMB%%|frac|g'
17REXP_timeval= 's|%%TTYPE%%|timeval|g ; s|%%DTYPE%%|timeval|g ; \
18    s|%%SCM_TTYPE%%|SCM_TIMESTAMP|g ; \
19    s|%%MAJ_MEMB%%|tv_sec|g ; s|%%MIN_MEMB%%|tv_usec|g'
20REXP_timespec_real= 's|%%TTYPE%%|timespec_real|g ; s|%%DTYPE%%|timespec|g ; \
21    s|%%SCM_TTYPE%%|SCM_REALTIME|g ; \
22    s|%%MAJ_MEMB%%|tv_sec|g ; s|%%MIN_MEMB%%|tv_nsec|g'
23REXP_timespec_mono= 's|%%TTYPE%%|timespec_mono|g ; s|%%DTYPE%%|timespec|g ; \
24    s|%%SCM_TTYPE%%|SCM_MONOTONIC|g ; \
25    s|%%MAJ_MEMB%%|tv_sec|g ; s|%%MIN_MEMB%%|tv_nsec|g'
26
27.for ttype in bintime timeval timespec_real timespec_mono
28AUTOSRCS+=	t_${ttype}.h t_${ttype}.c
29
30t_${ttype}.o: t_${ttype}.c t_${ttype}.h
31
32t_${ttype}.c: t_xxxtime.c.in
33	sed ${REXP_${ttype}} < ${.ALLSRC} > ${.TARGET}
34
35t_${ttype}.h: t_xxxtime.h.in
36	sed ${REXP_${ttype}} < ${.ALLSRC} > ${.TARGET}
37.endfor
38
39.include <bsd.prog.mk>
40