#	$NetBSD$
#	$NecBSD: Makefile,v 1.4.2.1.2.4.2.1 2001/07/12 07:46:49 honda Exp $

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

LIB= i386
NOPIC=# defined
NOPROFILE=# defined

I386_INCLUDE_DISK?= yes
I386_INCLUDE_DOS?= no
I386_INCLUDE_BUS?= no		# yes if bus debug

CPPFLAGS= -I$S/lib/libsa ${PC98CPPFLAGS} ${PC98MISCCPPFLAGS}
CPPFLAGS+= -I${S}
CPPFLAGS+= -DDISK_DEBUG
#CPPFLAGS+= -DDEBUG
#CPPFLAGS+= -DNO_DISKLABEL
#CPPFLAGS+= -DSAVE_MEMORY

#	kill biosdeley.S, because PC-98 does not have bios function for delay
#	add delay.c
#	kill biosreboot.S, add reboot.c
#	add conputc.c
#
#	(REQUIRED)
SRCS= pcio.c conio.S                       
#SRCS+= comio.S		(depend on SUPPORT_SERIAL)
SRCS+= seri_direct.c
SRCS+= disk_direct.c
SRCS+= pccs.c gipc.c
SRCS+= wdcsubr.c wdc_pccs.c wdc_isa.c
SRCS+= nsp_pccs.c
SRCS+= biosgetrtc.S
SRCS+= getsecs.c
#		bcd2dec() -> getsecs() <- biosgetrct()
#		getsecs() -> lib/netif/netif_small.c (depend on USE_NETIF)
#			  -> libsa/tftp.c (depend on USE_NETIF)
#	(REQUIRED)
SRCS+= gatea20.c
SRCS+= biosparam.S
#SRCS+= biosmem.S
SRCS+= bios_mem.c
#SRCS+= getextmemx.c	(depend on !CONSERVATIVE_MEMDETECT)
#SRCS+= biosmemx.S	(depend on !CONSERVATIVE_MEMDETECT)
SRCS+= delay.c reboot.c conputc.c
SRCS+= pread.c menuutils.c parseutils.c
SRCS+= bootinfo.c
SRCS+= bootinfo_biosgeom.c	#(depend on PASS_BIOSGEOM)
SRCS+= bootinfo_bootflags.c
SRCS+= busio.c
SRCS+= ippi.c
#		bi_getbiosgeom() -> exec_netbsd() in exec.c
#SRCS+= bootinfo_memmap.c	#(depend on PASS_MEMMAP, not yet done)
#		bi_getmemmap() -> exec_netbsd() in exec.c
SRCS+= startprog.S panic.c

.if (${I386_INCLUDE_DISK} == "yes")
SRCS+= biosdisk.c biosdisk_ll.c bios_disk.S
.endif
.if (${I386_INCLUDE_DOS} == "yes")
SRCS+= dosfile.c dos_file.S
.endif
.if (${I386_INCLUDE_DISK} == "yes") || (${I386_INCLUDE_DOS} == "yes")
SRCS+= diskbuf.c
.endif
.if (${I386_INCLUDE_BUS} == "yes")
SRCS+= biospci.c bios_pci.S isapnp.c isadma.c
.endif

.include <bsd.own.mk>
.undef DESTDIR
.include <bsd.lib.mk>

lib${LIB}.o:: ${OBJS}
	@echo building standard ${LIB} library
	@rm -f lib${LIB}.o
	@${LD} -r -o lib${LIB}.o `lorder ${OBJS} | tsort`
