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