8462ca0c48d9bf949460b8c0d85e8fa547a5c8b7
[dragonfly.git] / sys / boot / pc32 / boot0 / Makefile
1 # $FreeBSD: src/sys/boot/i386/boot0/Makefile,v 1.17 2002/09/17 01:48:54 peter Exp $
2
3 PROG?=          boot0
4 NOMAN=
5 STRIP=
6 BINDIR?=        /boot
7 BINMODE=        444
8
9 NXCFLAGS=
10 NXLDFLAGS=
11
12 .PATH: ${.CURDIR}/..
13
14 # The default set of flags compiled into boot0.  This enables update (writing
15 # the modified boot0 back to disk after running so that the selection made is
16 # saved), packet mode (detect and use the BIOS EDD extensions if we try to
17 # boot past the 1024 cylinder limit), and booting from all valid slices.
18 BOOT_BOOT0_FLAGS?=      0x8f
19
20 # The number of timer ticks to wait for a keypress before assuming the default
21 # selection.  Since there are 18.2 ticks per second, the default value of
22 # 0xb6 (182d) corresponds to 10 seconds.
23 BOOT_BOOT0_TICKS?=      0xb6
24
25 # Comm settings for boot0sio.
26 # Bit(s) Description
27 # 7-5    data rate (110,150,300,600,1200,2400,4800,9600 bps)
28 # 4-3    parity (00 or 10 = none, 01 = odd, 11 = even)
29 # 2      stop bits (set = 2, clear = 1)
30 # 1-0    data bits (00 = 5, 01 = 6, 10 = 7, 11 = 8)
31 .if !defined(BOOT_BOOT0_COMCONSOLE_SPEED)
32 BOOT_COMCONSOLE_SPEED?= 9600
33 .if ${BOOT_COMCONSOLE_SPEED} == 9600
34 BOOT_BOOT0_COMCONSOLE_SPEED=    "7 << 5 + 3"
35 .elif ${BOOT_COMCONSOLE_SPEED} == 4800
36 BOOT_BOOT0_COMCONSOLE_SPEED=    "6 << 5 + 3"
37 .elif ${BOOT_COMCONSOLE_SPEED} == 2400
38 BOOT_BOOT0_COMCONSOLE_SPEED=    "5 << 5 + 3"
39 .elif ${BOOT_COMCONSOLE_SPEED} == 1200
40 BOOT_BOOT0_COMCONSOLE_SPEED=    "4 << 5 + 3"
41 .elif ${BOOT_COMCONSOLE_SPEED} == 600
42 BOOT_BOOT0_COMCONSOLE_SPEED=    "3 << 5 + 3"
43 .elif ${BOOT_COMCONSOLE_SPEED} == 300
44 BOOT_BOOT0_COMCONSOLE_SPEED=    "2 << 5 + 3"
45 .elif ${BOOT_COMCONSOLE_SPEED} == 150
46 BOOT_BOOT0_COMCONSOLE_SPEED=    "1 << 5 + 3"
47 .elif ${BOOT_COMCONSOLE_SPEED} == 110
48 BOOT_BOOT0_COMCONSOLE_SPEED=    "0 << 5 + 3"
49 .else
50 BOOT_BOOT0_COMCONSOLE_SPEED=    "7 << 5 + 3"
51 .endif
52 .endif
53
54 CFLAGS+=-DFLAGS=${BOOT_BOOT0_FLAGS} \
55         -DTICKS=${BOOT_BOOT0_TICKS} \
56         -DCOMSPEED=${BOOT_BOOT0_COMCONSOLE_SPEED}
57
58 # pull BOOT0_ORIGIN out of bootasm.h
59 #
60 #
61 ${PROG}: boot0.o bootasmdef.nx
62         @echo "boot0 origin set to `${.OBJDIR}/bootasmdef.nx BOOT0_ORIGIN`"
63         ${LD} ${LDFLAGS:N-Wl,*} -N -e start -Ttext `${.OBJDIR}/bootasmdef.nx BOOT0_ORIGIN` -o boot0.out boot0.o
64         objcopy -S -O binary boot0.out ${.TARGET}
65
66 boot0.o: boot0.S
67         ${CC} -c ${CFLAGS} ${ASSEMBLER_FLAGS} ${.IMPSRC} -o ${.TARGET}
68
69 CLEANFILES+= boot0.out boot0.o bootasmdef.nx
70
71 .include <bsd.prog.mk>