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