xref: /freebsd/bin/dd/Makefile (revision 0fac350c54d0a72f5341e15021efcde63eb58a4b)
1
2.include <src.opts.mk>
3
4PACKAGE=runtime
5PROG=	dd
6SRCS=	args.c conv.c conv_tab.c dd.c misc.c position.c
7LIBADD= util
8
9#
10# Test the character conversion functions.  We have to be explicit about
11# which LC_LANG we use because the definition of upper and lower case
12# depends on it.
13#
14
15CLEANFILES=	gen
16
17test: ${PROG} gen
18.for conv in ascii ebcdic ibm oldascii oldebcdic oldibm \
19    pareven parnone parodd parset \
20    swab lcase ucase
21	@${ECHO} testing conv=${conv}
22	@./gen | \
23	    LC_ALL=en_US.US-ASCII ./dd conv=${conv} 2>/dev/null | \
24	    LC_ALL=en_US.US-ASCII hexdump -C | \
25	    diff -I FreeBSD - ${.CURDIR}/ref.${conv}
26.endfor
27	@${ECHO} "testing sparse file (obs zeroes)"
28	@./gen 189284 | ./dd ibs=16 obs=8 conv=sparse of=obs_zeroes 2> /dev/null
29	@hexdump -C obs_zeroes | diff -I FreeBSD - ${.CURDIR}/ref.obs_zeroes
30
31	@${ECHO} "testing spase file (all zeroes)"
32	@./dd if=/dev/zero of=1M_zeroes bs=1048576 count=1 2> /dev/null
33	@./dd if=1M_zeroes of=1M_zeroes.1 bs=1048576 conv=sparse 2> /dev/null
34	@./dd if=1M_zeroes of=1M_zeroes.2 bs=1048576 2> /dev/null
35	@diff 1M_zeroes 1M_zeroes.1
36	@diff 1M_zeroes 1M_zeroes.2
37
38	@rm -f gen 1M_zeroes* obs_zeroes
39
40HAS_TESTS=
41SUBDIR.${MK_TESTS}+= tests
42
43.include <bsd.prog.mk>
44