Makefile revision 179323
1# $FreeBSD: head/usr.bin/cpio/test/Makefile 179323 2008-05-26 17:15:35Z kientzle $
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_pathmatch.c			\
31
32# Build the test program
33SRCS= list.h					\
34	${CPIO_SRCS}				\
35	${TESTS}				\
36	main.c
37
38CLEANFILES+= list.h
39
40NO_MAN=yes
41
42PROG=bsdcpio_test
43DPADD=${LIBARCHIVE} ${LIBBZ2} ${LIBZ}
44CFLAGS+=	-DPLATFORM_CONFIG_H=\"config_freebsd.h\"
45CFLAGS+=	-I..
46LDADD= -larchive -lz -lbz2
47CFLAGS+= -static -g -O2 -Wall
48CFLAGS+= -I${.OBJDIR}
49CFLAGS+= -I${CPIO_SRCDIR}
50
51# Uncomment to link against dmalloc
52#LDADD+= -L/usr/local/lib -ldmalloc
53#CFLAGS+= -I/usr/local/include -DUSE_DMALLOC
54WARNS=6
55
56check test:	bsdcpio_test
57	${.OBJDIR}/bsdcpio_test -p ${.OBJDIR}/../bsdcpio -r ${.CURDIR}
58
59${.OBJDIR}/list.h list.h: ${TESTS} Makefile
60	(cd ${.CURDIR}; cat ${TESTS}) | grep DEFINE_TEST > list.h
61
62clean:
63	rm -f *.out
64	rm -f *.o
65	rm -f *.core
66	rm -f *~
67	rm -f list.h
68	rm -f archive.h ../archive.h
69	-chmod -R +w /tmp/bsdcpio_test.*
70	rm -rf /tmp/bsdcpio_test.*
71
72.include <bsd.prog.mk>
73