Makefile revision 100872
1# $FreeBSD: head/sys/boot/pc98/boot2/Makefile 100872 2002-07-29 09:40:17Z ru $
2#
3
4PROG=	boot
5# Order is very important on the SRCS line for this prog
6SRCS=	start.S table.c boot2.S boot.c asm.S bios.S serial.S
7SRCS+=	probe_keyboard.c io.c disk.c sys.c
8
9BINDIR=		/boot
10BINMODE=	444
11CFLAGS=		-elf -Os -fno-guess-branch-probability -mrtd \
12		-D_KERNEL -DPC98 -DBOOTWAIT=${BOOTWAIT} -DTIMEOUT=${TIMEOUT}
13CFLAGS+=	-DBOOTSEG=${BOOTSEG} -DBOOTSTACK=${BOOTSTACK}
14CFLAGS+=	${CWARNFLAGS}
15CFLAGS+=	-I${.CURDIR}/../../..
16
17
18# By default, if a serial port is going to be used as console, use COM1
19# (aka /dev/ttyd0).
20#BOOT_COMCONSOLE_PORT?=0x30
21BOOT_COMCONSOLE_PORT?=0x238
22BOOT_COMCONSOLE_CLK?=16
23BOOT_COMCONSOLE_MODE=0x0c
24CFLAGS+=	-DCOMCONSOLE=${BOOT_COMCONSOLE_PORT} \
25		-DCOMCONSOLE_CLK=${BOOT_COMCONSOLE_CLK} \
26		-DCOMCONSOLE_MODE=${BOOT_COMCONSOLE_MODE}
27
28# feature not implemented
29BOOT_COMCONSOLE_SPEED?=9600
30CFLAGS+=	-DCOMSPEED=${BOOT_COMCONSOLE_SPEED}
31
32# Enable code to take the default boot string from a fixed location on the
33# disk.  See nextboot(8) and README.386BSD for more info.
34#CFLAGS+=	-DNAMEBLOCK
35#CFLAGS+=	-DNAMEBLOCK_WRITEBACK
36
37# Bias the conversion from the BIOS drive number to the FreeBSD unit number
38# for hard disks.  This may be useful for people booting in a mixed IDE/SCSI
39# environment (set BOOT_HD_BIAS to the number of IDE drives).
40#CFLAGS+=	-DBOOT_HD_BIAS=1
41#
42# Details: this only applies if BOOT_HD_BIAS > 0.  If the BIOS drive number
43# for the boot drive is >= BOOT_HD_BIAS, then the boot drive is assumed to
44# be SCSI and have unit number (BIOS_drive_number - BOOT_HD_BIAS).  E.g.,
45# BOOT_HD_BIAS=1 makes BIOS drive 1 correspond to 1:da(0,a) instead of
46# 1:wd(1,a).  If `da' is given explicitly, then the drive is assumed to be
47# SCSI and have BIOS drive number (da_unit_number + BOOT_HD_BIAS).  E.g.,
48# BOOT_HD_BIAS=1 makes da(0,a) correspond to 1:da(0,a) instead of 0:da(0,a).
49
50CLEANFILES+=	boot.nohdr boot.strip boot1 boot2 sizetest
51LDFLAGS+=	-N -Ttext 0 -nostdlib -e start
52NOSHARED=	YES
53NOMAN=
54STRIP=
55
56# tunable timeout parameter, waiting for keypress, calibrated in ms
57BOOTWAIT?=	5000
58# tunable timeout during string input, calibrated in ms
59#TIMEOUT?=	30000
60
61# Location that boot2 is loaded at
62BOOTSEG=	0x1000
63
64# Offset in BOOTSEG for the top of the stack, keep this 16 byte aligned
65BOOTSTACK=	0xFFF0
66
67boot.nohdr:	boot
68	objcopy -S -O binary boot boot.nohdr
69	ls -l boot.nohdr
70
71boot1:		boot.nohdr
72	dd if=boot.nohdr of=boot1 bs=512 count=1
73
74boot2:		boot.nohdr
75	dd if=boot.nohdr of=boot2 bs=512 skip=1
76	@dd if=boot2 skip=14 of=sizetest 2> /dev/null
77	@if [ -s sizetest ] ; then \
78		echo "boot2 is too big" >&2 ; \
79		rm boot2 ; \
80		exit 2 ; \
81	fi
82
83all:		boot1 boot2
84
85install:
86	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
87		boot1 boot2 ${DESTDIR}${BINDIR}
88
89.include <bsd.kern.mk>
90.include <bsd.prog.mk>
91