Home | History | Annotate | Line # | Download | only in boot
      1 # $NetBSD: Makefile,v 1.19 2024/06/29 08:02:06 rin Exp $
      2 
      3 .include <bsd.init.mk>
      4 
      5 S!= cd ${.CURDIR}/../../../..; pwd
      6 
      7 PROG= boot
      8 MKMAN= no		# defined
      9 STRIPFLAG=
     10 BINMODE= 444
     11 
     12 NETBSD_VERS!=	${HOST_SH} ${S}/conf/osrelease.sh
     13 
     14 .PATH:		${S}/dev/arcbios
     15 
     16 SRCS=	start.S arcbios_calls.S
     17 SRCS+=	boot.c bootinfo.c conf.c devopen.c disk.c getchar.c putchar.c
     18 
     19 .include "${S}/dev/arcbios/Makefile.inc"
     20 
     21 # XXX SHOULD NOT NEED TO DEFINE THESE!
     22 LIBCRT0=
     23 LIBCRTI=
     24 LIBC=
     25 LIBCRTBEGIN=
     26 LIBCRTEND=
     27 
     28 AFLAGS=    -x assembler-with-cpp -mno-abicalls -mips2 -mabi=32
     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 LD+=		-m elf32ltsmip
     40 
     41 ### find out what to use for libsa
     42 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
     43 .include "${S}/lib/libsa/Makefile.inc"
     44 LIBSA=   ${SALIB}
     45 
     46 ### find out what to use for libkern
     47 .include "${S}/lib/libkern/Makefile.inc"
     48 LIBKERN= ${KERNLIB}
     49 
     50 ### find out what to use for libz
     51 .include "${S}/lib/libz/Makefile.inc"
     52 LIBZ=    ${ZLIB}
     53 
     54 LIBS=  ${LIBSA} ${LIBKERN} ${LIBZ}
     55 
     56 cleandir distclean: .WAIT cleanlibdir
     57 cleanlibdir:
     58 	-rm -rf lib
     59 
     60 ${PROG}: ${OBJS} ${LIBS}
     61 	${LD} -Map ${PROG}.map -N -x -Ttext ${TEXTADDR} -T ${LDSCRIPT} \
     62 	    -e start -o ${PROG}.elf ${OBJS} ${LIBS}
     63 	@${SIZE} ${PROG}.elf
     64 	${OBJCOPY} --impure -O ecoff-littlemips \
     65 	    -R .pdr -R .mdebug.abi32 -R .comment -R .ident --strip-debug \
     66 	    ${PROG}.elf ${.TARGET}
     67 
     68 CLEANFILES+=	${PROG}.elf ${PROG}.map
     69 
     70 .include "${S}/conf/newvers_stand.mk"
     71 
     72 .include <bsd.klinks.mk>
     73 .include <bsd.prog.mk>
     74