aboutsummaryrefslogtreecommitdiff
path: root/sys/boot/alpha/common/Makefile.common
blob: 9523188b702b2cacc3ef089c5e16dae466dc5618 (plain) (blame)
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
# $FreeBSD$
#
# Common Alpha loader build rules

.include <bsd.own.mk>

.PATH: ${.CURDIR}/../common

PROG=		${BOOT}.sym
INTERNALPROG=

# Alpha-specific bootstrap sources
SRCS=		start.S main.c conf.c vers.c
.if ${BOOT} == "netboot"
SRCS+=		dev_net.c
.endif

.PATH: ${.CURDIR}/../libalpha

.if ${MK_FORTH} != "no"
# Enable BootForth
BOOT_FORTH=	yes
CFLAGS+=	-DBOOT_FORTH
CFLAGS+=	-I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/alpha
LIBFICL=	${.OBJDIR}/../../ficl/libficl.a
.endif

# Always add MI sources 
.PATH: ${.CURDIR}/../../common
.include "${.CURDIR}/../../common/Makefile.inc"
CFLAGS+=	-I${.CURDIR}/../../common
CFLAGS+=	-DPRIMARY_LOAD_ADDRESS=${PRIMARY_LOAD_ADDRESS} \
		-DSECONDARY_LOAD_ADDRESS=${SECONDARY_LOAD_ADDRESS}

CLEANFILES+=	vers.c ${BOOT} ${BOOT}.sym

CFLAGS+=	-Wall

CFLAGS+=	-I${LIBSTANDDIR}
CFLAGS+=	-I${.CURDIR}/..

vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
	sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}

LDFLAGS=-e start -Ttext ${LOAD_ADDRESS} -T ${.CURDIR}/../common/ldscript

FILES=	${BOOT}
# XXX INSTALLFLAGS_${BOOT}= -b
FILESMODE_${BOOT}= ${BINMODE} -b

${BOOT}: ${BOOT}.sym
	objcopy -O binary ${BOOT}.sym ${.TARGET}

DPADD=	${LIBALPHA} ${LIBFICL} ${LIBSTAND}
LDADD=	${LIBALPHA} ${LIBFICL} -lstand

.if defined(INSTALL_HELP)
FILES+=	${BOOT}.help
CLEANFILES+=	${BOOT}.help
${BOOT}.help: help.common help.alpha
	cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
.endif

.PATH: ${.CURDIR}/../../forth
.if !exists(${DESTDIR}/boot/loader.rc)
FILES+=	loader.rc
.endif
FILES+=	loader.4th support.4th loader.conf
FILESDIR_loader.conf= /boot/defaults

.include <bsd.prog.mk>