]> CyberLeo.Net >> Repos - FreeBSD/releng/9.0.git/blob - usr.bin/tar/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 / tar / test / Makefile
1 # $FreeBSD$
2
3 # Where to find the tar sources (for the internal unit tests)
4 TAR_SRCDIR=${.CURDIR}/..
5 .PATH: ${TAR_SRCDIR}
6
7 # Some tar sources are pulled in for white-box tests
8 TAR_SRCS=                                       \
9         getdate.c
10
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=\"config_freebsd.h\"
41 CFLAGS+=        -I..
42 LDADD= -larchive -lz -lbz2 -llzma
43 CFLAGS+= -static -g -O2 -Wall
44 CFLAGS+= -I${.OBJDIR}
45 CFLAGS+= -I${TAR_SRCDIR}
46
47 # Uncomment to link against dmalloc
48 #LDADD+= -L/usr/local/lib -ldmalloc
49 #CFLAGS+= -I/usr/local/include -DUSE_DMALLOC
50
51 check test:     bsdtar_test
52         ./bsdtar_test -p ${.OBJDIR}/../bsdtar -r ${.CURDIR}
53
54 list.h: ${TESTS} Makefile
55         (cd ${.CURDIR}; cat ${TESTS}) | grep DEFINE_TEST > list.h
56
57 clean:
58         rm -f *.out
59         rm -f *.o
60         rm -f *.core
61         rm -f *~
62         rm -f list.h
63         rm -f archive.h ../archive.h
64         -chmod -R +w /tmp/bsdtar_test.*
65         rm -rf /tmp/bsdtar_test.*
66
67 .include <bsd.prog.mk>