#	$NetBSD: Makefile,v 1.19 1999/03/14 00:04:22 fvdl Exp $

S=	${.CURDIR}/../../../../

BASE?= biosboot_pccs
PROG= ${BASE}.sym
MKMAN=	no
NEWVERSWHAT=	"BIOS Boot"

SRCS= main.c devopen.c conf.c exec.c dev_net.c
CLEANFILES+= ${BSSTART}
CPPFLAGS+= -DCOMPAT_OLDBOOT -DCOMPAT_386BSD_MBRPART
VERSIONFILE= ${.CURDIR}/../biosboot/version

#####################################################
# Boot selection
#####################################################
#default network booting 
#CPPFLAGS+= -DBOOT_NETWORK

#####################################################
# Network protocols
#####################################################
#CPPFLAGS+= -DCOMPAT_OLDBOOT
#CPPFLAGS+= -DDEBUG
#CPPFLAGS+= -DNET_DEBUG
#CPPFLAGS+= -DSUPPORT_BOOTP -DSUPPORT_DHCP
#CPPFLAGS+= -DSUPPORT_TFTP
CPPFLAGS+= -DSUPPORT_RARP -DSUPPORT_BOOTPARAM
CPPFLAGS+= -DSUPPORT_NFS -DNFS_NOSYMLINK

.PATH: ${.CURDIR}/../libsa
SRCS+= nfs.c
CPPFLAGS+= -I${.CURDIR}/../libsa

#####################################################
# Pccs (PC card enabler)
#####################################################
CPPFLAGS+= -DBOOT_PCCS

#####################################################
# Ippi (Cbus pnp initiator)
#####################################################
CPPFLAGS+= -DBOOT_IPPI

#####################################################
# Network adapter
#####################################################
USE_NETIF= ne

.PATH: ${.CURDIR}/../lib/netif
.include "../lib/netif/Makefile.inc"

#####################################################
# serial
#####################################################
#Sample use of serial line debugger
# XXX: should -DSUPPORT_SERIAL=CONSDEV_AUTO
CPPFLAGS+= -DSUPPORT_SERIAL
# If CAPS and KANA key on, then console connected to a serial.
CPPFLAGS+= -DSERIAL_BOOTKEY
# If your machine has old I8251,
CPPFLAGS+= -DDIRECT_SERIAL -DCONSPEED=38400
# If your machine has I8251AF,
#CPPFLAGS+= -DDIRECT_SERIAL -DCONSPEED=115200

#####################################################
# Direct IDE Access
#####################################################
CPPFLAGS+= -DBOOT_WDC -DBOOT_DISK_DIRECT

#####################################################
# CBUS IDE (NEC)
#####################################################
CPPFLAGS+= -DBOOT_ISA_WDC

#####################################################
# Pccs IDE (PC card)
#####################################################
# If support pccs ide card
CPPFLAGS+= -DBOOT_PCCS_WDC
# If pccs wdc is primary
CPPFLAGS+= -DBOOT_DISK_DIRECT_PRIMARY

#####################################################
# boot options
#####################################################
CPPFLAGS+= -DPASS_BIOSGEOM
#uncomment if there are problems with memory detection
#CPPFLAGS+= -DCONSERVATIVE_MEMDETECT
#increase MAXFLENTRIES if "installboot" complains about
# "not enough fragment space in bootcode" (default: 10)
#CPPFLAGS+= -DMAXFLENTRIES=15
#set PRIM_LOADSZ to <=9 to make a 720k boot floppy (default: 15)
CPPFLAGS+= -DPRIM_LOADSZ=16

# bootflags update function
CPPFLAGS+= -DBOOTINFO_BOOTFLAGS_EXT

#CFLAGS= -O2 -fomit-frame-pointer -fno-defer-pop
CFLAGS+= -Wall

# XXX should go into library
SRCS+= ls.c
.PATH: ${.CURDIR}/../libsa

#####################################################
# memory allocators
#####################################################
SAMISCCPPFLAGS+= -DHEAP_START=0x20000 -DHEAP_LIMIT=0x50000
SAMISCCPPFLAGS+= -DNFS_NOSYMLINK -DUDP_NO_CKSUM
SAMISCMAKEFLAGS= SA_USE_CREAD=yes

CFLAGS+= -DDISKBUF_VMADDR=0x80000

#####################################################
# others
#####################################################
CLEANFILES+= ${.OBJDIR}/vers.c ${.OBJDIR}/dev_net.h

depend: prep_link
all:	prep_link .{BEGIN}

prep_link:
	if [ ! -e ${.OBJDIR}/vers.c ]; then \
		ln -s ../biosboot/vers.c ${.OBJDIR}/vers.c; \
		ln -s ../netboot/dev_net.h ${.OBJDIR}/dev_net.h; \
	fi

.include "../Makefile.booters"

conf.o dev_net.o: Makefile
