NetBSD/bin/dd/Makefile
manu ea3c6ee530 Add iflag and oflag operands to dd(1)
Like GNU dd(1) similar operands, iflag and oflag allow specifying the
O_* flags given to open(2) for the input and the output file. The values
are comma-sepratated, lower-case, O_ prefix-stripped constants documented
in open(2).

Since iflag and oflag override default values, specifying oflag means
O_CREATE is not set by default and must be specified explicitely.

Some values do not make sense (e.g.: iflag=directory) but are still used
and will raise a warning. For oflag, values rdonly, rdwr and wronly are
filtered out with a warning (dd(1) attempts open(2) with O_RDWR and
then O_WRONLY on failure).

Specifying oflag=trunc along with (seek, oseek or conv=notrunc) is
contradictory and will raise an error.

iflag and oflag are disabled if building with -DMALLPROG
2015-03-18 13:23:49 +00:00

23 lines
435 B
Makefile

# $NetBSD: Makefile,v 1.18 2015/03/18 13:23:49 manu Exp $
# @(#)Makefile 8.1 (Berkeley) 5/31/93
.include <bsd.own.mk>
RUMPPRG=dd
SRCS= args.c conv.c dd.c misc.c position.c
DPADD+= ${LIBUTIL}
LDADD+= -lutil
.ifdef SMALLPROG
CPPFLAGS+= -DNO_CONV -DNO_MSGFMT -DNO_IOFLAG -DSMALL
.else
CPPFLAGS+= -D_NETBSD_SOURCE -D_INCOMPLETE_XOPEN_C063
SRCS+= conv_tab.c
.ifdef CRUNCHEDPROG
CPPFLAGS+= -DSMALL
.endif
.endif
.include <bsd.prog.mk>