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