]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - usr.bin/tar/test/Makefile
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.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_T_upper.c                   \
19         test_option_q.c                         \
20         test_option_r.c                         \
21         test_option_s.c                         \
22         test_patterns.c                         \
23         test_stdio.c                            \
24         test_strip_components.c                 \
25         test_symlink_dir.c                      \
26         test_version.c
27
28 # Build the test program
29 SRCS=   ${TAR_SRCS}                             \
30         ${TESTS}                                \
31         list.h                                  \
32         main.c
33
34 CLEANFILES+= list.h
35
36 NO_MAN=yes
37
38 PROG=bsdtar_test
39 DPADD=${LIBARCHIVE} ${LIBBZ2} ${LIBZ} ${LIBLZMA}
40 CFLAGS+=        -DPLATFORM_CONFIG_H=\"${.CURDIR}/../config_freebsd.h\"
41 LDADD= -larchive -lz -lbz2 -llzma
42 CFLAGS+= -static -g -O2 -Wall
43 CFLAGS+= -I${.CURDIR}/.. -I${.OBJDIR}
44 CFLAGS+= -I${LIBARCHIVEDIR}/tar
45
46 # Uncomment to link against dmalloc
47 #LDADD+= -L/usr/local/lib -ldmalloc
48 #CFLAGS+= -I/usr/local/include -DUSE_DMALLOC
49
50 check test:     bsdtar_test
51         ./bsdtar_test -p ${.OBJDIR}/../bsdtar -r ${LIBARCHIVEDIR}/tar/test
52
53 list.h: ${TESTS} Makefile
54         (cd ${LIBARCHIVEDIR}/tar/test; cat ${TESTS}) | \
55         grep DEFINE_TEST > ${.OBJDIR}/list.h
56
57 clean:
58         rm -f ${CLEANFILES}
59         rm -f *.out
60         rm -f *.o
61         rm -f *.core
62         rm -f *~
63         rm -f list.h
64         rm -f archive.h ../archive.h
65         -chmod -R +w /tmp/bsdtar_test.*
66         rm -rf /tmp/bsdtar_test.*
67
68 .include <bsd.prog.mk>