Deleted Added
full compact
Makefile (104632) Makefile (104635)
1# $FreeBSD: head/sys/boot/i386/gptboot/Makefile 104632 2002-10-07 20:56:09Z phk $
1# $FreeBSD: head/sys/boot/i386/gptboot/Makefile 104635 2002-10-07 21:36:06Z phk $
2
3PROG= boot2
4NOMAN=
5STRIP=
6BINDIR?= /boot
7BINMODE= 444
8CLEANFILES+= boot1 boot1.out boot1.o \
9 boot2.ldr boot2.bin boot2.ld boot2.out boot2.o boot2.h \
2
3PROG= boot2
4NOMAN=
5STRIP=
6BINDIR?= /boot
7BINMODE= 444
8CLEANFILES+= boot1 boot1.out boot1.o \
9 boot2.ldr boot2.bin boot2.ld boot2.out boot2.o boot2.h \
10 boot2.s sio.o
10 boot2.s sio.o divdi3.o moddi3.o qdivrem.o
11
12NM?= nm
13
14# A value of 0x80 enables LBA support.
15B1FLAGS= 0x80
16
17BOOT_COMCONSOLE_PORT?= 0x3f8
18BOOT_COMCONSOLE_SPEED?= 9600
19B2SIOFMT?= 0x3
20
21.if exists(${.OBJDIR}/../btx)
22BTX= ${.OBJDIR}/../btx
23.else
24BTX= ${.CURDIR}/../btx
25.endif
26
27ORG1= 0x7c00
28ORG2= 0x1000
29
11
12NM?= nm
13
14# A value of 0x80 enables LBA support.
15B1FLAGS= 0x80
16
17BOOT_COMCONSOLE_PORT?= 0x3f8
18BOOT_COMCONSOLE_SPEED?= 9600
19B2SIOFMT?= 0x3
20
21.if exists(${.OBJDIR}/../btx)
22BTX= ${.OBJDIR}/../btx
23.else
24BTX= ${.CURDIR}/../btx
25.endif
26
27ORG1= 0x7c00
28ORG2= 0x1000
29
30# Setting this to anything else gives UFS1+2 support and larger
31# boot2 binary.
32BOOT2_UFS?= UFS1_ONLY
33
30CFLAGS= -elf -ffreestanding -Os -fno-builtin \
31 -fno-guess-branch-probability \
32 -mrtd \
33 -I${.CURDIR}/../../common \
34 -I${.CURDIR}/../btx/lib -I. \
35 -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \
36 -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
37 -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings
38
34CFLAGS= -elf -ffreestanding -Os -fno-builtin \
35 -fno-guess-branch-probability \
36 -mrtd \
37 -I${.CURDIR}/../../common \
38 -I${.CURDIR}/../btx/lib -I. \
39 -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \
40 -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
41 -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings
42
39CFLAGS+= -DUFS1_ONLY
43.if ${BOOT2_UFS} == "UFS1_ONLY"
44CFLAGS+= -D${BOOT2_UFS}
45.else
40
46
47.endif
48
41LDFLAGS=-nostdlib -static -N
42
43all: boot1 boot2
44
45boot1: boot1.out
46 objcopy -S -O binary boot1.out ${.TARGET}
47
48boot1.out: boot1.o

--- 12 unchanged lines hidden (view full) ---

61boot2.h: boot1.out
62 ${NM} -t d ${.ALLSRC} | awk '/([0-9])+ T xread/ \
63 { x = $$1 - ORG1; printf("#define XREADORG 0x7%x\n", x) }' \
64 ORG1=`printf "%d" ${ORG1}` > boot2.h
65
66boot2: boot2.ldr boot2.bin ${BTX}/btx/btx
67 btxld -v -E ${ORG2} -f bin -b ${BTX}/btx/btx -l boot2.ldr \
68 -o boot2.ld -P 1 boot2.bin
49LDFLAGS=-nostdlib -static -N
50
51all: boot1 boot2
52
53boot1: boot1.out
54 objcopy -S -O binary boot1.out ${.TARGET}
55
56boot1.out: boot1.o

--- 12 unchanged lines hidden (view full) ---

69boot2.h: boot1.out
70 ${NM} -t d ${.ALLSRC} | awk '/([0-9])+ T xread/ \
71 { x = $$1 - ORG1; printf("#define XREADORG 0x7%x\n", x) }' \
72 ORG1=`printf "%d" ${ORG1}` > boot2.h
73
74boot2: boot2.ldr boot2.bin ${BTX}/btx/btx
75 btxld -v -E ${ORG2} -f bin -b ${BTX}/btx/btx -l boot2.ldr \
76 -o boot2.ld -P 1 boot2.bin
77.if ${BOOT2_UFS} == "UFS1_ONLY"
69 @ls -l boot2.ld | awk '{ x = 7680 - $$5; \
70 print x " bytes available"; if (x < 0) exit 1 }'
71 dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync 2>/dev/null
78 @ls -l boot2.ld | awk '{ x = 7680 - $$5; \
79 print x " bytes available"; if (x < 0) exit 1 }'
80 dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync 2>/dev/null
81.else
82 @ls -l boot2.ld | awk '{ x = 9728 - $$5; \
83 print x " bytes available"; if (x < 0) exit 1 }'
84 dd if=boot2.ld of=${.TARGET} obs=9728 conv=osync 2>/dev/null
85.endif
72
73boot2.ldr:
74 dd if=/dev/zero of=${.TARGET} bs=512 count=1 2>/dev/null
75
76boot2.bin: boot2.out
77 objcopy -S -O binary boot2.out ${.TARGET}
78
86
87boot2.ldr:
88 dd if=/dev/zero of=${.TARGET} bs=512 count=1 2>/dev/null
89
90boot2.bin: boot2.out
91 objcopy -S -O binary boot2.out ${.TARGET}
92
93.if ${BOOT2_UFS} == "UFS1_ONLY"
79boot2.out: boot2.o sio.o
94boot2.out: boot2.o sio.o
95.else
96boot2.out: boot2.o sio.o divdi3.o moddi3.o qdivrem.o
97.endif
80 ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} \
98 ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} \
81 ${BTX}/lib/crt0.o boot2.o sio.o
99 ${BTX}/lib/crt0.o ${.ALLSRC}
82
83boot2.o: boot2.h
84
85sio.o: sio.s
86 ${AS} ${AFLAGS} --defsym SIOPRT=${BOOT_COMCONSOLE_PORT} \
87 --defsym SIOFMT=${B2SIOFMT} \
88 --defsym SIOSPD=${BOOT_COMCONSOLE_SPEED} \
89 ${.IMPSRC} -o ${.TARGET}
90
100
101boot2.o: boot2.h
102
103sio.o: sio.s
104 ${AS} ${AFLAGS} --defsym SIOPRT=${BOOT_COMCONSOLE_PORT} \
105 --defsym SIOFMT=${B2SIOFMT} \
106 --defsym SIOSPD=${BOOT_COMCONSOLE_SPEED} \
107 ${.IMPSRC} -o ${.TARGET}
108
109moddi3.o: ${.CURDIR}/../../../libkern/moddi3.c
110 ${CC} ${CFLAGS} -I${.CURDIR}/../../../ -c ${.IMPSRC}
111
112divdi3.o: ${.CURDIR}/../../../libkern/divdi3.c
113 ${CC} ${CFLAGS} -I${.CURDIR}/../../../ -c ${.IMPSRC}
114
115qdivrem.o: ${.CURDIR}/../../../libkern/qdivrem.c
116 ${CC} ${CFLAGS} -I${.CURDIR}/../../../ -c ${.IMPSRC}
117
91install:
92 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
93 boot1 ${DESTDIR}${BINDIR}/boot1
94 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
95 boot2 ${DESTDIR}${BINDIR}/boot2
96
97.include <bsd.prog.mk>
118install:
119 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
120 boot1 ${DESTDIR}${BINDIR}/boot1
121 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
122 boot2 ${DESTDIR}${BINDIR}/boot2
123
124.include <bsd.prog.mk>