Makefile revision 145199
1# $FreeBSD: head/usr.bin/tar/Makefile 145199 2005-04-17 17:20:54Z 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.023
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}
17SYMLINKS=	bsdtar ${BINDIR}/tar
18MLINKS=	bsdtar.1 tar.1
19
20DIST_BUILD_DIR=	${.OBJDIR}/${PROG}-${VERSION}
21CLEANDIRS+=	${DIST_BUILD_DIR}
22DISTFILE=	${PROG}-${VERSION}.tar.gz
23# Files that just get copied to the distfile build directory
24DIST_FILES=	${DIST_SRCS}
25DIST_FILES+=	${MAN}
26DIST_FILES+=	bsdtar.h bsdtar_platform.h
27DIST_FILES+=	Makefile.am
28DIST_FILES+=	fts.c fts.h
29
30distfile:
31	rm -rf ${DIST_BUILD_DIR}
32	mkdir ${DIST_BUILD_DIR}
33	for f in ${DIST_FILES};					\
34	do							\
35		cat ${.CURDIR}/$$f >${DIST_BUILD_DIR}/$$f;	\
36	done
37	cat ${.CURDIR}/configure.ac.in |			\
38		sed 's/@VERSION@/${VERSION}/' |			\
39		cat > ${DIST_BUILD_DIR}/configure.ac
40	(cd ${DIST_BUILD_DIR} && aclocal && autoheader && autoconf )
41	(cd ${DIST_BUILD_DIR} && automake -a --foreign)
42	(cd ${DIST_BUILD_DIR} && ./configure && make distcheck && make dist)
43	mv ${DIST_BUILD_DIR}/${DISTFILE} ${.OBJDIR}
44	@echo ==================================================
45	@echo Created ${.OBJDIR}/${DISTFILE}
46	@echo ==================================================
47
48.include <bsd.prog.mk>
49