]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/tar/test/Makefile
Dtrace: improve handling of library paths.
[FreeBSD/FreeBSD.git] / usr.bin / tar / test / Makefile
1 # $FreeBSD$
2
3 LIBARCHIVEDIR=  ${.CURDIR}/../../../contrib/libarchive
4
5 .PATH: ${LIBARCHIVEDIR}/tar
6 # Some tar sources are pulled in for white-box tests
7 TAR_SRCS=                                               \
8         getdate.c
9
10 .PATH: ${LIBARCHIVEDIR}/tar/test
11 TESTS=  \
12         test_0.c                                \
13         test_basic.c                            \
14         test_copy.c                             \
15         test_empty_mtree.c                      \
16         test_getdate.c                          \
17         test_help.c                             \
18         test_option_C_upper.c                   \
19         test_option_H_upper.c                   \
20         test_option_L_upper.c                   \
21         test_option_O_upper.c                   \
22         test_option_T_upper.c                   \
23         test_option_U_upper.c                   \
24         test_option_X_upper.c                   \
25         test_option_b.c                         \
26         test_option_exclude.c                   \
27         test_option_gid_gname.c                 \
28         test_option_k.c                         \
29         test_option_keep_newer_files.c          \
30         test_option_n.c                         \
31         test_option_newer_than.c                \
32         test_option_q.c                         \
33         test_option_r.c                         \
34         test_option_s.c                         \
35         test_option_uid_uname.c                 \
36         test_patterns.c                         \
37         test_print_longpath.c                   \
38         test_stdio.c                            \
39         test_strip_components.c                 \
40         test_symlink_dir.c                      \
41         test_version.c
42
43 # Build the test program
44 SRCS=   ${TAR_SRCS}                             \
45         ${TESTS}                                \
46         list.h                                  \
47         main.c
48
49 CLEANFILES+= list.h
50
51 NO_MAN=yes
52
53 PROG=bsdtar_test
54 DPADD=${LIBARCHIVE} ${LIBBZ2} ${LIBZ} ${LIBLZMA}
55 CFLAGS+=        -DPLATFORM_CONFIG_H=\"${.CURDIR}/../../../lib/libarchive/config_freebsd.h\"
56 LDADD= -larchive -lz -lbz2 -llzma
57 CFLAGS+= -static -g -O2 -Wall
58 CFLAGS+= -I${.CURDIR}/../../../lib/libarchive -I${.OBJDIR}
59 CFLAGS+= -I${LIBARCHIVEDIR}/tar
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:     bsdtar_test
66         ./bsdtar_test -p ${.OBJDIR}/../bsdtar -r ${LIBARCHIVEDIR}/tar/test
67
68 list.h: ${TESTS} Makefile
69         (cd ${LIBARCHIVEDIR}/tar/test; cat ${TESTS}) | \
70         grep DEFINE_TEST > ${.OBJDIR}/list.h
71
72 clean:
73         rm -f ${CLEANFILES}
74         rm -f *.out
75         rm -f *.o
76         rm -f *.core
77         rm -f *~
78         rm -f list.h
79         rm -f archive.h ../archive.h
80         -chmod -R +w /tmp/bsdtar_test.*
81         rm -rf /tmp/bsdtar_test.*
82
83 .include <bsd.prog.mk>