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