1# 2# $OpenBSD: Makefile,v 1.7 2023/08/14 08:56:20 kn Exp $ 3# 4# Copyright (c) 1997 Tobias Weingartner 5# 6# Permission to use, copy, modify, and distribute this software for any 7# purpose with or without fee is hereby granted, provided that the above 8# copyright notice and this permission notice appear in all copies. 9# 10# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 18PROG= fdisk 19SRCS= fdisk.c user.c misc.c disk.c mbr.c part.c cmd.c manual.c gpt.c 20DPADD= ${LIBUTIL} 21LDADD= -lutil 22CLEANFILES += fdisk.cat8 manual.c 23 24.include <bsd.own.mk> 25 26.ifdef NOMAN 27manual.c: 28 (echo 'const unsigned char manpage[] = {'; \ 29 echo 'no manual' | gzip -9c | hexdump -ve '"0x" 1/1 "%02x,"'; \ 30 echo '};'; echo 'const int manpage_sz = sizeof(manpage);') > manual.c 31.else 32fdisk.cat8: fdisk.8 33 mandoc -Tascii ${.ALLSRC} > ${.TARGET} 34 35manual.c: fdisk.cat8 36 (echo 'const unsigned char manpage[] = {'; \ 37 cat fdisk.cat8 | gzip -9c | hexdump -ve '"0x" 1/1 "%02x,"'; \ 38 echo '};'; echo 'const int manpage_sz = sizeof(manpage);') > manual.c 39.endif 40 41.if ${MACHINE} == "amd64" || ${MACHINE} == "i386" || ${MACHINE} == "landisk" 42CFLAGS += -DHAS_MBR 43.endif 44 45# XXX gross 46.if ${MACHINE_ARCH} == "sh" 47CFLAGS += -fno-builtin-memcpy 48.endif 49 50.PATH: ${.CURDIR}/../../../sbin/fdisk 51.include <bsd.prog.mk> 52