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