Home | History | Annotate | Line # | Download | only in boot
Makefile revision 1.2.20.1
      1 #	$NetBSD: Makefile,v 1.2.20.1 2014/08/20 00:03:14 tls 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 SRCS+=		vers.c
     16 
     17 CLEANFILES+=	vers.c ${PROG}
     18 
     19 #MMEYE_CPU=	SH3
     20 MMEYE_CPU=	SH4
     21 
     22 .if ${MMEYE_CPU} == "SH3"
     23 AFLAGS+=	-DSH3
     24 CPPFLAGS+=	-DSH3
     25 CPPFLAGS+=	-DCONS_COM
     26 RELOC=		8c800000
     27 .endif
     28 .if ${MMEYE_CPU} == "SH4"
     29 CLEANFILES+=	${PROG}.bin ${PROG}.bin.gz
     30 AFLAGS+=	-DSH4
     31 CPPFLAGS+=	-DSH4
     32 CPPFLAGS+=	-DCONS_SCIF
     33 RELOC=		89000000
     34 .endif
     35 
     36 
     37 AFLAGS+=	-D_LOCORE -D_KERNEL
     38 CFLAGS+=	-ffreestanding
     39 CFLAGS+=	-Wall -Werror -Wno-main
     40 CFLAGS+=	-Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
     41 CFLAGS+=	-Wno-pointer-sign
     42 CPPFLAGS+=	-nostdinc -D_STANDALONE -I. -I${.OBJDIR} -I${S}
     43 DBG=		-Os
     44 
     45 NETBSD_VERS!=	${HOST_SH} ${S}/conf/osrelease.sh
     46 CPPFLAGS+=	-DNETBSD_VERS='"${NETBSD_VERS}"'
     47 
     48 # XXX SHOULD NOT NEED TO DEFINE THESE!
     49 LIBCRT0=
     50 LIBCRTI=
     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