NetBSD/sys/arch/atari/stand/xxboot/Makefile.xxboot
tsutsui fe5a481b54 Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
 because modern aggressive gcc4 may reorder functions in the same source
 and the first function in a C source won't always appear at the beginning
 in its object.

Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
  explicitly include it from each Makefile because the stand
  directory contains non standalone programs like installboot and
  Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
  all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
  - create machine and m68k symlinks in ${.OBJDIR} in all boot programs
  - set appropriate make environments to suppress errors and warnings
  - <string.h> isn't there in _STANDALONE case
  - put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
    to some files in stand/tostools
  - use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
  and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
  in all boot programs
  (XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
  support 64 bit block numbers

Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.

Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
2009-01-06 13:35:30 +00:00

37 lines
795 B
Makefile

# $NetBSD: Makefile.xxboot,v 1.5 2009/01/06 13:35:30 tsutsui Exp $
BINMODE= ${NONBINMODE}
# XXX SHOULD NOT NEED TO DEFINE THESE!
LIBCRT0=
LIBC=
LIBCRTBEGIN=
LIBCRTEND=
.include "../../Makefile.booters"
.include "../${BTYPE}_LOADADDR"
STRIPFLAG=
LINKFLAGS= -static -x -N -Ttext 0
CPPFLAGS+= -I. -I${.CURDIR}/.. -I${.CURDIR}/../.. -D${BTYPE}
beforeinstall:
${INSTALL_DIR} ${DESTDIR}${BINDIR}
.s.o: ../${BTYPE}_LOADADDR
${CPP} ${CPPFLAGS} ${.IMPSRC} | ${AS} ${ASFLAGS} -o ${.TARGET}
@if ${NM} ${.TARGET} | grep -q "00000200 t end"; \
then \
true; \
else \
${NM} ${.TARGET} | grep " end"; \
rm -f ${.TARGET}; \
false; \
fi
${PROG}: ${OBJS}
${LD} ${LINKFLAGS} -o ${PROG}.elf ${OBJS}
${OBJCOPY} -O binary ${PROG}.elf ${.TARGET}
CLEANFILES+= ${PROG}.elf