Initial import from FreeBSD RELENG_4:
[dragonfly.git] / sys / i386 / boot / cdboot / Makefile
1 # $FreeBSD: src/sys/i386/boot/cdboot/Makefile,v 1.7.2.1 2002/08/07 16:31:55 ru Exp $
2 #
3
4 PROG=   boot
5 # Order is very important on the SRCS line for this prog
6 SRCS=   start.S table.c boot2.S boot.c asm.S bios.S serial.S
7 SRCS+=  probe_keyboard.c io.c cdrom.c malloc.c
8
9 .PATH:  ${.CURDIR}/../biosboot
10
11 BINMODE=        444
12 CFLAGS=         -O2 -malign-functions=0 -malign-jumps=0 -malign-loops=0 \
13                 -DBOOTWAIT=${BOOTWAIT} -DTIMEOUT=${TIMEOUT}
14 CFLAGS+=        -DBOOTSEG=${BOOTSEG} -DBOOTSTACK=${BOOTSTACK}
15 CFLAGS+=        -I${.CURDIR}/../biosboot
16 CFLAGS+=        -DCDBOOT
17 CFLAGS+=        ${CWARNFLAGS}
18 #CFLAGS+=       -DDEBUG
19
20 # By default, if a serial port is going to be used as console, use COM1
21 # (aka /dev/ttyd0).
22 BOOT_COMCONSOLE_PORT?=0x3F8
23 CFLAGS+=        -DCOMCONSOLE=${BOOT_COMCONSOLE_PORT}
24
25 BOOT_COMCONSOLE_SPEED?=9600
26 CFLAGS+=        -DCONSPEED=${BOOT_COMCONSOLE_SPEED}
27
28 # Enable code to take the default boot string from a fixed location on the
29 # disk.  See nextboot(8) and README.386BSD for more info.
30 #CFLAGS+=       -DNAMEBLOCK
31 #CFLAGS+=       -DNAMEBLOCK_WRITEBACK
32
33 # Bias the conversion from the BIOS drive number to the FreeBSD unit number
34 # for hard disks.  This may be useful for people booting in a mixed IDE/SCSI
35 # environment (set BOOT_HD_BIAS to the number of IDE drives).
36 #CFLAGS+=       -DBOOT_HD_BIAS=1
37 #
38 # Details: this only applies if BOOT_HD_BIAS > 0.  If the BIOS drive number
39 # for the boot drive is >= BOOT_HD_BIAS, then the boot drive is assumed to
40 # be SCSI and have unit number (BIOS_drive_number - BOOT_HD_BIAS).  E.g.,
41 # BOOT_HD_BIAS=1 makes BIOS drive 1 correspond to 1:sd(0,a) instead of
42 # 1:wd(1,a).  If `sd' is given explicitly, then the drive is assumed to be
43 # SCSI and have BIOS drive number (sd_unit_number + BOOT_HD_BIAS).  E.g.,
44 # BOOT_HD_BIAS=1 makes sd(0,a) correspond to 1:sd(0,a) instead of 0:sd(0,a).
45
46 CLEANFILES+=    boot.img boot.nohdr boot.strip
47 LDFLAGS+=       -N -T 0 -nostdlib
48 NOSHARED=       YES
49 NOMAN=
50 STRIP=
51
52 # tunable timeout parameter, waiting for keypress, calibrated in ms
53 BOOTWAIT?=      5000
54 # tunable timeout during string input, calibrated in ms
55 #TIMEOUT?=      30000
56
57 # Location that boot2 is loaded at
58 BOOTSEG=        0x1000
59
60 # Offset in BOOTSEG for the top of the stack, keep this 16 byte aligned
61 BOOTSTACK=      0xFFF0
62
63 boot.strip:     boot
64         cp -p boot boot.strip
65         strip -aout boot.strip
66         size -aout boot.strip
67
68 boot.nohdr:     boot.strip
69         dd if=boot.strip of=boot.nohdr ibs=32 skip=1 obs=1024b
70         ls -l boot.nohdr
71
72 boot.img:       boot.nohdr
73         dd if=boot.nohdr of=boot.img bs=1440k count=1 conv=sync
74
75 all:            boot.img
76
77 install:
78         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}\
79                 boot.img ${DESTDIR}${BINDIR}/cdboot
80
81 .include <bsd.kern.mk>
82 .include <bsd.prog.mk>