Makefile revision 143543
1# $FreeBSD: head/usr.bin/tar/Makefile 143543 2005-03-13 23:49:53Z 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.022
10DIST_SRCS=	bsdtar.c getdate.y matching.c read.c util.c write.c
11SRCS=	${DIST_SRCS}
12WARNS?=	5
13DPADD=	${LIBARCHIVE} ${LIBBZ2} ${LIBZ}
14LDADD=	-larchive -lbz2 -lz
15CFLAGS+=	-DPACKAGE_VERSION=\"${VERSION}\"
16CFLAGS+=	-I${.CURDIR}
17
18.if !defined(WITH_GTAR)
19SYMLINKS=	bsdtar ${BINDIR}/tar
20MLINKS=	bsdtar.1 tar.1
21.endif
22
23DIST_BUILD_DIR=	${.OBJDIR}/${PROG}-${VERSION}
24CLEANDIRS+=	${DIST_BUILD_DIR}
25DISTFILE=	${PROG}-${VERSION}.tar.gz
26# Files that just get copied to the distfile build directory
27DIST_FILES=	${DIST_SRCS}
28DIST_FILES+=	${MAN}
29DIST_FILES+=	bsdtar.h bsdtar_platform.h
30DIST_FILES+=	Makefile.am
31DIST_FILES+=	fts.c fts.h
32
33distfile:
34	rm -rf ${DIST_BUILD_DIR}
35	mkdir ${DIST_BUILD_DIR}
36	for f in ${DIST_FILES};					\
37	do							\
38		cat ${.CURDIR}/$$f >${DIST_BUILD_DIR}/$$f;	\
39	done
40	cat ${.CURDIR}/configure.ac.in |			\
41		sed 's/@VERSION@/${VERSION}/' |			\
42		cat > ${DIST_BUILD_DIR}/configure.ac
43	(cd ${DIST_BUILD_DIR} && aclocal && autoheader && autoconf )
44	(cd ${DIST_BUILD_DIR} && automake -a --foreign)
45	(cd ${DIST_BUILD_DIR} && ./configure && make distcheck && make dist)
46	mv ${DIST_BUILD_DIR}/${DISTFILE} ${.OBJDIR}
47	@echo ==================================================
48	@echo Created ${.OBJDIR}/${DISTFILE}
49	@echo ==================================================
50
51.include <bsd.prog.mk>
52