1999-09-06 08:38:10 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
# Common Alpha loader build rules
|
|
|
|
|
|
|
|
.PATH: ${.CURDIR}/../common
|
|
|
|
|
|
|
|
# Alpha-specific bootstrap sources
|
|
|
|
SRCS+= main.c conf.c
|
1999-10-09 12:29:42 +00:00
|
|
|
.if ${BASE} == netboot
|
|
|
|
SRCS+= dev_net.c
|
|
|
|
.endif
|
1999-09-06 08:38:10 +00:00
|
|
|
|
2003-02-26 06:18:52 +00:00
|
|
|
.if !defined(NOFORTH)
|
1999-12-27 09:20:33 +00:00
|
|
|
# Enable BootForth
|
2000-05-12 22:45:16 +00:00
|
|
|
BOOT_FORTH= yes
|
|
|
|
CFLAGS+= -DBOOT_FORTH
|
2003-02-26 06:18:52 +00:00
|
|
|
CFLAGS+= -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/alpha
|
2000-05-12 22:45:16 +00:00
|
|
|
.if exists(${.OBJDIR}/../../ficl/libficl.a)
|
|
|
|
LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
|
|
|
|
.else
|
|
|
|
LIBFICL= ${.CURDIR}/../../ficl/libficl.a
|
|
|
|
.endif
|
2003-02-26 06:18:52 +00:00
|
|
|
.endif
|
1999-12-27 09:20:33 +00:00
|
|
|
|
1999-09-06 08:38:10 +00:00
|
|
|
# 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+= -DPRIMARY_LOAD_ADDRESS=${PRIMARY_LOAD_ADDRESS} \
|
|
|
|
-DSECONDARY_LOAD_ADDRESS=${SECONDARY_LOAD_ADDRESS}
|
|
|
|
|
1999-12-16 17:25:01 +00:00
|
|
|
CLEANFILES+= setdef0.c setdef0.o setdef1.c setdef1.o setdefs.h start.o \
|
|
|
|
vers.c vers.o ${BASE} ${BASE}.sym ${BASE}.list
|
1999-09-06 08:38:10 +00:00
|
|
|
|
|
|
|
CFLAGS+= -Wall
|
|
|
|
|
|
|
|
CFLAGS+= -I${LIBSTANDDIR}
|
|
|
|
CFLAGS+= -I${.CURDIR}/..
|
|
|
|
CRT= start.o
|
|
|
|
STRIP=
|
|
|
|
BINDIR?= /boot
|
2001-09-12 10:25:50 +00:00
|
|
|
INSTALLFLAGS?= -b
|
1999-09-06 08:38:10 +00:00
|
|
|
|
2001-06-16 06:28:07 +00:00
|
|
|
all: ${BASE} ${BASE}.help
|
1999-09-06 08:38:10 +00:00
|
|
|
|
|
|
|
vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
|
|
|
|
sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
|
|
|
|
${CC} -c vers.c
|
|
|
|
|
2001-06-16 06:28:07 +00:00
|
|
|
${BASE}: ${OBJS} ${LIBSTAND} ${LIBFICL} ${LIBALPHA} ${CRT} vers.o
|
1999-09-06 08:38:10 +00:00
|
|
|
${LD} -o ${BASE}.sym -M -e start -N -Ttext ${LOAD_ADDRESS} \
|
2001-06-14 01:23:57 +00:00
|
|
|
${CRT} ${OBJS} vers.o \
|
1999-12-27 09:20:33 +00:00
|
|
|
-L${DESTDIR}${LIBDIR} ${LIBSTAND} ${LIBALPHA} ${LIBFICL} ${LIBSTAND} \
|
|
|
|
>${.OBJDIR}/${BASE}.list
|
2001-06-16 06:28:07 +00:00
|
|
|
objcopy -O binary ${BASE}.sym ${BASE}
|
1999-09-06 08:38:10 +00:00
|
|
|
|
2001-05-28 05:12:13 +00:00
|
|
|
CLEANFILES+= ${BASE}.help
|
1999-09-06 08:38:10 +00:00
|
|
|
${BASE}.help: help.common help.alpha
|
|
|
|
cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
|
|
|
|
|
|
|
|
beforeinstall:
|
2000-05-06 18:31:26 +00:00
|
|
|
.ifdef INSTALL_HELP
|
|
|
|
.if exists(${.OBJDIR}/${BASE}.help)
|
1999-09-06 08:38:10 +00:00
|
|
|
${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
|
|
|
|
.endif
|
2000-05-12 23:22:09 +00:00
|
|
|
.if !exists(${DESTDIR}/boot/loader.rc)
|
|
|
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
|
|
|
|
${.CURDIR}/../../forth/loader.rc ${DESTDIR}/boot
|
2000-07-10 16:52:42 +00:00
|
|
|
.endif
|
2000-05-12 23:22:09 +00:00
|
|
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
|
2001-05-29 01:48:06 +00:00
|
|
|
${.CURDIR}/../../forth/loader.4th ${DESTDIR}/boot
|
2000-05-12 23:22:09 +00:00
|
|
|
${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
|
|
|
|
|
1999-09-06 08:38:10 +00:00
|
|
|
|
|
|
|
start.o: ${.CURDIR}/../libalpha/start.S
|
|
|
|
${CC} -c ${CFLAGS} $<
|
|
|
|
|
|
|
|
machine:
|
|
|
|
ln -sf ${.CURDIR}/../../../alpha/include machine
|
|
|
|
|
|
|
|
CLEANFILES+= machine
|
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|
|
|
|
|
|
|
|
beforedepend ${OBJS}: machine
|