Makefile revision 207849
1# $FreeBSD: head/usr.bin/cpio/test/Makefile 207849 2010-05-10 15:28:44Z mm $
2
3# Where to find the cpio sources (for the internal unit tests)
4CPIO_SRCDIR=${.CURDIR}/..
5.PATH: ${CPIO_SRCDIR}
6
7# Some cpio sources are pulled in for white-box tests
8CPIO_SRCS= cmdline.c err.c pathmatch.c
9
10TESTS=	\
11	test_0.c				\
12	test_basic.c				\
13	test_format_newc.c			\
14	test_gcpio_compat.c			\
15	test_option_a.c				\
16	test_option_B.c				\
17	test_option_c.c				\
18	test_option_d.c				\
19	test_option_f.c				\
20	test_option_help.c			\
21	test_option_L.c				\
22	test_option_ell.c			\
23	test_option_m.c				\
24	test_option_t.c				\
25	test_option_u.c				\
26	test_option_version.c			\
27	test_option_y.c				\
28	test_option_z.c				\
29	test_owner_parse.c			\
30	test_passthrough_dotdot.c		\
31	test_passthrough_reverse.c		\
32	test_pathmatch.c
33
34# Build the test program
35SRCS= list.h					\
36	${CPIO_SRCS}				\
37	${TESTS}				\
38	main.c
39
40CLEANFILES+= list.h bsdcpio_test
41
42NO_MAN=yes
43
44PROG=bsdcpio_test
45DPADD=${LIBARCHIVE} ${LIBBZ2} ${LIBZ} ${LIBLZMA}
46CFLAGS+=	-DPLATFORM_CONFIG_H=\"config_freebsd.h\"
47CFLAGS+=	-I..
48LDADD= -larchive -lz -lbz2 -llzma
49CFLAGS+= -static -g -O2 -Wall
50CFLAGS+= -I${.OBJDIR}
51CFLAGS+= -I${CPIO_SRCDIR}
52
53# Uncomment to link against dmalloc
54#LDADD+= -L/usr/local/lib -ldmalloc
55#CFLAGS+= -I/usr/local/include -DUSE_DMALLOC
56
57check test:	bsdcpio_test
58	${.OBJDIR}/bsdcpio_test -p ${.OBJDIR}/../bsdcpio -r ${.CURDIR}
59
60${.OBJDIR}/list.h list.h: ${TESTS} Makefile
61	(cd ${.CURDIR}; cat ${TESTS}) | grep DEFINE_TEST > list.h
62
63clean:
64	rm -f ${CLEANFILES}
65	rm -f *~
66	-chmod -R +w /tmp/bsdcpio_test.*
67	rm -rf /tmp/bsdcpio_test.*
68
69.include <bsd.prog.mk>
70