Sync usage with man page.
[netbsd-mini2440.git] / sys / arch / atari / stand / bootxx / Makefile.bootxx
bloba344b2157f8283dde41597ed50fb021f435f56bd
1 #       $NetBSD: Makefile.bootxx,v 1.8 2009/01/06 13:35:30 tsutsui Exp $
3 NOMAN=  # defined
5 # for OBJECT_FMT
6 .include <bsd.own.mk>
8 PROG=   bootxx
10 STRIPFLAG=
11 BINMODE=${NONBINMODE}
13 # XXX SHOULD NOT NEED TO DEFINE THESE!
14 LIBCRT0=
15 LIBC=
16 LIBCRTBEGIN=
17 LIBCRTEND=
19 # logically src/sys
20 S=${.CURDIR}/../../../../..
21 S_SA=${S}/lib/libsa
22 S_KERN=${S}/lib/libkern
23 S_MACHSA=${S}/arch/atari/stand/libsa
24 S_LIBTOS=${S}/arch/atari/stand/tostools/libtos
26 S_MACHSAOBJ!=   cd ${S_MACHSA} && ${PRINTOBJDIR}
28 LIBSA=${S_MACHSAOBJ}/lib/sa/libsa.a
29 LIBKERN=${S_MACHSAOBJ}/lib/kern/libkern.a
31 .include "../../Makefile.booters"
32 .include "../../xxboot/${BTYPE}_LOADADDR"
35 BOOTXX_MAXSIZE=         6656
37 CPPFLAGS+=      -I. -I${S_LIBTOS} -I${S_MACHSA} -I${S_KERN} -I${S_SA} -I${S}
38 .if ${OBJECT_FMT} == "ELF"
39 LINKFLAGS=      -static -N -e start -Ttext ${LOADADDR}
40 .else
41 LINKFLAGS=      -static -N -Ttext ${LOADADDR}
42 .endif
44 .PATH: ${.CURDIR}/.. ${S_LIBTOS}
47 # Warning: start.S should be the first source!
49 SRCS=   start.S bootxx.c filesystem.c
51 LIBS=   ${LIBSA} ${LIBKERN}
53 beforeinstall:
54         ${INSTALL_DIR} ${DESTDIR}${BINDIR}
56 ${PROG}:        ${OBJS} ${LIBS}
57         ${_MKTARGET_LINK}
58         ${LD} ${LINKFLAGS} -o ${.TARGET}.elf ${OBJS} ${LIBS}
59         ${OBJCOPY} -O binary ${PROG}.elf ${PROG}.bin
60         ${SIZE} ${PROG}.elf
61         @len=`${SIZE} ${PROG}.elf |                                     \
62             ${TOOL_AWK} 'NR==2 { print $$1+$$2 }'`;                     \
63         if [ "$$len" -gt ${BOOTXX_MAXSIZE} ]; then                      \
64                 echo "### ${PROG} text+data size $$len is"              \
65                     "larger than ${BOOTXX_MAXSIZE}" >&2; \
66                 exit 1;                                                 \
67         fi;
68         ${TOOL_CAT} ${PROG}.bin /dev/zero |                             \
69             dd of=${PROG}.tmp bs=1 count=6656  2>/dev/null
70         mv ${PROG}.tmp ${.TARGET}
72 CLEANFILES+=    ${PROG}.elf ${PROG}.bin ${PROG}.tmp
74 .include <bsd.prog.mk>