Makefile revision 133331
1# $FreeBSD: head/usr.bin/tar/Makefile 133331 2004-08-08 17:20:23Z kientzle $
2
3#
4# Use "make distfile" to build a tar.gz file suitable for distribution,
5# including an autoconf/automake-generated build system.
6#
7
8PROG=	bsdtar
9VERSION=	1.01.011
10SRCS=	bsdtar.c matching.c read.c util.c write.c
11WARNS?=	6
12DPADD=	${LIBARCHIVE} ${LIBBZ2} ${LIBZ}
13LDADD=	-larchive -lbz2 -lz
14CFLAGS+=	-DPACKAGE_VERSION=\"${VERSION}\"
15
16.if !defined(WITH_GTAR)
17SYMLINKS=	${BINDIR}/bsdtar ${BINDIR}/tar
18MLINKS=	bsdtar.1 tar.1
19.endif
20
21DIST_BUILD_DIR=	${.OBJDIR}/${PROG}-${VERSION}
22CLEANDIRS+=	${DIST_BUILD_DIR}
23DISTFILE=	${PROG}-${VERSION}.tar.gz
24# Files that just get copied to the distfile build directory
25DIST_FILES=	${SRCS}
26DIST_FILES+=	${MAN}
27DIST_FILES+=	bsdtar.h bsdtar_platform.h
28DIST_FILES+=	Makefile.am
29DIST_FILES+=	fts.c fts.h
30
31distfile:
32	rm -rf ${DIST_BUILD_DIR}
33	mkdir ${DIST_BUILD_DIR}
34	for f in ${DIST_FILES};					\
35	do							\
36		cat ${.CURDIR}/$$f >${DIST_BUILD_DIR}/$$f;	\
37	done
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 ==================================================
48
49.include <bsd.prog.mk>
50