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