blob: a12c1824a1d17bb7273b1ca36f95c490940f9d8f (
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
|
# $NetBSD: Makefile,v 1.12 1998/02/19 14:18:36 drochner Exp $
# $FreeBSD$
BASE= loader
PROG= ${BASE}.exe
NOMAN=
NEWVERSWHAT= "ARC disk boot" ${MACHINE_ARCH}
.PATH: ${.CURDIR}/../common
# i386-specific bootstrap sources
SRCS+= main.c conf.c
# Always add MI sources
.PATH: ${.CURDIR}/../../common
.include <${.CURDIR}/../../common/Makefile.inc>
CFLAGS+= -mno-fp-regs
CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}
CFLAGS+= -I${.CURDIR}/../../.. -I.
CFLAGS+= -DLOADER
CLEANFILES+= setdef0.c setdef0.o setdef1.c setdef1.o setdefs.h start.o \
vers.c vers.o ${BASE} ${BASE}.exe ${BASE}.sym ${BASE}.list
CLEANFILES+= loader.help
CLEANFILES+= machine
CFLAGS+= -Wall
CFLAGS+= -I${LIBSTANDDIR}
CFLAGS+= -I${.CURDIR}/../include
CRT= start.o
STRIP=
BINDIR?= /boot
LOAD_ADDRESS?= 0xffffffff80900000
all: ${PROG}
vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
${CC} -c vers.c
${BASE}.exe: ${BASE} ${BASE}.help
elf2exe ${BASE}.sym ${BASE}.exe
${BASE}: ${OBJS} ${LIBSTAND} ${LIBARC} ${CRT} vers.o setdef0.o setdef1.o
${LD} -o ${BASE}.sym -M -N -Ttext ${LOAD_ADDRESS} \
${CRT} setdef0.o ${OBJS} setdef1.o vers.o -L${DESTDIR}${LIBDIR} \
${LIBSTAND} ${LIBARC} ${LIBSTAND} >${.OBJDIR}/${BASE}.list
${BASE}.help: help.common help.alpha
cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
beforeinstall:
.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
# Other fragments still to be brought in from ../Makfile.booters?
start.o: ${.CURDIR}/../lib/arch/${MACHINE_ARCH}/start.S
${CC} -c ${CFLAGS} $<
setdef0.o: setdefs.h
setdef1.o: setdefs.h
machine:
ln -sf ${.CURDIR}/../../../alpha/include machine
.include <bsd.prog.mk>
.ORDER: setdefs.h setdef0.c setdef1.c
setdefs.h setdef0.c setdef1.c: ${OBJS}
@echo Generating linker sets
@gensetdefs ${OBJS}
beforedepend ${OBJS}: machine
|