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