2001-06-09 16:49:51 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
2001-06-16 06:17:16 +00:00
|
|
|
.PATH: ${.CURDIR}/../common
|
|
|
|
|
2001-06-09 16:49:51 +00:00
|
|
|
BASE= loader
|
|
|
|
PROG= ${BASE}.efi
|
|
|
|
NOMAN=
|
|
|
|
NEWVERSWHAT= "EFI boot" ${MACHINE_ARCH}
|
|
|
|
|
2001-09-22 19:12:30 +00:00
|
|
|
SRCS+= main.c conf.c dev_net.c
|
2001-06-09 16:49:51 +00:00
|
|
|
|
|
|
|
# Enable BootForth
|
2001-09-04 14:48:59 +00:00
|
|
|
BOOT_FORTH= yes
|
2001-10-08 01:41:45 +00:00
|
|
|
CFLAGS+= -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/${MACHINE_ARCH}
|
2001-06-09 16:49:51 +00:00
|
|
|
.if BOOT_FORTH
|
|
|
|
CFLAGS+= -DBOOT_FORTH
|
|
|
|
.if exists(${.OBJDIR}/../../ficl/libficl.a)
|
|
|
|
LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
|
|
|
|
.else
|
|
|
|
LIBFICL= ${.CURDIR}/../../ficl/libficl.a
|
|
|
|
.endif
|
|
|
|
.else
|
|
|
|
LIBFICL=
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# Always add MI sources
|
2001-06-16 06:17:16 +00:00
|
|
|
.PATH: ${.CURDIR}/../../common
|
|
|
|
.include <${.CURDIR}/../../common/Makefile.inc>
|
|
|
|
|
|
|
|
CFLAGS+= -I-
|
|
|
|
CFLAGS+= -I${.CURDIR}/../include
|
|
|
|
CFLAGS+= -I${.CURDIR}/../include/${MACHINE_ARCH}
|
|
|
|
CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}
|
|
|
|
CFLAGS+= -I${.CURDIR}/../../.. -I.
|
|
|
|
CFLAGS+= -I${.CURDIR}/../libefi
|
2002-04-04 06:04:38 +00:00
|
|
|
CFLAGS+= -I${.CURDIR}/../../../../lib/libstand
|
2001-06-16 06:17:16 +00:00
|
|
|
CFLAGS+= -DLOADER
|
2001-06-09 16:49:51 +00:00
|
|
|
|
|
|
|
LDSCRIPT= ${.CURDIR}/../libefi/arch/${MACHINE_ARCH}/ldscript.${MACHINE_ARCH}
|
|
|
|
LDFLAGS= -nostdlib -T ${LDSCRIPT} -shared -Bsymbolic
|
|
|
|
|
|
|
|
CLEANFILES+= setdef0.c setdef0.o setdef1.c setdef1.o setdefs.h start.o \
|
|
|
|
vers.c vers.o ${BASE}.efi ${BASE}.sym ${BASE}.list
|
|
|
|
CLEANFILES+= loader.help
|
|
|
|
CLEANFILES+= machine
|
|
|
|
|
2001-06-16 06:17:16 +00:00
|
|
|
CRT= start.o
|
2001-06-09 16:49:51 +00:00
|
|
|
|
2001-06-16 06:17:16 +00:00
|
|
|
all: ${PROG}
|
2001-06-09 16:49:51 +00:00
|
|
|
|
|
|
|
vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
|
|
|
|
sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
|
|
|
|
${CC} -c vers.c
|
|
|
|
|
|
|
|
${BASE}.efi: ${BASE}.sym
|
|
|
|
${OBJCOPY} -j .text \
|
|
|
|
-j .hash \
|
|
|
|
-j .data \
|
|
|
|
-j .sdata \
|
|
|
|
-j .dynamic \
|
|
|
|
-j .rela \
|
|
|
|
-j .reloc \
|
|
|
|
-j .dynsym \
|
2002-03-28 06:58:46 +00:00
|
|
|
-j .dynstr \
|
2001-06-09 16:49:51 +00:00
|
|
|
--target=efi-app-${MACHINE_ARCH} \
|
|
|
|
${BASE}.sym ${BASE}.efi
|
|
|
|
|
|
|
|
${BASE}.help: help.common help.efi
|
2001-06-16 06:17:16 +00:00
|
|
|
cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk \
|
|
|
|
> ${.TARGET}
|
2001-06-09 16:49:51 +00:00
|
|
|
|
|
|
|
beforeinstall:
|
2002-03-31 20:48:13 +00:00
|
|
|
.if exists(${.OBJDIR}/${BASE}.help)
|
2001-06-09 16:49:51 +00:00
|
|
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
|
2001-06-16 06:17:16 +00:00
|
|
|
${.OBJDIR}/${BASE}.help ${DESTDIR}/boot
|
2001-06-09 16:49:51 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
# Other fragments still to be brought in from ../Makfile.booters?
|
2001-06-16 06:17:16 +00:00
|
|
|
start.o: ${.CURDIR}/../libefi/arch/${MACHINE_ARCH}/start.S
|
|
|
|
${CC} -c ${CFLAGS} ${.IMPSRC}
|
2001-06-09 16:49:51 +00:00
|
|
|
|
|
|
|
machine:
|
|
|
|
ln -sf ${.CURDIR}/../../../${MACHINE_ARCH}/include machine
|
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|
|
|
|
|
2002-03-28 06:58:46 +00:00
|
|
|
${BASE}.sym: ${OBJS} ${LIBEFI} ${CRT} vers.o
|
|
|
|
${LD} ${LDFLAGS} -o ${BASE}.sym -M ${CRT} ${OBJS} vers.o \
|
|
|
|
${LIBFICL} ${LIBEFI} -L${DESTDIR}${LIBDIR} ${LIBSTAND} \
|
2001-07-10 16:18:20 +00:00
|
|
|
> ${.OBJDIR}/${BASE}.list
|
|
|
|
|
2001-06-09 16:49:51 +00:00
|
|
|
beforedepend ${OBJS}: machine
|