Makefile.bootprogs revision 1.21
11.21Sthorpej# $NetBSD: Makefile.bootprogs,v 1.21 2002/01/05 01:22:21 thorpej Exp $ 21.1Sthorpej 31.1SthorpejS= ${.CURDIR}/../../../.. 41.1Sthorpej 51.1Sthorpej.PATH: ${.CURDIR}/../common 61.1Sthorpej 71.1SthorpejSTRIPFLAG= 81.1SthorpejBINMODE= 444 91.1Sthorpej 101.17StsutsuiSTRIP?= 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.16Smycroftrealall: 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.21SthorpejCFLAGS= -ffreestanding -mno-fp-regs -g 331.12Scgd 341.12ScgdNETBSD_VERS!=sh ${.CURDIR}/../../../../conf/osrelease.sh 351.12ScgdCPPFLAGS+= -DNETBSD_VERS='"${NETBSD_VERS}"' 361.10Scgd 371.10ScgdCWARNFLAGS+= -Wno-main 381.18Sjdolecek 391.18Sjdolecek# if there is a 'version' file, add rule for vers.c and add it to SRCS 401.18Sjdolecek# and CLEANFILES 411.18Sjdolecek.if exists(version) 421.18Sjdolecek.PHONY: vers.c 431.18Sjdolecekvers.c: version 441.18Sjdolecek sh ${S}/conf/newvers_stand.sh -N ${.CURDIR}/version "alpha" 451.18Sjdolecek 461.18SjdolecekSRCS+= vers.c 471.18SjdolecekCLEANFILES+= vers.c 481.10Scgd.endif 491.1Sthorpej 501.1Sthorpej# For descriptions of regions available to bootstrap programs, see 511.1Sthorpej# section 3.4.1.2 (pp. III 3-14 - III 3-18) of the second edition of 521.1Sthorpej# the Alpha AXP Architecture Reference Manual. 531.1Sthorpej 541.8ScgdREGION1_START= 0x20000000 # "Region 1 start" 551.8ScgdREGION1_SIZE!= expr 256 \* 1024 # 256k 561.8Scgd 571.8Scgd# our memory lauout: 581.8Scgd 591.8Scgd# 'unified' boot loaders (e.g. netboot) can consume all of region 601.8Scgd# 1 for their text+data, or text+data+bss. 611.8Scgd 621.8ScgdUNIFIED_LOAD_ADDRESS= ${REGION1_START} 631.8ScgdUNIFIED_MAX_LOAD!= expr ${REGION1_SIZE} 641.8ScgdUNIFIED_MAX_TOTAL!= expr ${REGION1_SIZE} 651.8Scgd 661.8Scgd#UNIFIED_HEAP_START= right after secondary bss 671.8ScgdUNIFIED_HEAP_LIMIT= (${REGION1_START} + ${REGION1_SIZE}) 681.8Scgd 691.8Scgd# two-stage boot loaders must share region 1. The first stage 701.8Scgd# loads into the lowest portion, and uses the higest portion 711.8Scgd# for its heap. The second stage loads in between the primary image 721.8Scgd# and the heap, and can reuse the memory after it (i.e. the primary's 731.8Scgd# heap) for its own heap. 741.8Scgd 751.8ScgdPRIMARY_LOAD_ADDRESS= ${REGION1_START} 761.8Scgd#PRIMARY_MAX_LOAD= booter dependent, no more than ${PRIMARY_MAX_TOTAL} 771.8ScgdPRIMARY_MAX_TOTAL!= expr 16 \* 1024 781.8Scgd 791.8Scgd# XXX SECONDARY_LOAD_ADDRESS should be 801.8Scgd# XXX (${PRIMARY_LOAD_ADDRESS} + ${PRIMARY_MAX_TOTAL}) bt there's no easy 811.8Scgd# XXX way to do that calculation and 'ld' wants a single number. 821.8ScgdSECONDARY_LOAD_ADDRESS= 0x20004000 # XXX 831.8ScgdSECONDARY_MAX_LOAD!= expr 112 \* 1024 841.8ScgdSECONDARY_MAX_TOTAL!= expr ${REGION1_SIZE} - ${PRIMARY_MAX_TOTAL} 851.8Scgd 861.8ScgdPRIMARY_HEAP_START= (${SECONDARY_LOAD_ADDRESS} + ${SECONDARY_MAX_LOAD}) 871.8ScgdPRIMARY_HEAP_LIMIT= (${REGION1_START} + ${REGION1_SIZE}) 881.8Scgd 891.8Scgd#SECONDARY_HEAP_START= right after secondary bss 901.8ScgdSECONDARY_HEAP_LIMIT= (${REGION1_START} + ${REGION1_SIZE}) 911.1Sthorpej 921.13Scgd# standalone programs are like kernels. They load at 931.13Scgd# 0xfffffc0000300000 and can use the rest of memory. 941.13Scgd 951.13ScgdSTANDPROG_LOAD_ADDRESS= 0xfffffc0000300000 961.13Scgd 971.13Scgd 981.19SthorpejFILE_FORMAT_CPPFLAGS= -DBOOT_ECOFF -DBOOT_ELF64 991.1Sthorpej 1001.8ScgdUNIFIED_CPPFLAGS= -DUNIFIED_BOOTBLOCK \ 1011.8Scgd -DHEAP_LIMIT="${UNIFIED_HEAP_LIMIT}" \ 1021.9Sross ${FILE_FORMAT_CPPFLAGS} 1031.8Scgd 1041.8ScgdPRIMARY_CPPFLAGS= -DPRIMARY_BOOTBLOCK \ 1051.8Scgd -DSECONDARY_LOAD_ADDRESS="${SECONDARY_LOAD_ADDRESS}" \ 1061.8Scgd -DSECONDARY_MAX_LOAD="${SECONDARY_MAX_LOAD}" \ 1071.8Scgd -DHEAP_LIMIT="${PRIMARY_HEAP_LIMIT}" \ 1081.8Scgd -DHEAP_START="${PRIMARY_HEAP_START}" 1091.8Scgd 1101.8ScgdSECONDARY_CPPFLAGS= -DSECONDARY_BOOTBLOCK \ 1111.8Scgd -DHEAP_LIMIT="${SECONDARY_HEAP_LIMIT}" \ 1121.9Sross ${FILE_FORMAT_CPPFLAGS} 1131.13Scgd 1141.13ScgdSTANDPROG_CPPFLAGS= -DSTANDALONE_PROGRAM 1151.8Scgd 1161.1Sthorpej.include <bsd.prog.mk> 1171.20Slukem 1181.20SlukemCOPTS+=-Os # override -O supplied by user 1191.1Sthorpej 1201.1Sthorpej### find out what to use for libkern 1211.1SthorpejKERN_AS= library 1221.1Sthorpej.include "${S}/lib/libkern/Makefile.inc" 1231.1SthorpejLIBKERN= ${KERNLIB} 1241.1Sthorpej 1251.1Sthorpej### find out what to use for libz 1261.1SthorpejZ_AS= library 1271.1Sthorpej.include "${S}/lib/libz/Makefile.inc" 1281.1SthorpejLIBZ= ${ZLIB} 1291.1Sthorpej 1301.1Sthorpej### find out what to use for libsa 1311.1SthorpejSA_AS= library 1321.14SrossSAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes" 1331.1Sthorpej.include "${S}/lib/libsa/Makefile.inc" 1341.1SthorpejLIBSA= ${SALIB} 135