Home | History | Annotate | Line # | Download | only in boot
Makefile revision 1.9.2.1
      1 # $NetBSD: Makefile,v 1.9.2.1 2011/06/06 09:05:00 jruoho Exp $
      2 
      3 .include <bsd.own.mk>
      4 .include <bsd.sys.mk>	# for ${HOST_SH}
      5 
      6 S!= cd ${.CURDIR}/../../../..; pwd
      7 
      8 PROG= boot
      9 MKMAN= no		# defined
     10 STRIPFLAG=
     11 BINMODE= 444
     12 
     13 NETBSD_VERS!=	${HOST_SH} ${S}/conf/osrelease.sh
     14 
     15 .PATH:		${S}/dev/arcbios
     16 
     17 SRCS=	start.S arcbios_calls.S
     18 SRCS+=	boot.c bootinfo.c conf.c devopen.c disk.c getchar.c getopt.c putchar.c
     19 
     20 .include "${S}/dev/arcbios/Makefile.inc"
     21 
     22 # XXX SHOULD NOT NEED TO DEFINE THESE!
     23 LIBCRT0=
     24 LIBC=
     25 LIBCRTBEGIN=
     26 LIBCRTEND=
     27 
     28 AFLAGS=    -x assembler-with-cpp -mno-abicalls -mips2
     29 AFLAGS+=   -D_LOCORE -D_KERNEL
     30 CFLAGS=    -Os -mmemcpy -G 1024
     31 CFLAGS+=   -ffreestanding -mno-abicalls -msoft-float -mips2 -mabi=32
     32 CFLAGS+=   -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
     33 CPPFLAGS+= -nostdinc -I. -I${S}
     34 CPPFLAGS+= -D_STANDALONE -DNO_ABICALLS -D${MACHINE}
     35 CPPFLAGS+= -DNETBSD_VERS='"${NETBSD_VERS}"'
     36 #CPPFLAGS+= -DBOOT_DEBUG
     37 LDSCRIPT=  ${S}/arch/mips/conf/stand.ldscript
     38 TEXTADDR=  0x80f00000
     39 
     40 # if there is a 'version' file, add rule for vers.c and add it to SRCS
     41 # and CLEANFILES
     42 .if exists(version)
     43 .PHONY: vers.c
     44 vers.c: ${.CURDIR}/version
     45 	${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \
     46 	    ${.CURDIR}/version ${MACHINE}
     47 
     48 SRCS+=	vers.c
     49 CLEANFILES+= vers.c
     50 .endif
     51 
     52 ### find out what to use for libsa
     53 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
     54 .include "${S}/lib/libsa/Makefile.inc"
     55 LIBSA=   ${SALIB}
     56 
     57 ### find out what to use for libkern
     58 .include "${S}/lib/libkern/Makefile.inc"
     59 LIBKERN= ${KERNLIB}
     60 
     61 ### find out what to use for libz
     62 .include "${S}/lib/libz/Makefile.inc"
     63 LIBZ=    ${ZLIB}
     64 
     65 LIBS=  ${LIBSA} ${LIBKERN} ${LIBZ}
     66 
     67 cleandir distclean: .WAIT cleanlibdir
     68 cleanlibdir:
     69 	-rm -rf lib
     70 
     71 ${PROG}: ${OBJS} ${LIBS}
     72 	${LD} -Map ${PROG}.map -N -x -Ttext ${TEXTADDR} -T ${LDSCRIPT} \
     73 	    -e start -o ${PROG}.elf ${OBJS} ${LIBS}
     74 	@${SIZE} ${PROG}.elf
     75 	${OBJCOPY} --impure -O ecoff-littlemips \
     76 	    -R .pdr -R .mdebug.abi32 -R .comment -R .ident \
     77 	    ${PROG}.elf ${.TARGET}
     78 
     79 CLEANFILES+=	${PROG}.elf ${PROG}.map
     80 
     81 .include <bsd.klinks.mk>
     82 .include <bsd.prog.mk>
     83