xref: /freebsd/tools/regression/sockets/unix_cmsg/Makefile (revision 63d1fd5970ec814904aa0f4580b10a0d302d08b2)
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=
11WARNS?=	3
12
13REXP_bintime= 's|%%TTYPE%%|bintime|g ; s|%%DTYPE%%|bintime|g ; \
14    s|%%SCM_TTYPE%%|SCM_BINTIME|g ; \
15    s|%%MAJ_MEMB%%|sec|g ; s|%%MIN_MEMB%%|frac|g'
16REXP_timeval= 's|%%TTYPE%%|timeval|g ; s|%%DTYPE%%|timeval|g ; \
17    s|%%SCM_TTYPE%%|SCM_TIMESTAMP|g ; \
18    s|%%MAJ_MEMB%%|tv_sec|g ; s|%%MIN_MEMB%%|tv_usec|g'
19
20.for ttype in bintime timeval
21AUTOSRCS+=	t_${ttype}.h t_${ttype}.c
22
23t_${ttype}.o: t_${ttype}.c t_${ttype}.h
24
25t_${ttype}.c: t_xxxtime.c.in
26	sed ${REXP_${ttype}} < ${.ALLSRC} > ${.TARGET}
27
28t_${ttype}.h: t_xxxtime.h.in
29	sed ${REXP_${ttype}} < ${.ALLSRC} > ${.TARGET}
30.endfor
31
32.include <bsd.prog.mk>
33