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