Home | History | Annotate | Line # | Download | only in boot
Makefile revision 1.3
      1 #	$NetBSD: Makefile,v 1.3 2014/01/12 15:26:30 tsutsui 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 LIBCRTI=
     52 LIBC=
     53 LIBCRTBEGIN=
     54 LIBCRTEND=
     55 
     56 STRIPFLAG=
     57 
     58 ENTRY=		start
     59 
     60 
     61 ### find out what to use for libkern
     62 KERN_AS=	library
     63 .include "${S}/lib/libkern/Makefile.inc"
     64 LIBKERN=	${KERNLIB}
     65 
     66 ### find out what to use for libz
     67 Z_AS=		library
     68 .include "${S}/lib/libz/Makefile.inc"
     69 LIBZ=		${ZLIB}
     70 
     71 ### find out what to use for libsa
     72 SA_AS=		library
     73 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
     74 .include "${S}/lib/libsa/Makefile.inc"
     75 LIBSA=		${SALIB}
     76 
     77 .PHONY: vers.c
     78 vers.c: ${.CURDIR}/version
     79 	${HOST_SH} ${S}/conf/newvers_stand.sh ${.CURDIR}/version "mmeye"
     80 
     81 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
     82 	${LD} -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${PROG} \
     83 	    ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
     84 .if ${MMEYE_CPU} == "SH4"
     85 	${OBJCOPY} -S -O binary ${.TARGET} ${.TARGET}.bin
     86 	TOOL_AWK=${TOOL_AWK} TOOL_HEXDUMP=${TOOL_HEXDUMP} \
     87 	    ${HOST_SH} $(.CURDIR)/deflate.sh ${.TARGET}.bin
     88 .endif
     89 
     90 cleandir distclean: .WAIT cleanlibdir
     91 
     92 cleanlibdir:
     93 	-rm -rf lib
     94 
     95 .include <bsd.prog.mk>
     96 .include <bsd.klinks.mk>
     97