xref: /freebsd/usr.bin/cpio/Makefile (revision cdf63a700c77204252e3c2e38d7106965559f3c6)
11e38350bSTim Kientzle# $FreeBSD$
21e38350bSTim Kientzle
3c6063d0dSWarner Losh.include <src.opts.mk>
4482ff785SDoug Barton
53c89d6b0SBryan Drewery_LIBARCHIVEDIR=	${.CURDIR}/../../contrib/libarchive
63c89d6b0SBryan Drewery_LIBARCHIVECONFDIR=	${.CURDIR}/../../lib/libarchive
745d3b226SMartin Matuska
81e38350bSTim KientzlePROG=	bsdcpio
9*cdf63a70SMartin MatuskaBSDCPIO_VERSION_STRING=	3.2.0
10f305d4beSMartin Matuska
113c89d6b0SBryan Drewery.PATH:	${_LIBARCHIVEDIR}/cpio
12f305d4beSMartin MatuskaSRCS=	cpio.c cmdline.c
13f305d4beSMartin Matuska
143c89d6b0SBryan Drewery.PATH:	${_LIBARCHIVEDIR}/libarchive_fe
15*cdf63a70SMartin MatuskaSRCS+=	err.c line_reader.c passphrase.c
16f305d4beSMartin Matuska
171e38350bSTim KientzleCFLAGS+= -DBSDCPIO_VERSION_STRING=\"${BSDCPIO_VERSION_STRING}\"
183c89d6b0SBryan DreweryCFLAGS+= -DPLATFORM_CONFIG_H=\"${_LIBARCHIVECONFDIR}/config_freebsd.h\"
193c89d6b0SBryan DreweryCFLAGS+= -I${_LIBARCHIVEDIR}/cpio -I${_LIBARCHIVEDIR}/libarchive_fe
20f305d4beSMartin Matuska
214f6b1554STim Kientzle.ifdef RELEASE_CRUNCH
224f6b1554STim Kientzle# FreeBSD's installer uses cpio in crunched binaries that are
234f6b1554STim Kientzle# statically linked, cannot use -lcrypto, and are size sensitive.
244f6b1554STim KientzleCFLAGS+= -DSMALLER
254f6b1554STim Kientzle.endif
263e11bd9eSBaptiste DaroussinLIBADD=	archive
274d6b2b93STim Kientzle
286c95142eSMartin Matuska.if ${MK_ICONV} != "no"
296c95142eSMartin MatuskaCFLAGS+=	-DHAVE_ICONV=1 -DHAVE_ICONV_H=1 -DICONV_CONST=const
306c95142eSMartin Matuska.endif
316c95142eSMartin Matuska
321e38350bSTim KientzleSYMLINKS=bsdcpio ${BINDIR}/cpio
331e38350bSTim KientzleMLINKS= bsdcpio.1 cpio.1
341e38350bSTim Kientzle
3559e2ff55SEnji Cooper.if ${MK_TESTS} != "no"
3659e2ff55SEnji CooperSUBDIR+=	tests
3759e2ff55SEnji Cooper.endif
381e38350bSTim Kientzle
391e38350bSTim Kientzle.include <bsd.prog.mk>
40