1# $FreeBSD$ 2 3LIBARCHIVEDIR= ${.CURDIR}/../../../contrib/libarchive 4 5.PATH: ${LIBARCHIVEDIR}/tar/test 6TESTS= \ 7 test_0.c \ 8 test_basic.c \ 9 test_copy.c \ 10 test_empty_mtree.c \ 11 test_extract_tar_bz2.c \ 12 test_extract_tar_grz.c \ 13 test_extract_tar_gz.c \ 14 test_extract_tar_lrz.c \ 15 test_extract_tar_lz.c \ 16 test_extract_tar_lzma.c \ 17 test_extract_tar_lzo.c \ 18 test_extract_tar_xz.c \ 19 test_format_newc.c \ 20 test_help.c \ 21 test_option_C_upper.c \ 22 test_option_H_upper.c \ 23 test_option_L_upper.c \ 24 test_option_O_upper.c \ 25 test_option_T_upper.c \ 26 test_option_U_upper.c \ 27 test_option_X_upper.c \ 28 test_option_a.c \ 29 test_option_b.c \ 30 test_option_b64encode.c \ 31 test_option_exclude.c \ 32 test_option_gid_gname.c \ 33 test_option_grzip.c \ 34 test_option_j.c \ 35 test_option_k.c \ 36 test_option_keep_newer_files.c \ 37 test_option_lrzip.c \ 38 test_option_lzma.c \ 39 test_option_lzop.c \ 40 test_option_n.c \ 41 test_option_newer_than.c \ 42 test_option_nodump.c \ 43 test_option_older_than.c \ 44 test_option_q.c \ 45 test_option_r.c \ 46 test_option_s.c \ 47 test_option_uid_uname.c \ 48 test_option_uuencode.c \ 49 test_option_xz.c \ 50 test_option_z.c \ 51 test_patterns.c \ 52 test_print_longpath.c \ 53 test_stdio.c \ 54 test_strip_components.c \ 55 test_symlink_dir.c \ 56 test_version.c 57 58# Build the test program 59SRCS= ${TAR_SRCS} \ 60 ${TESTS} \ 61 list.h \ 62 main.c 63 64.PATH: ${LIBARCHIVEDIR}/test_utils 65SRCS+= test_utils.c 66 67CLEANFILES+= list.h 68 69MAN= 70 71PROG=bsdtar_test 72DPADD=${LIBARCHIVE} ${LIBBZ2} ${LIBZ} ${LIBLZMA} 73CFLAGS+= -DPLATFORM_CONFIG_H=\"${.CURDIR}/../../../lib/libarchive/config_freebsd.h\" 74LDADD= -larchive -lz -lbz2 -llzma 75CFLAGS+= -static -g -O2 -Wall 76CFLAGS+= -I${.CURDIR}/../../../lib/libarchive -I${.OBJDIR} 77CFLAGS+= -I${LIBARCHIVEDIR}/tar -I${LIBARCHIVEDIR}/test_utils 78 79# Uncomment to link against dmalloc 80#LDADD+= -L/usr/local/lib -ldmalloc 81#CFLAGS+= -I/usr/local/include -DUSE_DMALLOC 82 83check test: bsdtar_test 84 ./bsdtar_test -p ${.OBJDIR}/../bsdtar -r ${LIBARCHIVEDIR}/tar/test 85 86list.h: ${TESTS} Makefile 87 (cd ${LIBARCHIVEDIR}/tar/test; cat ${TESTS}) | \ 88 grep DEFINE_TEST > ${.OBJDIR}/list.h 89 90clean: 91 rm -f ${CLEANFILES} 92 rm -f *.out 93 rm -f *.o 94 rm -f *.core 95 rm -f *~ 96 rm -f list.h 97 rm -f archive.h ../archive.h 98 -chmod -R +w /tmp/bsdtar_test.* 99 rm -rf /tmp/bsdtar_test.* 100 101.include <bsd.prog.mk> 102