blob: b6d1835ef78d87ae2251b263e7b352923d8152c4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
# $FreeBSD$
BASE= loader
PROG= ${BASE}
NOMAN=
MAN1=
STRIP=
NEWVERSWHAT= "bootstrap loader" OpenFirmware/PowerPC
BINDIR?= /boot
LOADER_DISK_SUPPORT?= yes
LOADER_NET_SUPPORT?= yes
# architecture-specific loader code
SRCS= conf.c
# Pull in common loader code
.PATH: ${.CURDIR}/../../ofw/common
.include <${.CURDIR}/../../ofw/common/Makefile.inc>
.if defined(LOADER_DISK_SUPPORT)
CFLAGS+= -DLOADER_DISK_SUPPORT
.endif
.if defined(LOADER_NET_SUPPORT)
CFLAGS+= -DLOADER_NET_SUPPORT
.endif
.if !defined(NOFORTH)
# Enable BootForth
BOOT_FORTH= yes
CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/powerpc
.if exists(${.OBJDIR}/../../ficl/libficl.a)
LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
.else
LIBFICL= ${.CURDIR}/../../ficl/libficl.a
.endif
.endif
# Always add MI sources
.PATH: ${.CURDIR}/../../common
.include <${.CURDIR}/../../common/Makefile.inc>
CFLAGS+= -I${.CURDIR}/../../common
CFLAGS+= -I${.CURDIR}/../../.. -I.
CLEANFILES+= vers.c vers.o ${BASE}.list ${BASE}.bin ${BASE}.sym ${BASE}.help
CFLAGS+= -Wall
LDFLAGS= -nostdlib -static -Ttext 6c0000
# OpenFirmware standalone support library
LIBOFW= ${.OBJDIR}/../../ofw/libofw/libofw.a
CFLAGS+= -I${.CURDIR}/../../ofw/libofw
# where to get libstand from
#XXX need a better way to do this
LIBSTAND= ${.CURDIR}/../../../../lib/libstand/libstand.a
#.if !exists(${LIBSTAND})
#LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a
#.if !exists(${LIBSTAND})
#LIBSTAND= -lstand
#.endif
#.endif
CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/
# OpenFirmware is expecting ELF components
CFLAGS+= -elf
# New linker set code
#CFLAGS+= -DNEW_LINKER_SET
# Debug me!
CFLAGS+= -g
LDFLAGS+= -g
vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
${CC} -c vers.c
${BASE}.help: help.common help.ofw
cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
beforeinstall:
.if exists(${DESTDIR}/boot/loader)
mv ${DESTDIR}/boot/loader ${DESTDIR}/boot/loader.old
.endif
.if exists(${.OBJDIR}/loader.help)
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
${.OBJDIR}/${BASE}.help ${DESTDIR}/boot
.else
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
${.CURDIR}/${BASE}.help ${DESTDIR}/boot
.endif
.if !exists(${DESTDIR}/boot/loader.rc)
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
${.CURDIR}/../../forth/loader.rc ${DESTDIR}/boot
.endif
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
${.CURDIR}/../../forth/loader.4th ${DESTDIR}/boot
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
${.CURDIR}/../../forth/support.4th ${DESTDIR}/boot
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
${.CURDIR}/../../forth/loader.conf ${DESTDIR}/boot/defaults
${PROG}: ${OBJS} ${LIBOFW} ${LIBSTAND} ${LIBFICL} start.o vers.o setdef0.o setdef1.o
${LD} ${LDFLAGS} -o ${.TARGET} setdef0.o start.o ${OBJS} setdef1.o \
vers.o ${LIBFICL} ${LIBOFW} ${LIBSTAND}
setdef0.o: setdefs.h
setdef1.o: setdefs.h
machine:
ln -sf ${.CURDIR}/../../../powerpc/include machine
# Cannot use ${OBJS} above this line
.include <bsd.prog.mk>
beforedepend ${OBJS}: machine
CLEANFILES+= machine setdefs.h setdef0.c setdef1.c setdef0.o setdef1.o \
start.o
.ORDER: setdefs.h setdef0.c setdef1.c
setdefs.h setdef0.c setdef1.c: ${OBJS}
@echo Generating linker sets
@gensetdefs ${OBJS}
|