1# $FreeBSD$ 2 3.include <bsd.own.mk> 4 5LIBARCHIVEDIR= ${.CURDIR}/../../contrib/libarchive 6LIBARCHIVECONFDIR= ${.CURDIR}/../../lib/libarchive 7 8PROG= bsdcpio 9BSDCPIO_VERSION_STRING= 3.1.2 10 11.PATH: ${LIBARCHIVEDIR}/cpio 12SRCS= cpio.c cmdline.c 13 14.PATH: ${LIBARCHIVEDIR}/libarchive_fe 15SRCS+= err.c line_reader.c 16 17CFLAGS+= -DBSDCPIO_VERSION_STRING=\"${BSDCPIO_VERSION_STRING}\" 18CFLAGS+= -DPLATFORM_CONFIG_H=\"${LIBARCHIVECONFDIR}/config_freebsd.h\" 19CFLAGS+= -I${LIBARCHIVEDIR}/cpio -I${LIBARCHIVEDIR}/libarchive_fe 20 21.ifdef RELEASE_CRUNCH 22# FreeBSD's installer uses cpio in crunched binaries that are 23# statically linked, cannot use -lcrypto, and are size sensitive. 24CFLAGS+= -DSMALLER 25.endif 26DPADD= ${LIBARCHIVE} ${LIBZ} ${LIBBZ2} ${LIBLZMA} ${LIBBSDXML} 27LDADD= -larchive -lz -lbz2 -llzma -lbsdxml 28.if ${MK_OPENSSL} != "no" 29DPADD+= ${LIBCRYPTO} 30LDADD+= -lcrypto 31.else 32DPADD+= ${LIBMD} 33LDADD+= -lmd 34.endif 35 36.if ${MK_ICONV} != "no" 37CFLAGS+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1 -DICONV_CONST=const 38.endif 39 40SYMLINKS=bsdcpio ${BINDIR}/cpio 41MLINKS= bsdcpio.1 cpio.1 42 43.PHONY: check test clean-test 44 45check test: $(PROG) bsdcpio.1.gz 46 cd ${.CURDIR}/test && make obj && make test 47 48clean-test: 49 cd ${.CURDIR}/test && make clean 50 51.include <bsd.prog.mk> 52