2008-05-26 17:15:35 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
2008-06-16 07:24:05 +00:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
2011-12-22 08:42:07 +00:00
|
|
|
LIBARCHIVEDIR= ${.CURDIR}/../../contrib/libarchive
|
2012-02-25 10:58:02 +00:00
|
|
|
LIBARCHIVECONFDIR= ${.CURDIR}/../../lib/libarchive
|
2011-12-22 08:42:07 +00:00
|
|
|
|
2008-05-26 17:15:35 +00:00
|
|
|
PROG= bsdcpio
|
2012-07-28 06:38:44 +00:00
|
|
|
BSDCPIO_VERSION_STRING= 3.0.4
|
2011-07-17 21:42:22 +00:00
|
|
|
|
2011-12-22 08:42:07 +00:00
|
|
|
.PATH: ${LIBARCHIVEDIR}/cpio
|
2011-07-17 21:42:22 +00:00
|
|
|
SRCS= cpio.c cmdline.c
|
|
|
|
|
2011-12-22 08:42:07 +00:00
|
|
|
.PATH: ${LIBARCHIVEDIR}/libarchive_fe
|
2012-07-28 06:38:44 +00:00
|
|
|
SRCS+= err.c line_reader.c
|
2011-07-17 21:42:22 +00:00
|
|
|
|
2008-05-26 17:15:35 +00:00
|
|
|
CFLAGS+= -DBSDCPIO_VERSION_STRING=\"${BSDCPIO_VERSION_STRING}\"
|
2012-02-25 10:58:02 +00:00
|
|
|
CFLAGS+= -DPLATFORM_CONFIG_H=\"${LIBARCHIVECONFDIR}/config_freebsd.h\"
|
2011-12-22 08:42:07 +00:00
|
|
|
CFLAGS+= -I${LIBARCHIVEDIR}/cpio -I${LIBARCHIVEDIR}/libarchive_fe
|
2011-07-17 21:42:22 +00:00
|
|
|
|
2009-04-19 06:59:12 +00:00
|
|
|
.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
|
2011-08-01 08:22:40 +00:00
|
|
|
DPADD= ${LIBARCHIVE} ${LIBZ} ${LIBBZ2} ${LIBLZMA} ${LIBBSDXML}
|
|
|
|
LDADD= -larchive -lz -lbz2 -llzma -lbsdxml
|
2009-04-18 06:03:09 +00:00
|
|
|
.if ${MK_OPENSSL} != "no"
|
2010-02-25 20:24:19 +00:00
|
|
|
DPADD+= ${LIBCRYPTO}
|
2009-04-18 06:03:09 +00:00
|
|
|
LDADD+= -lcrypto
|
2011-08-01 08:22:40 +00:00
|
|
|
.else
|
|
|
|
DPADD+= ${LIBMD}
|
|
|
|
LDADD+= -lmd
|
2009-04-18 06:03:09 +00:00
|
|
|
.endif
|
2008-05-26 17:17:43 +00:00
|
|
|
|
2012-02-25 10:58:02 +00:00
|
|
|
.if ${MK_ICONV} != "no"
|
|
|
|
CFLAGS+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1 -DICONV_CONST=const
|
|
|
|
.endif
|
|
|
|
|
2008-05-26 17:15:35 +00:00
|
|
|
SYMLINKS=bsdcpio ${BINDIR}/cpio
|
|
|
|
MLINKS= bsdcpio.1 cpio.1
|
|
|
|
|
2011-12-22 08:42:07 +00:00
|
|
|
.PHONY: check test clean-test
|
2008-05-26 17:15:35 +00:00
|
|
|
|
|
|
|
check test: $(PROG) bsdcpio.1.gz
|
2011-12-22 08:42:07 +00:00
|
|
|
cd ${.CURDIR}/test && make obj && make test
|
|
|
|
|
|
|
|
clean-test:
|
|
|
|
cd ${.CURDIR}/test && make clean
|
2008-05-26 17:15:35 +00:00
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|