summaryrefslogtreecommitdiffstats
path: root/sys/boot/alpha/boot2/Makefile
blob: 5b58e499aef7ee83a05d1bd7fc947ad7fce1c034 (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
#	$NetBSD: Makefile,v 1.12 1998/02/19 14:18:36 drochner Exp $

BASE= 		loader
PROG= 		${BASE}
NOMAN=
NEWVERSWHAT=	"SRM disk boot"

.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
CFLAGS+=	-DPRIMARY_LOAD_ADDRESS=${PRIMARY_LOAD_ADDRESS} \
		-DSECONDARY_LOAD_ADDRESS=${SECONDARY_LOAD_ADDRESS}

CLEANFILES+=	vers.c vers.o gensetdefs.o gensetdefs setdef0.o setdef1.o \
		setdefs.h start.o
CLEANFILES+=	${BASE} ${BASE}.sym ${BASE}.list

CFLAGS+=	-Wall

CFLAGS+=	-I${LIBSTANDDIR}
CFLAGS+=	-I${.CURDIR}/..
CRT=		start.o
STRIP=

all: ${BASE}

vers.o: ${.CURDIR}/newvers.sh ${.CURDIR}/Makefile
	sh ${.CURDIR}/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
	${CC} -c vers.c

${BASE}: ${BASE}.sym
	objcopy -O binary ${BASE}.sym ${BASE}

${BASE}.sym: ${OBJS} ${LIBSTAND} ${LIBALPHA} ${CRT} vers.o setdef0.o setdef1.o
	${LD} -o ${BASE}.sym -M -e start -N -Ttext ${SECONDARY_LOAD_ADDRESS} \
	${CRT} setdef0.o ${OBJS} setdef1.o \
	vers.o ${LIBSTAND} ${LIBALPHA} ${LIBSTAND} >${.OBJDIR}/${BASE}.list

# Other fragments still to be brought in from ../Makfile.booters?
start.o:	${.CURDIR}/../libalpha/start.S
	${CC} -c $<

setdef0.o: setdefs.h

setdef1.o: setdefs.h

machine:
	ln -sf ${.CURDIR}/../../../alpha/include machine

CLEANFILES+=	machine

.include <bsd.prog.mk>

setdefs.h: gensetdefs ${OBJS}
	@echo Generating linker sets
	@./gensetdefs ${OBJS} >setdefs.h

gensetdefs: gensetdefs.o
	${CC} -static gensetdefs.o -o $@

gensetdefs.o: gensetdefs.c
	${CC} -c $<

beforedepend ${OBJS}: machine
OpenPOWER on IntegriCloud