]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - usr.bin/cpio/test/Makefile
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / usr.bin / cpio / test / Makefile
1 # $FreeBSD$
2
3 LIBARCHIVEDIR=  ${.CURDIR}/../../../contrib/libarchive
4
5 .PATH:  ${LIBARCHIVEDIR}/cpio
6 CPIO_SRCS= cmdline.c
7
8 .PATH:  ${LIBARCHIVEDIR}/libarchive_fe
9 CPIO_SRCS+= err.c
10
11 .PATH:  ${LIBARCHIVEDIR}/cpio/test
12 TESTS=  \
13         test_0.c                                \
14         test_basic.c                            \
15         test_cmdline.c                          \
16         test_extract_cpio_Z.c                   \
17         test_extract_cpio_bz2.c                 \
18         test_extract_cpio_grz.c                 \
19         test_extract_cpio_gz.c                  \
20         test_extract_cpio_lrz.c                 \
21         test_extract_cpio_lz.c                  \
22         test_extract_cpio_lzma.c                \
23         test_extract_cpio_lzo.c                 \
24         test_extract_cpio_xz.c                  \
25         test_format_newc.c                      \
26         test_gcpio_compat.c                     \
27         test_option_0.c                         \
28         test_option_B_upper.c                   \
29         test_option_C_upper.c                   \
30         test_option_J_upper.c                   \
31         test_option_L_upper.c                   \
32         test_option_Z_upper.c                   \
33         test_option_a.c                         \
34         test_option_b64encode.c                 \
35         test_option_c.c                         \
36         test_option_d.c                         \
37         test_option_f.c                         \
38         test_option_grzip.c                     \
39         test_option_help.c                      \
40         test_option_l.c                         \
41         test_option_lrzip.c                     \
42         test_option_lzma.c                      \
43         test_option_lzop.c                      \
44         test_option_m.c                         \
45         test_option_t.c                         \
46         test_option_u.c                         \
47         test_option_uuencode.c                  \
48         test_option_version.c                   \
49         test_option_xz.c                        \
50         test_option_y.c                         \
51         test_option_z.c                         \
52         test_owner_parse.c                      \
53         test_passthrough_dotdot.c               \
54         test_passthrough_reverse.c
55
56 # Build the test program
57 SRCS= list.h                                    \
58         ${CPIO_SRCS}                            \
59         ${TESTS}                                \
60         main.c
61
62 .PATH:  ${LIBARCHIVEDIR}/test_utils
63 SRCS+=  test_utils.c
64
65 CLEANFILES+= list.h bsdcpio_test
66
67 MAN=
68
69 PROG=bsdcpio_test
70 DPADD=${LIBARCHIVE} ${LIBBZ2} ${LIBZ} ${LIBLZMA}
71 CFLAGS+=        -DPLATFORM_CONFIG_H=\"${.CURDIR}/../../../lib/libarchive/config_freebsd.h\"
72 CFLAGS+=        -I${.CURDIR}/../../../lib/libarchive -I${.OBJDIR}
73 LDADD= -larchive -lz -lbz2 -llzma
74 #CFLAGS+= -static -g -O2 -Wall
75 CFLAGS+= -g -O2 -Wall
76 CFLAGS+= -I${.OBJDIR}
77 CFLAGS+= -I${LIBARCHIVEDIR}/cpio -I${LIBARCHIVEDIR}/libarchive_fe
78 CFLAGS+= -I${LIBARCHIVEDIR}/test_utils
79
80 # Uncomment to link against dmalloc
81 #LDADD+= -L/usr/local/lib -ldmalloc
82 #CFLAGS+= -I/usr/local/include -DUSE_DMALLOC
83
84 check test:     bsdcpio_test
85         ${.OBJDIR}/bsdcpio_test -p ${.OBJDIR}/../bsdcpio \
86         -r ${LIBARCHIVEDIR}/cpio/test
87
88 ${.OBJDIR}/list.h list.h: ${TESTS} Makefile
89         (cd ${LIBARCHIVEDIR}/cpio/test; cat ${TESTS}) | \
90         grep DEFINE_TEST > ${.OBJDIR}/list.h
91
92 clean:
93         rm -f ${CLEANFILES}
94         rm -f *~
95         -chmod -R +w /tmp/bsdcpio_test.*
96         rm -rf /tmp/bsdcpio_test.*
97
98 .include <bsd.prog.mk>