freebsd-nq/sys/boot/alpha/common/Makefile.common
Marcel Moolenaar dc2492d303 Part 1 of fixing the boot code: binutils 2.15 fixes.
The binutils 2.15 assembler now automaticly and non-optionally adds
the .eh_frame section for unwind information. This section appears
to wreck havoc to the final boot code. Fix this by using a special
linker script that discards the .eh_frame sections, but is otherwise
identical to the linker internal script used for -N.

Compiler used: gcc 3.3.5
Verified with: binutils 2.14 & binutils 2.15 (stock and in-tree)
Tested with: /boot/loader & /boot/netboot
2004-08-22 00:26:01 +00:00

70 lines
1.6 KiB
Makefile

# $FreeBSD$
#
# Common Alpha loader build rules
.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 !defined(NOFORTH)
# 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>