1 1.2.8.2 skrll # $NetBSD: Makefile,v 1.2.8.2 2005/11/10 13:55:09 skrll Exp $ 2 1.2.8.2 skrll 3 1.2.8.2 skrll .include <bsd.own.mk> 4 1.2.8.2 skrll .include <bsd.sys.mk> # for ${HOST_SH} 5 1.2.8.2 skrll 6 1.2.8.2 skrll S!= cd ${.CURDIR}/../../../..; pwd 7 1.2.8.2 skrll 8 1.2.8.2 skrll PROG= boot 9 1.2.8.2 skrll MKMAN= no # defined 10 1.2.8.2 skrll STRIPFLAG= 11 1.2.8.2 skrll BINMODE= 444 12 1.2.8.2 skrll 13 1.2.8.2 skrll NETBSD_VERS!= ${HOST_SH} ${S}/conf/osrelease.sh 14 1.2.8.2 skrll 15 1.2.8.2 skrll SRCS= start.S 16 1.2.8.2 skrll SRCS+= boot.c bootinfo.c conf.c devopen.c disk.c getchar.c getopt.c putchar.c 17 1.2.8.2 skrll 18 1.2.8.2 skrll # XXX SHOULD NOT NEED TO DEFINE THESE! 19 1.2.8.2 skrll LIBCRT0= 20 1.2.8.2 skrll LIBC= 21 1.2.8.2 skrll LIBCRTBEGIN= 22 1.2.8.2 skrll LIBCRTEND= 23 1.2.8.2 skrll 24 1.2.8.2 skrll AFLAGS= -x assembler-with-cpp -traditional-cpp -mno-abicalls -mips2 25 1.2.8.2 skrll AFLAGS+= -D_LOCORE -D_KERNEL 26 1.2.8.2 skrll CFLAGS= -Os -mmemcpy -G 1024 27 1.2.8.2 skrll CFLAGS+= -ffreestanding -mno-abicalls -msoft-float -mips2 28 1.2.8.2 skrll CFLAGS+= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 29 1.2.8.2 skrll CPPFLAGS+= -nostdinc -I. -I${S} 30 1.2.8.2 skrll CPPFLAGS+= -D_STANDALONE -DNO_ABICALLS -D${MACHINE} 31 1.2.8.2 skrll CPPFLAGS+= -DLIBSA_USE_MEMSET -DLIBSA_USE_MEMCPY 32 1.2.8.2 skrll CPPFLAGS+= -DNETBSD_VERS='"${NETBSD_VERS}"' 33 1.2.8.2 skrll #CPPFLAGS+= -DBOOT_DEBUG 34 1.2.8.2 skrll LDSCRIPT= ${S}/arch/mips/conf/stand.ldscript 35 1.2.8.2 skrll TEXTADDR= 0x80f00000 36 1.2.8.2 skrll 37 1.2.8.2 skrll .BEGIN: machine mips 38 1.2.8.2 skrll .NOPATH: machine mips 39 1.2.8.2 skrll 40 1.2.8.2 skrll machine:: 41 1.2.8.2 skrll -rm -f $@ 42 1.2.8.2 skrll ln -s ${S}/arch/${MACHINE}/include $@ 43 1.2.8.2 skrll 44 1.2.8.2 skrll mips:: 45 1.2.8.2 skrll -rm -f $@ 46 1.2.8.2 skrll ln -s ${S}/arch/mips/include $@ 47 1.2.8.2 skrll 48 1.2.8.2 skrll CLEANFILES+= machine mips 49 1.2.8.2 skrll 50 1.2.8.2 skrll # if there is a 'version' file, add rule for vers.c and add it to SRCS 51 1.2.8.2 skrll # and CLEANFILES 52 1.2.8.2 skrll .if exists(version) 53 1.2.8.2 skrll .PHONY: vers.c 54 1.2.8.2 skrll vers.c: ${.CURDIR}/version 55 1.2.8.2 skrll ${HOST_SH} ${S}/conf/newvers_stand.sh ${.CURDIR}/version ${MACHINE} 56 1.2.8.2 skrll 57 1.2.8.2 skrll SRCS+= vers.c 58 1.2.8.2 skrll CLEANFILES+= vers.c 59 1.2.8.2 skrll .endif 60 1.2.8.2 skrll 61 1.2.8.2 skrll ### find out what to use for libsa 62 1.2.8.2 skrll SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes 63 1.2.8.2 skrll .include "${S}/lib/libsa/Makefile.inc" 64 1.2.8.2 skrll LIBSA= ${SALIB} 65 1.2.8.2 skrll 66 1.2.8.2 skrll ### find out what to use for libkern 67 1.2.8.2 skrll .include "${S}/lib/libkern/Makefile.inc" 68 1.2.8.2 skrll LIBKERN= ${KERNLIB} 69 1.2.8.2 skrll 70 1.2.8.2 skrll ### find out what to use for libz 71 1.2.8.2 skrll .include "${S}/lib/libz/Makefile.inc" 72 1.2.8.2 skrll LIBZ= ${ZLIB} 73 1.2.8.2 skrll 74 1.2.8.2 skrll LIBS= ${LIBSA} ${LIBKERN} ${LIBZ} 75 1.2.8.2 skrll 76 1.2.8.2 skrll cleandir distclean: cleanlibdir 77 1.2.8.2 skrll cleanlibdir: 78 1.2.8.2 skrll -rm -rf lib 79 1.2.8.2 skrll 80 1.2.8.2 skrll ${PROG}: ${OBJS} ${LIBS} 81 1.2.8.2 skrll ${LD} -Map ${PROG}.map -N -x -Ttext ${TEXTADDR} -T ${LDSCRIPT} \ 82 1.2.8.2 skrll -e start -o ${PROG}.elf ${OBJS} ${LIBS} 83 1.2.8.2 skrll @${SIZE} ${PROG}.elf 84 1.2.8.2 skrll ${OBJCOPY} --impure -O ecoff-littlemips \ 85 1.2.8.2 skrll -R .pdr -R .mdebug.abi32 -R .comment -R .ident \ 86 1.2.8.2 skrll ${PROG}.elf ${.TARGET} 87 1.2.8.2 skrll 88 1.2.8.2 skrll CLEANFILES+= ${PROG}.elf ${PROG}.map 89 1.2.8.2 skrll 90 1.2.8.2 skrll .include <bsd.prog.mk> 91