4 # Use "make distfile" to build a tar.gz file suitable for distribution,
5 # including an autoconf/automake-generated build system.
10 SRCS= bsdtar.c matching.c read.c util.c write.c
12 DPADD= ${LIBARCHIVE} ${LIBBZ2} ${LIBZ}
13 LDADD= -larchive -lbz2 -lz
14 CFLAGS+= -DPACKAGE_VERSION=\"${VERSION}\"
16 .if !defined(WITH_GTAR)
17 SYMLINKS= bsdtar ${BINDIR}/tar
18 MLINKS= bsdtar.1 tar.1
21 DIST_BUILD_DIR= ${.OBJDIR}/${PROG}-${VERSION}
22 CLEANDIRS+= ${DIST_BUILD_DIR}
23 DISTFILE= ${PROG}-${VERSION}.tar.gz
24 # Files that just get copied to the distfile build directory
27 DIST_FILES+= bsdtar.h bsdtar_platform.h
28 DIST_FILES+= Makefile.am
29 DIST_FILES+= fts.c fts.h
32 rm -rf ${DIST_BUILD_DIR}
33 mkdir ${DIST_BUILD_DIR}
34 for f in ${DIST_FILES}; \
36 cat ${.CURDIR}/$$f >${DIST_BUILD_DIR}/$$f; \
38 cat ${.CURDIR}/configure.ac.in | \
39 sed 's/@VERSION@/${VERSION}/' | \
40 cat > ${DIST_BUILD_DIR}/configure.ac
41 (cd ${DIST_BUILD_DIR} && aclocal && autoheader && autoconf )
42 (cd ${DIST_BUILD_DIR} && automake -a --foreign)
43 (cd ${DIST_BUILD_DIR} && ./configure && make distcheck && make dist)
44 mv ${DIST_BUILD_DIR}/${DISTFILE} ${.OBJDIR}
45 @echo ==================================================
46 @echo Created ${.OBJDIR}/${DISTFILE}
47 @echo ==================================================
49 .include <bsd.prog.mk>