Makefile revision 298107
11556Srgrimes#	@(#)Makefile	8.1 (Berkeley) 5/31/93
250471Speter# $FreeBSD: head/bin/dd/Makefile 298107 2016-04-16 07:45:30Z gjb $
31556Srgrimes
4289487Sngie.include <src.opts.mk>
5289487Sngie
6298107SgjbPACKAGE=runtime
71556SrgrimesPROG=	dd
81556SrgrimesSRCS=	args.c conv.c conv_tab.c dd.c misc.c position.c
91556Srgrimes
10126666Sphk#
11126666Sphk# Test the character conversion functions.  We have to be explicit about
12126666Sphk# which LC_LANG we use because the definition of upper and lower case
13126666Sphk# depends on it.
14128048Snjl#
15128048Snjl
16128048SnjlCLEANFILES=	gen
17128048Snjl
18128048Snjltest: ${PROG} gen
19126666Sphk.for conv in ascii ebcdic ibm oldascii oldebcdic oldibm \
20126667Sphk    pareven parnone parodd parset \
21126666Sphk    swab lcase ucase
22128048Snjl	@${ECHO} testing conv=${conv}
23128048Snjl	@./gen | \
24128048Snjl	    LC_ALL=en_US.US-ASCII ./dd conv=${conv} 2>/dev/null | \
25128048Snjl	    LC_ALL=en_US.US-ASCII hexdump -C | \
26128048Snjl	    diff -I FreeBSD - ${.CURDIR}/ref.${conv}
27126666Sphk.endfor
28295749Sthomas	@${ECHO} "testing sparse file (obs zeroes)"
29295749Sthomas	@./gen 189284 | ./dd ibs=16 obs=8 conv=sparse of=obs_zeroes 2> /dev/null
30295749Sthomas	@hexdump -C obs_zeroes | diff -I FreeBSD - ${.CURDIR}/ref.obs_zeroes
31128048Snjl
32295749Sthomas	@${ECHO} "testing spase file (all zeroes)"
33295749Sthomas	@./dd if=/dev/zero of=1M_zeroes bs=1048576 count=1 2> /dev/null
34295749Sthomas	@./dd if=1M_zeroes of=1M_zeroes.1 bs=1048576 conv=sparse 2> /dev/null
35295749Sthomas	@./dd if=1M_zeroes of=1M_zeroes.2 bs=1048576 2> /dev/null
36295749Sthomas	@diff 1M_zeroes 1M_zeroes.1
37295749Sthomas	@diff 1M_zeroes 1M_zeroes.2
38295749Sthomas
39295749Sthomas	@rm -f gen 1M_zeroes* obs_zeroes
40295749Sthomas
41289487Sngie.if ${MK_TESTS} != "no"
42289487SngieSUBDIR+=	tests
43289487Sngie.endif
44289487Sngie
45128048Snjl.include <bsd.prog.mk>
46