1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-28 11:57:28 +00:00
freebsd/usr.bin/cpio/Makefile
Tim Kientzle 4f6b15547b When compiled for the release crunches, be a bit
more selective about what libarchive features we pull in:
 * No compression support
 * Only cpio and ustar writing
 * Only cpio and tar/pax readers
This reduces a statically linked, stripped binary from 900k to 680k
and completely eliminates the dependency on libcrypto.
2009-04-19 06:59:12 +00:00

33 lines
763 B
Makefile

# $FreeBSD$
.include <bsd.own.mk>
PROG= bsdcpio
BSDCPIO_VERSION_STRING=2.7.0
SRCS= cpio.c cmdline.c err.c matching.c pathmatch.c
WARNS?= 6
DPADD= ${LIBARCHIVE} ${LIBZ} ${LIBBZ2}
CFLAGS+= -DBSDCPIO_VERSION_STRING=\"${BSDCPIO_VERSION_STRING}\"
CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\"
.ifdef RELEASE_CRUNCH
# FreeBSD's installer uses cpio in crunched binaries that are
# statically linked, cannot use -lcrypto, and are size sensitive.
CFLAGS+= -DSMALLER
.endif
LDADD+= -larchive -lz -lbz2 -lmd
.if ${MK_OPENSSL} != "no"
LDADD+= -lcrypto
.endif
.if ${MK_GNU_CPIO} != "yes"
SYMLINKS=bsdcpio ${BINDIR}/cpio
MLINKS= bsdcpio.1 cpio.1
.endif
.PHONY: check test
check test: $(PROG) bsdcpio.1.gz
cd ${.CURDIR}/test && make clean test
.include <bsd.prog.mk>