NetBSD/sbin/disklabel/Makefile
lukem 1fa0b4f2cc * Enable SAVEBOOTAREA on i386 and amd64 (by merging the Makefile
controls with the section for the other MBR-using platforms that
  already enable this)
* Don't prompt the user to "erase the previous contents of the disk"
  when there's no NetBSD MBR partition; SAVEBOOTAREA is sufficient.

These fixes mean that you can create a disklabel (on an i386/amd64) on a disk
that doesn't have a NetBSD MBR partition without trashing the existing MBR.
The previous behaviour was extremely annoying when working with media such
as FAT-formatted CF cards, and didn't really protect people with such from
accidentally trashing part of sector 1 of such disks, and made it extremely
easy to trash sectors 0..15 of those disks instead.
2004-01-18 22:34:22 +00:00

57 lines
1.5 KiB
Makefile

# $NetBSD: Makefile,v 1.50 2004/01/18 22:34:22 lukem Exp $
# @(#)Makefile 8.2 (Berkeley) 3/17/94
PROG= disklabel
SRCS= disklabel.c dkcksum.c interact.c printlabel.c
MAN= disklabel.5 disklabel.8
LDADD+= -lutil
DPADD+= ${LIBUTIL}
.if (${MACHINE} == "hp300") || (${MACHINE} == "vax") \
|| (${MACHINE} == "arm32")
CPPFLAGS+= -DNUMBOOT=1
.endif
# these have additional requirements on the alignment of a partition
.if (${MACHINE} == "sparc") || (${MACHINE} == "sparc64") \
|| (${MACHINE} == "sun3")
CPPFLAGS+= -DSTRICT_CYLINDER_ALIGNMENT
.endif
.if (${MACHINE} == "alpha") || (${MACHINE} == "x68k")
# preserve the non-disklabel portions of the first 8KB of the disk
CPPFLAGS+= -DSAVEBOOTAREA
.endif
.if ( 0 \
|| ${MACHINE} == "acorn26" \
|| ${MACHINE} == "acorn32" \
|| ${MACHINE} == "amd64" \
|| ${MACHINE} == "arc" \
|| ${MACHINE} == "cats" \
|| ${MACHINE} == "cobalt" \
|| ${MACHINE} == "evbarm" \
|| ${MACHINE} == "hpcarm" \
|| ${MACHINE} == "hpcmips" \
|| ${MACHINE} == "i386" \
|| ${MACHINE} == "macppc" \
|| ${MACHINE} == "netwinder" \
|| ${MACHINE} == "playstation2" \
|| ${MACHINE} == "prep" \
|| ${MACHINE} == "shark" \
)
# use MBR partition info
CPPFLAGS+= -DUSE_MBR
# preserve the non-disklabel portions of the first 8KB of the disk
CPPFLAGS+= -DSAVEBOOTAREA
# recognize old MBR partition ID for a while
CPPFLAGS+= -DCOMPAT_386BSD_MBRPART
.endif
.if (${MACHINE} == "acorn32" || ${MACHINE} == "acorn26")
# Support FileCore boot block
CPPFLAGS+= -DUSE_ACORN
.endif
.include <bsd.prog.mk>