1999-07-28 20:28:47 +00:00
|
|
|
# $NetBSD: Makefile,v 1.12 1998/02/19 14:18:36 drochner Exp $
|
1999-11-14 13:54:44 +00:00
|
|
|
# $FreeBSD$
|
1999-07-28 20:28:47 +00:00
|
|
|
|
|
|
|
BASE= loader
|
1999-07-29 22:22:38 +00:00
|
|
|
PROG= ${BASE}.exe
|
1999-07-28 20:28:47 +00:00
|
|
|
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
|
|
|
|
|
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}.exe ${BASE}.sym ${BASE}.list
|
|
|
|
CLEANFILES+= loader.help
|
|
|
|
CLEANFILES+= machine
|
1999-07-28 20:28:47 +00:00
|
|
|
|
|
|
|
CFLAGS+= -Wall
|
|
|
|
|
|
|
|
CFLAGS+= -I${LIBSTANDDIR}
|
|
|
|
CFLAGS+= -I${.CURDIR}/../include
|
|
|
|
CRT= start.o
|
|
|
|
STRIP=
|
|
|
|
BINDIR?= /boot
|
|
|
|
LOAD_ADDRESS?= 0xffffffff80900000
|
|
|
|
|
1999-07-29 22:22:38 +00:00
|
|
|
all: ${PROG}
|
1999-07-28 20:28:47 +00:00
|
|
|
|
|
|
|
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} \
|
1999-12-16 17:25:01 +00:00
|
|
|
${CRT} setdef0.o ${OBJS} setdef1.o vers.o -L${DESTDIR}${LIBDIR} \
|
|
|
|
${LIBSTAND} ${LIBARC} ${LIBSTAND} >${.OBJDIR}/${BASE}.list
|
1999-07-28 20:28:47 +00:00
|
|
|
|
|
|
|
${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?
|
1999-11-14 13:54:44 +00:00
|
|
|
start.o: ${.CURDIR}/../lib/arch/${MACHINE_ARCH}/start.S
|
1999-07-28 20:28:47 +00:00
|
|
|
${CC} -c ${CFLAGS} $<
|
|
|
|
|
|
|
|
setdef0.o: setdefs.h
|
|
|
|
|
|
|
|
setdef1.o: setdefs.h
|
|
|
|
|
|
|
|
machine:
|
|
|
|
ln -sf ${.CURDIR}/../../../alpha/include machine
|
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|
|
|
|
|
1999-12-16 17:25:01 +00:00
|
|
|
.ORDER: setdefs.h setdef0.c setdef1.c
|
|
|
|
setdefs.h setdef0.c setdef1.c: ${OBJS}
|
1999-07-28 20:28:47 +00:00
|
|
|
@echo Generating linker sets
|
1999-12-16 17:25:01 +00:00
|
|
|
@gensetdefs ${OBJS}
|
1999-07-28 20:28:47 +00:00
|
|
|
|
|
|
|
beforedepend ${OBJS}: machine
|