Merge from vendor branch TCPDUMP:
[dragonfly.git] / sys / i386 / boot / biosboot / Makefile
1 # $FreeBSD: src/sys/i386/boot/biosboot/Makefile,v 1.70.2.2 2002/08/07 16:31:55 ru Exp $
2 # $DragonFly: src/sys/i386/boot/biosboot/Attic/Makefile,v 1.3 2003/11/15 19:01:31 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 BINMODE=        444
11 CFLAGS=         -O2 -malign-functions=0 -malign-jumps=0 -malign-loops=0 \
12                 -DBOOTWAIT=${BOOTWAIT} -DTIMEOUT=${TIMEOUT}
13 CFLAGS+=        -DBOOTSEG=${BOOTSEG} -DBOOTSTACK=${BOOTSTACK}
14 CFLAGS+=        ${CWARNFLAGS}
15
16 # By default, if a serial port is going to be used as console, use COM1
17 # (aka /dev/ttyd0).
18 BOOT_COMCONSOLE_PORT?=0x3F8
19 CFLAGS+=        -DCOMCONSOLE=${BOOT_COMCONSOLE_PORT}
20
21 BOOT_COMCONSOLE_SPEED?=9600
22 CFLAGS+=        -DCONSPEED=${BOOT_COMCONSOLE_SPEED}
23
24 # Enable code to take the default boot string from a fixed location on the
25 # disk.  See nextboot(8) and README.386BSD for more info.
26 #CFLAGS+=       -DNAMEBLOCK
27 #CFLAGS+=       -DNAMEBLOCK_WRITEBACK
28
29 # Bias the conversion from the BIOS drive number to the FreeBSD unit number
30 # for hard disks.  This may be useful for people booting in a mixed IDE/SCSI
31 # environment (set BOOT_HD_BIAS to the number of IDE drives).
32 #CFLAGS+=       -DBOOT_HD_BIAS=1
33 #
34 # Details: this only applies if BOOT_HD_BIAS > 0.  If the BIOS drive number
35 # for the boot drive is >= BOOT_HD_BIAS, then the boot drive is assumed to
36 # be SCSI and have unit number (BIOS_drive_number - BOOT_HD_BIAS).  E.g.,
37 # BOOT_HD_BIAS=1 makes BIOS drive 1 correspond to 1:da(0,a) instead of
38 # 1:wd(1,a).  If `da' is given explicitly, then the drive is assumed to be
39 # SCSI and have BIOS drive number (da_unit_number + BOOT_HD_BIAS).  E.g.,
40 # BOOT_HD_BIAS=1 makes da(0,a) correspond to 1:da(0,a) instead of 0:da(0,a).
41
42 CLEANFILES+=    boot.nohdr boot.strip boot1 boot2 sizetest
43 LDFLAGS+=       -N -T 0 -nostdlib
44 NOSHARED=       YES
45 NOMAN=
46 STRIP=
47
48 # tunable timeout parameter, waiting for keypress, calibrated in ms
49 BOOTWAIT?=      5000
50 # tunable timeout during string input, calibrated in ms
51 #TIMEOUT?=      30000
52
53 # Location that boot2 is loaded at
54 BOOTSEG=        0x1000
55
56 # Offset in BOOTSEG for the top of the stack, keep this 16 byte aligned
57 BOOTSTACK=      0xFFF0
58
59 boot.strip:     boot
60         cp -p boot boot.strip
61         strip -aout boot.strip
62         size -aout boot.strip
63
64 boot.nohdr:     boot.strip
65         dd if=boot.strip of=boot.nohdr ibs=32 skip=1 obs=1024b
66         ls -l boot.nohdr
67
68 boot1:          boot.nohdr
69         dd if=boot.nohdr of=boot1 bs=512 count=1
70
71 boot2:          boot.nohdr
72         dd if=boot.nohdr of=boot2 bs=512 skip=1
73         @dd if=boot2 skip=14 of=sizetest 2> /dev/null
74         @if [ -s sizetest ] ; then \
75                 echo "boot2 is too big" >&2 ; \
76                 rm boot2 ; \
77                 exit 2 ; \
78         fi
79
80 all:            boot1 boot2
81
82 install:
83         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
84                 boot1 boot2 ${DESTDIR}${BINDIR}/
85
86 install-boothelp:
87         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
88                 ${.CURDIR}/boot.help ${DESTDIR}/
89
90 .include "../../../conf/bsd.kern.mk"
91 .include <bsd.prog.mk>