Home | History | Annotate | Line # | Download | only in stand
Makefile.bootprogs revision 1.8
      1  1.8      cgd # $NetBSD: Makefile.bootprogs,v 1.8 1999/04/02 03:11:57 cgd Exp $
      2  1.1  thorpej 
      3  1.1  thorpej S=	${.CURDIR}/../../../..
      4  1.1  thorpej 
      5  1.1  thorpej .PATH:	${.CURDIR}/../common
      6  1.1  thorpej 
      7  1.4    lukem MKMAN=	no
      8  1.1  thorpej STRIPFLAG=
      9  1.1  thorpej BINMODE= 444
     10  1.1  thorpej 
     11  1.1  thorpej STRIP?=	strip
     12  1.1  thorpej 
     13  1.8      cgd CHECKSIZE_CMD=	SIZE=${SIZE} sh ${.CURDIR}/../common/checksize.sh
     14  1.8      cgd 
     15  1.1  thorpej .PHONY: machine-links
     16  1.1  thorpej beforedepend: machine-links
     17  1.1  thorpej # ${MACHINE} then ${MACHINE_ARCH}
     18  1.1  thorpej machine-links:
     19  1.1  thorpej 	-rm -f machine && \
     20  1.1  thorpej 	    ln -s $S/arch/alpha/include machine
     21  1.1  thorpej 	-rm -f alpha && \
     22  1.1  thorpej 	    ln -s $S/arch/alpha/include alpha
     23  1.1  thorpej CLEANFILES+=machine alpha
     24  1.1  thorpej 
     25  1.1  thorpej all: machine-links ${PROG}
     26  1.1  thorpej 
     27  1.1  thorpej AFLAGS += -DASSEMBLER
     28  1.1  thorpej #CPPFLAGS+= -nostdinc -I${.OBJDIR}
     29  1.1  thorpej CPPFLAGS+= -I${.OBJDIR}
     30  1.1  thorpej CPPFLAGS += -D_STANDALONE -I${.CURDIR}/../.. -I${S}
     31  1.8      cgd CFLAGS = ${CWARNFLAGS} -Os -mno-fp-regs -g
     32  1.1  thorpej 
     33  1.1  thorpej # For descriptions of regions available to bootstrap programs, see
     34  1.1  thorpej # section 3.4.1.2 (pp. III 3-14 - III 3-18) of the second edition of
     35  1.1  thorpej # the Alpha AXP Architecture Reference Manual.
     36  1.1  thorpej 
     37  1.8      cgd REGION1_START=		0x20000000		# "Region 1 start"
     38  1.8      cgd REGION1_SIZE!=		expr 256 \* 1024	# 256k
     39  1.8      cgd 
     40  1.8      cgd # our memory lauout:
     41  1.8      cgd 
     42  1.8      cgd #	'unified' boot loaders (e.g. netboot) can consume all of region
     43  1.8      cgd #	1 for their text+data, or text+data+bss.
     44  1.8      cgd 
     45  1.8      cgd UNIFIED_LOAD_ADDRESS=	${REGION1_START}
     46  1.8      cgd UNIFIED_MAX_LOAD!=	expr ${REGION1_SIZE}
     47  1.8      cgd UNIFIED_MAX_TOTAL!=	expr ${REGION1_SIZE}
     48  1.8      cgd 
     49  1.8      cgd #UNIFIED_HEAP_START=	right after secondary bss
     50  1.8      cgd UNIFIED_HEAP_LIMIT=	(${REGION1_START} + ${REGION1_SIZE})
     51  1.8      cgd 
     52  1.8      cgd #	two-stage boot loaders must share region 1.  The first stage
     53  1.8      cgd #	loads into the lowest portion, and uses the higest portion
     54  1.8      cgd #	for its heap.  The second stage loads in between the primary image
     55  1.8      cgd #	and the heap, and can reuse the memory after it (i.e. the primary's
     56  1.8      cgd #	heap) for its own heap.
     57  1.8      cgd 
     58  1.8      cgd PRIMARY_LOAD_ADDRESS=	${REGION1_START}
     59  1.8      cgd #PRIMARY_MAX_LOAD=	booter dependent, no more than ${PRIMARY_MAX_TOTAL}
     60  1.8      cgd PRIMARY_MAX_TOTAL!=	expr 16 \* 1024
     61  1.8      cgd 
     62  1.8      cgd # XXX SECONDARY_LOAD_ADDRESS should be
     63  1.8      cgd # XXX (${PRIMARY_LOAD_ADDRESS} + ${PRIMARY_MAX_TOTAL}) bt there's no easy
     64  1.8      cgd # XXX way to do that calculation and 'ld' wants a single number.
     65  1.8      cgd SECONDARY_LOAD_ADDRESS=	0x20004000	# XXX
     66  1.8      cgd SECONDARY_MAX_LOAD!=	expr 112 \* 1024
     67  1.8      cgd SECONDARY_MAX_TOTAL!=	expr ${REGION1_SIZE} - ${PRIMARY_MAX_TOTAL}
     68  1.8      cgd 
     69  1.8      cgd PRIMARY_HEAP_START=	(${SECONDARY_LOAD_ADDRESS} + ${SECONDARY_MAX_LOAD})
     70  1.8      cgd PRIMARY_HEAP_LIMIT=	(${REGION1_START} + ${REGION1_SIZE})
     71  1.8      cgd 
     72  1.8      cgd #SECONDARY_HEAP_START=	right after secondary bss
     73  1.8      cgd SECONDARY_HEAP_LIMIT=	(${REGION1_START} + ${REGION1_SIZE})
     74  1.1  thorpej 
     75  1.1  thorpej FILE_FORMAT_CPPFLAGS=	-DALPHA_BOOT_ECOFF -DALPHA_BOOT_ELF
     76  1.1  thorpej 
     77  1.8      cgd UNIFIED_CPPFLAGS=	-DUNIFIED_BOOTBLOCK \
     78  1.8      cgd 			-DHEAP_LIMIT="${UNIFIED_HEAP_LIMIT}" \
     79  1.8      cgd 			${FILE_FORMAT_CPP_FLAGS}
     80  1.8      cgd 
     81  1.8      cgd PRIMARY_CPPFLAGS=	-DPRIMARY_BOOTBLOCK \
     82  1.8      cgd 			-DSECONDARY_LOAD_ADDRESS="${SECONDARY_LOAD_ADDRESS}" \
     83  1.8      cgd 			-DSECONDARY_MAX_LOAD="${SECONDARY_MAX_LOAD}" \
     84  1.8      cgd 			-DHEAP_LIMIT="${PRIMARY_HEAP_LIMIT}" \
     85  1.8      cgd 			-DHEAP_START="${PRIMARY_HEAP_START}"
     86  1.8      cgd 
     87  1.8      cgd SECONDARY_CPPFLAGS=	-DSECONDARY_BOOTBLOCK \
     88  1.8      cgd 			-DHEAP_LIMIT="${SECONDARY_HEAP_LIMIT}" \
     89  1.8      cgd 			${FILE_FORMAT_CPP_FLAGS}
     90  1.8      cgd 
     91  1.1  thorpej .include <bsd.prog.mk>
     92  1.1  thorpej 
     93  1.1  thorpej ### find out what to use for libkern
     94  1.1  thorpej KERN_AS=	library
     95  1.1  thorpej .include "${S}/lib/libkern/Makefile.inc"
     96  1.1  thorpej LIBKERN=	${KERNLIB}
     97  1.1  thorpej 
     98  1.1  thorpej ### find out what to use for libz
     99  1.1  thorpej Z_AS=		library
    100  1.1  thorpej .include "${S}/lib/libz/Makefile.inc"
    101  1.1  thorpej LIBZ=		${ZLIB}
    102  1.1  thorpej 
    103  1.1  thorpej ### find out what to use for libsa
    104  1.1  thorpej SA_AS=		library
    105  1.1  thorpej .include "${S}/lib/libsa/Makefile.inc"
    106  1.1  thorpej LIBSA=		${SALIB}
    107