Makefile.bootprogs revision 1.14
11.14Sross# $NetBSD: Makefile.bootprogs,v 1.14 1999/09/10 07:31:16 ross Exp $ 21.1Sthorpej 31.1SthorpejS= ${.CURDIR}/../../../.. 41.1Sthorpej 51.1Sthorpej.PATH: ${.CURDIR}/../common 61.1Sthorpej 71.1SthorpejSTRIPFLAG= 81.1SthorpejBINMODE= 444 91.1Sthorpej 101.1SthorpejSTRIP?= strip 111.11Scgd 121.11Scgd# XXX Can't do warnings yet. 131.11ScgdWARNS= 0 141.1Sthorpej 151.8ScgdCHECKSIZE_CMD= SIZE=${SIZE} sh ${.CURDIR}/../common/checksize.sh 161.8Scgd 171.1Sthorpej.PHONY: machine-links 181.1Sthorpejbeforedepend: machine-links 191.1Sthorpej# ${MACHINE} then ${MACHINE_ARCH} 201.1Sthorpejmachine-links: 211.1Sthorpej -rm -f machine && \ 221.1Sthorpej ln -s $S/arch/alpha/include machine 231.1Sthorpej -rm -f alpha && \ 241.1Sthorpej ln -s $S/arch/alpha/include alpha 251.1SthorpejCLEANFILES+=machine alpha 261.1Sthorpej 271.1Sthorpejall: machine-links ${PROG} 281.1Sthorpej 291.10ScgdAFLAGS+= -DASSEMBLER 301.10Scgd# -I${.CURDIR}/../.. done by Makefile.inc 311.10ScgdCPPFLAGS+= -nostdinc -I${.OBJDIR} -D_STANDALONE -I${S} 321.10ScgdCFLAGS= -Os -mno-fp-regs -g 331.12Scgd 341.12ScgdNETBSD_VERS!=sh ${.CURDIR}/../../../../conf/osrelease.sh 351.12ScgdCPPFLAGS+= -DNETBSD_VERS='"${NETBSD_VERS}"' 361.10Scgd 371.10ScgdHAVE_GCC28!= ${CC} --version | egrep "^(2\.8|egcs)" ; echo 381.10Scgd.if (${HAVE_GCC28} != "") 391.10ScgdCWARNFLAGS+= -Wno-main 401.10Scgd.endif 411.1Sthorpej 421.1Sthorpej# For descriptions of regions available to bootstrap programs, see 431.1Sthorpej# section 3.4.1.2 (pp. III 3-14 - III 3-18) of the second edition of 441.1Sthorpej# the Alpha AXP Architecture Reference Manual. 451.1Sthorpej 461.8ScgdREGION1_START= 0x20000000 # "Region 1 start" 471.8ScgdREGION1_SIZE!= expr 256 \* 1024 # 256k 481.8Scgd 491.8Scgd# our memory lauout: 501.8Scgd 511.8Scgd# 'unified' boot loaders (e.g. netboot) can consume all of region 521.8Scgd# 1 for their text+data, or text+data+bss. 531.8Scgd 541.8ScgdUNIFIED_LOAD_ADDRESS= ${REGION1_START} 551.8ScgdUNIFIED_MAX_LOAD!= expr ${REGION1_SIZE} 561.8ScgdUNIFIED_MAX_TOTAL!= expr ${REGION1_SIZE} 571.8Scgd 581.8Scgd#UNIFIED_HEAP_START= right after secondary bss 591.8ScgdUNIFIED_HEAP_LIMIT= (${REGION1_START} + ${REGION1_SIZE}) 601.8Scgd 611.8Scgd# two-stage boot loaders must share region 1. The first stage 621.8Scgd# loads into the lowest portion, and uses the higest portion 631.8Scgd# for its heap. The second stage loads in between the primary image 641.8Scgd# and the heap, and can reuse the memory after it (i.e. the primary's 651.8Scgd# heap) for its own heap. 661.8Scgd 671.8ScgdPRIMARY_LOAD_ADDRESS= ${REGION1_START} 681.8Scgd#PRIMARY_MAX_LOAD= booter dependent, no more than ${PRIMARY_MAX_TOTAL} 691.8ScgdPRIMARY_MAX_TOTAL!= expr 16 \* 1024 701.8Scgd 711.8Scgd# XXX SECONDARY_LOAD_ADDRESS should be 721.8Scgd# XXX (${PRIMARY_LOAD_ADDRESS} + ${PRIMARY_MAX_TOTAL}) bt there's no easy 731.8Scgd# XXX way to do that calculation and 'ld' wants a single number. 741.8ScgdSECONDARY_LOAD_ADDRESS= 0x20004000 # XXX 751.8ScgdSECONDARY_MAX_LOAD!= expr 112 \* 1024 761.8ScgdSECONDARY_MAX_TOTAL!= expr ${REGION1_SIZE} - ${PRIMARY_MAX_TOTAL} 771.8Scgd 781.8ScgdPRIMARY_HEAP_START= (${SECONDARY_LOAD_ADDRESS} + ${SECONDARY_MAX_LOAD}) 791.8ScgdPRIMARY_HEAP_LIMIT= (${REGION1_START} + ${REGION1_SIZE}) 801.8Scgd 811.8Scgd#SECONDARY_HEAP_START= right after secondary bss 821.8ScgdSECONDARY_HEAP_LIMIT= (${REGION1_START} + ${REGION1_SIZE}) 831.1Sthorpej 841.13Scgd# standalone programs are like kernels. They load at 851.13Scgd# 0xfffffc0000300000 and can use the rest of memory. 861.13Scgd 871.13ScgdSTANDPROG_LOAD_ADDRESS= 0xfffffc0000300000 881.13Scgd 891.13Scgd 901.14SrossFILE_FORMAT_CPPFLAGS= -DBOOT_ECOFF -DBOOT_ELF 911.1Sthorpej 921.8ScgdUNIFIED_CPPFLAGS= -DUNIFIED_BOOTBLOCK \ 931.8Scgd -DHEAP_LIMIT="${UNIFIED_HEAP_LIMIT}" \ 941.9Sross ${FILE_FORMAT_CPPFLAGS} 951.8Scgd 961.8ScgdPRIMARY_CPPFLAGS= -DPRIMARY_BOOTBLOCK \ 971.8Scgd -DSECONDARY_LOAD_ADDRESS="${SECONDARY_LOAD_ADDRESS}" \ 981.8Scgd -DSECONDARY_MAX_LOAD="${SECONDARY_MAX_LOAD}" \ 991.8Scgd -DHEAP_LIMIT="${PRIMARY_HEAP_LIMIT}" \ 1001.8Scgd -DHEAP_START="${PRIMARY_HEAP_START}" 1011.8Scgd 1021.8ScgdSECONDARY_CPPFLAGS= -DSECONDARY_BOOTBLOCK \ 1031.8Scgd -DHEAP_LIMIT="${SECONDARY_HEAP_LIMIT}" \ 1041.9Sross ${FILE_FORMAT_CPPFLAGS} 1051.13Scgd 1061.13ScgdSTANDPROG_CPPFLAGS= -DSTANDALONE_PROGRAM 1071.8Scgd 1081.1Sthorpej.include <bsd.prog.mk> 1091.1Sthorpej 1101.1Sthorpej### find out what to use for libkern 1111.1SthorpejKERN_AS= library 1121.1Sthorpej.include "${S}/lib/libkern/Makefile.inc" 1131.1SthorpejLIBKERN= ${KERNLIB} 1141.1Sthorpej 1151.1Sthorpej### find out what to use for libz 1161.1SthorpejZ_AS= library 1171.1Sthorpej.include "${S}/lib/libz/Makefile.inc" 1181.1SthorpejLIBZ= ${ZLIB} 1191.1Sthorpej 1201.1Sthorpej### find out what to use for libsa 1211.1SthorpejSA_AS= library 1221.14SrossSAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes" 1231.1Sthorpej.include "${S}/lib/libsa/Makefile.inc" 1241.1SthorpejLIBSA= ${SALIB} 125