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