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