1 # $NetBSD: Makefile,v 1.2 2011/03/05 01:58:01 joerg Exp $ 2 3 NOMAN= # defined 4 5 .include <bsd.own.mk> 6 .include <bsd.sys.mk> 7 8 S= ${.CURDIR}/../../../.. 9 10 BINMODE= 444 11 12 PROG= boot 13 SRCS= entry.S 14 SRCS+= boot.c bootinfo.c clock.c conf.c cons.c devopen.c prf.c tgets.c 15 SRCS+= com.c scif.c wd.c wdc.c 16 SRCS+= vers.c 17 18 CLEANFILES+= vers.c ${PROG} 19 20 #MMEYE_CPU= SH3 21 MMEYE_CPU= SH4 22 23 .if ${MMEYE_CPU} == "SH3" 24 AFLAGS+= -DSH3 25 CPPFLAGS+= -DSH3 26 CPPFLAGS+= -DCONS_COM 27 RELOC= 8c800000 28 .endif 29 .if ${MMEYE_CPU} == "SH4" 30 CLEANFILES+= ${PROG}.bin ${PROG}.bin.gz 31 AFLAGS+= -DSH4 32 CPPFLAGS+= -DSH4 33 CPPFLAGS+= -DCONS_SCIF 34 RELOC= 89000000 35 .endif 36 37 38 AFLAGS+= -D_LOCORE -D_KERNEL 39 CFLAGS+= -ffreestanding 40 CFLAGS+= -Wall -Werror -Wno-main 41 CFLAGS+= -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith 42 CFLAGS+= -Wno-pointer-sign 43 CPPFLAGS+= -nostdinc -D_STANDALONE -I. -I${.OBJDIR} -I${S} 44 DBG= -Os 45 46 NETBSD_VERS!= ${HOST_SH} ${S}/conf/osrelease.sh 47 CPPFLAGS+= -DNETBSD_VERS='"${NETBSD_VERS}"' 48 49 # XXX SHOULD NOT NEED TO DEFINE THESE! 50 LIBCRT0= 51 LIBC= 52 LIBCRTBEGIN= 53 LIBCRTEND= 54 55 STRIPFLAG= 56 57 ENTRY= start 58 59 60 ### find out what to use for libkern 61 KERN_AS= library 62 .include "${S}/lib/libkern/Makefile.inc" 63 LIBKERN= ${KERNLIB} 64 65 ### find out what to use for libz 66 Z_AS= library 67 .include "${S}/lib/libz/Makefile.inc" 68 LIBZ= ${ZLIB} 69 70 ### find out what to use for libsa 71 SA_AS= library 72 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes 73 .include "${S}/lib/libsa/Makefile.inc" 74 LIBSA= ${SALIB} 75 76 .PHONY: vers.c 77 vers.c: ${.CURDIR}/version 78 ${HOST_SH} ${S}/conf/newvers_stand.sh ${.CURDIR}/version "mmeye" 79 80 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 81 ${LD} -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${PROG} \ 82 ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 83 .if ${MMEYE_CPU} == "SH4" 84 ${OBJCOPY} -S -O binary ${.TARGET} ${.TARGET}.bin 85 TOOL_AWK=${TOOL_AWK} TOOL_HEXDUMP=${TOOL_HEXDUMP} \ 86 ${HOST_SH} $(.CURDIR)/deflate.sh ${.TARGET}.bin 87 .endif 88 89 cleandir distclean: .WAIT cleanlibdir 90 91 cleanlibdir: 92 -rm -rf lib 93 94 .include <bsd.prog.mk> 95 .include <bsd.klinks.mk> 96