1179323Skientzle# $FreeBSD: stable/11/usr.bin/cpio/Makefile 368984 2021-01-11 01:20:36Z mm $
2179323Skientzle
3265420Simp.include <src.opts.mk>
4179816Sdougb
5319186Sngie_LIBARCHIVEDIR=	${SRCTOP}/contrib/libarchive
6319186Sngie_LIBARCHIVECONFDIR=	${SRCTOP}/lib/libarchive
7228797Smm
8179323SkientzlePROG=	bsdcpio
9368984SmmBSDCPIO_VERSION_STRING!=	sed -n '/define.*ARCHIVE_VERSION_ONLY_STRING/{s,[^0-9.],,gp;q;}' \
10368984Smm			${_LIBARCHIVEDIR}/libarchive/archive.h
11224154Smm
12291620Sbdrewery.PATH:	${_LIBARCHIVEDIR}/cpio
13224154SmmSRCS=	cpio.c cmdline.c
14224154Smm
15291620Sbdrewery.PATH:	${_LIBARCHIVEDIR}/libarchive_fe
16299529SmmSRCS+=	err.c line_reader.c passphrase.c
17224154Smm
18179323SkientzleCFLAGS+= -DBSDCPIO_VERSION_STRING=\"${BSDCPIO_VERSION_STRING}\"
19291620SbdreweryCFLAGS+= -DPLATFORM_CONFIG_H=\"${_LIBARCHIVECONFDIR}/config_freebsd.h\"
20291620SbdreweryCFLAGS+= -I${_LIBARCHIVEDIR}/cpio -I${_LIBARCHIVEDIR}/libarchive_fe
21224154Smm
22191262Skientzle.ifdef RELEASE_CRUNCH
23191262Skientzle# FreeBSD's installer uses cpio in crunched binaries that are
24191262Skientzle# statically linked, cannot use -lcrypto, and are size sensitive.
25191262SkientzleCFLAGS+= -DSMALLER
26191262Skientzle.endif
27275042SbaptLIBADD=	archive
28179324Skientzle
29232153Smm.if ${MK_ICONV} != "no"
30232153SmmCFLAGS+=	-DHAVE_ICONV=1 -DHAVE_ICONV_H=1 -DICONV_CONST=const
31232153Smm.endif
32232153Smm
33179323SkientzleSYMLINKS=bsdcpio ${BINDIR}/cpio
34179323SkientzleMLINKS= bsdcpio.1 cpio.1
35179323Skientzle
36289195Sngie.if ${MK_TESTS} != "no"
37289195SngieSUBDIR+=	tests
38289195Sngie.endif
39179323Skientzle
40179323Skientzle.include <bsd.prog.mk>
41