Home | History | Annotate | Line # | Download | only in stand
Makefile.booters revision 1.63.14.1
      1  1.63.14.1  christos # $NetBSD: Makefile.booters,v 1.63.14.1 2019/06/10 22:06:37 christos Exp $
      2       1.54     joerg 
      3       1.54     joerg NOMAN=		# defined
      4       1.62  christos NOPIE=		# defined
      5       1.42     lukem 
      6       1.53     joerg .include <bsd.own.mk>
      7        1.5    mellon 
      8       1.27    simonb # $S must correspond to the top of the 'sys' tree
      9       1.27    simonb S=	${.CURDIR}/../../../..
     10       1.27    simonb 
     11       1.27    simonb BINMODE?=	444
     12       1.41    simonb 
     13       1.41    simonb # XXX SHOULD NOT NEED TO DEFINE THESE!
     14       1.41    simonb LIBCRT0=
     15       1.59   tsutsui LIBCRTI=
     16       1.41    simonb LIBC=
     17       1.41    simonb LIBCRTBEGIN=
     18       1.41    simonb LIBCRTEND=
     19       1.34  gmcgarry 
     20       1.27    simonb .PATH:		${.CURDIR}/../common
     21       1.40  jdolecek AFLAGS+=	-D_LOCORE -D_KERNEL -mno-abicalls
     22       1.27    simonb # -I${.CURDIR}/../.. done by Makefile.inc
     23       1.32    simonb CPPFLAGS+=	-nostdinc -D_STANDALONE -DNO_ABICALLS -D_NO_PROM_DEFINES \
     24       1.32    simonb 		-I${.OBJDIR} -I${S}
     25       1.27    simonb # compiler flags for smallest code size
     26       1.39  jdolecek CFLAGS=		-ffreestanding -Os -g -mmemcpy -mno-abicalls -G 128
     27       1.58     joerg CFLAGS+=	-fno-unwind-tables
     28       1.47   tsutsui CFLAGS+=	-Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
     29       1.47   tsutsui CFLAGS+=	-Werror
     30       1.32    simonb LDBUG=		-T $S/arch/mips/conf/stand.ldscript
     31       1.27    simonb 
     32       1.56      matt .if ${MACHINE_ARCH} == "mips64el"
     33       1.56      matt AFLAGS+=	-mips3 -mabi=32
     34       1.56      matt CFLAGS+=	-mips3 -mabi=32
     35       1.56      matt LDBUG+=		-m elf32ltsmip
     36       1.56      matt .endif
     37       1.56      matt 
     38       1.42     lukem NETBSD_VERS!=	${HOST_SH} ${.CURDIR}/../../../../conf/osrelease.sh
     39       1.27    simonb CPPFLAGS+=	-DNETBSD_VERS='"${NETBSD_VERS}"'
     40       1.27    simonb 
     41       1.27    simonb PRIMARY_LOAD_ADDRESS?=	0x80700000
     42       1.27    simonb SECONDARY_LOAD_ADDRESS?=0x80710000
     43       1.37  jdolecek 
     44       1.27    simonb .if defined(PRIMARY_PROG)
     45       1.27    simonb PROG=		${PRIMARY_PROG}
     46       1.27    simonb SRCS =		start.S bootxx.c callvec.c
     47       1.27    simonb SRCS+=		devopen.c conf.c rz.c
     48       1.27    simonb SRCS+=		bootinit.S bootread.S clear_cache.S printf.S
     49       1.27    simonb 
     50       1.27    simonb LOAD_ADDRESS=	${PRIMARY_LOAD_ADDRESS}
     51       1.27    simonb # Pick a number, any number...
     52       1.27    simonb PRIMARY_MAX_TOTAL!=	expr 16 \* 1024
     53       1.27    simonb 
     54       1.27    simonb CPPFLAGS+=	-DPRIMARY_BOOTBLOCK \
     55       1.27    simonb 		-DPRIMARY_LOAD_ADDRESS="${PRIMARY_LOAD_ADDRESS}" \
     56       1.27    simonb 		-DNO_GETCHAR \
     57       1.27    simonb 		-DLIBSA_NO_FS_SYMLINK -DLIBSA_NO_FS_WRITE \
     58       1.27    simonb 		-DLIBSA_NO_FS_CLOSE \
     59       1.27    simonb 		-DLIBSA_NO_DEV_CLOSE \
     60       1.48        he 		-DLIBSA_NO_DEV_IOCTL \
     61       1.27    simonb 		-DLIBSA_SINGLE_DEVICE=rz \
     62       1.27    simonb 		-D"rzioctl(x,y,z)=EINVAL" -D"rzclose(f)=0" \
     63       1.27    simonb 		-DLIBSA_NO_TWIDDLE \
     64       1.27    simonb 		-DLIBSA_NO_FD_CHECKING \
     65       1.27    simonb 		-DLIBSA_NO_RAW_ACCESS \
     66       1.27    simonb 		-DLIBSA_NO_DISKLABEL_MSGS \
     67       1.49   tsutsui 		-DALLOC_FIRST_FIT
     68       1.27    simonb 
     69       1.42     lukem CHECKSIZE_CMD?=	SIZE=${SIZE} ${HOST_SH} ${.CURDIR}/../common/checksize.sh
     70       1.27    simonb 
     71       1.27    simonb .elif defined(SECONDARY_PROG)
     72       1.27    simonb PROG=		${SECONDARY_PROG}
     73       1.27    simonb LOAD_ADDRESS=	${SECONDARY_LOAD_ADDRESS}
     74       1.27    simonb CPPFLAGS+=	-DSECONDARY_BOOTBLOCK
     75       1.63  christos 
     76       1.63  christos .include "${S}/conf/newvers_stand.mk"
     77       1.63  christos 
     78       1.27    simonb .else
     79       1.27    simonb # XXX ?
     80       1.27    simonb .endif
     81       1.18    simonb 
     82       1.27    simonb ### find out what to use for libkern
     83       1.27    simonb KERN_AS=	library
     84       1.27    simonb .include "${S}/lib/libkern/Makefile.inc"
     85       1.27    simonb LIBKERN=	${KERNLIB}
     86       1.18    simonb 
     87       1.18    simonb ### find out what to use for libz
     88       1.27    simonb .if defined(PRIMARY_PROG)
     89       1.27    simonb LIBZ=
     90       1.27    simonb .else
     91       1.18    simonb Z_AS=		library
     92       1.18    simonb .include "${S}/lib/libz/Makefile.inc"
     93       1.18    simonb LIBZ=		${ZLIB}
     94       1.27    simonb .endif
     95       1.18    simonb 
     96       1.27    simonb ### find out what to use for libsa
     97       1.27    simonb SA_AS=		library
     98       1.27    simonb .if defined(PRIMARY_PROG)
     99       1.27    simonb SAMISCMAKEFLAGS+=SA_INCLUDE_NET=no
    100       1.27    simonb .endif
    101       1.27    simonb .if defined(SECONDARY_PROG)
    102       1.27    simonb SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes
    103       1.33  gmcgarry SAMISCMAKEFLAGS+=SA_INCLUDE_NET=yes
    104       1.22    simonb .endif
    105       1.27    simonb .include "${S}/lib/libsa/Makefile.inc"
    106       1.27    simonb LIBSA=		${SALIB}
    107       1.18    simonb 
    108       1.27    simonb LIBS=		${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN}
    109       1.36  gmcgarry 
    110       1.50   tsutsui ${PROG}: ${OBJS} ${LIBS}
    111       1.45    simonb 	${LD} -Map ${PROG}.map -N -x -Ttext ${LOAD_ADDRESS} \
    112       1.32    simonb 	    ${LDBUG} -e start -o ${PROG} ${OBJS} ${LIBS}
    113       1.27    simonb 	@${SIZE} ${PROG}
    114       1.27    simonb .if defined(CHECKSIZE_CMD)
    115       1.27    simonb 	@${CHECKSIZE_CMD} ${PROG} ${PRIMARY_MAX_LOAD} ${PRIMARY_MAX_TOTAL} || \
    116       1.27    simonb 	    (rm -f ${PROG} ; false)
    117       1.33  gmcgarry .endif
    118       1.33  gmcgarry .if defined(DO_ECOFF_BINARY)
    119       1.33  gmcgarry 	@echo -n "Creating ECOFF binary... "
    120       1.33  gmcgarry 	@mv ${PROG} ${PROG}.elf
    121  1.63.14.1  christos 	@${MIPS_ELF2ECOFF} ${PROG}.elf ${PROG}
    122       1.27    simonb .endif
    123       1.18    simonb 
    124       1.50   tsutsui .include <bsd.klinks.mk>
    125       1.31   tsutsui .include <bsd.prog.mk>
    126       1.31   tsutsui 
    127       1.51   tsutsui CLEANFILES+=	${PROG}.map ${PROG}.elf
    128       1.20    simonb 
    129       1.52  dholland cleandir distclean: .WAIT cleanlibdir
    130       1.20    simonb 
    131       1.20    simonb cleanlibdir:
    132       1.44       jmc 	-rm -rf lib
    133