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