Makefile.bootprogs revision 1.30
11.30Stsutsui# $NetBSD: Makefile.bootprogs,v 1.30 2009/04/20 13:15:12 tsutsui Exp $ 21.24Slukem 31.24Slukem.include <bsd.sys.mk> # for HOST_SH 41.1Sthorpej 51.1SthorpejS= ${.CURDIR}/../../../.. 61.1Sthorpej 71.1Sthorpej.PATH: ${.CURDIR}/../common 81.1Sthorpej 91.1SthorpejBINMODE= 444 101.1Sthorpej 111.17StsutsuiSTRIP?= strip 121.23Ssimonb 131.23Ssimonb# XXX SHOULD NOT NEED TO DEFINE THESE! 141.23SsimonbLIBCRT0= 151.23SsimonbLIBC= 161.23SsimonbLIBCRTBEGIN= 171.23SsimonbLIBCRTEND= 181.1Sthorpej 191.24SlukemCHECKSIZE_CMD= SIZE=${SIZE} ${HOST_SH} ${.CURDIR}/../common/checksize.sh 201.8Scgd 211.29Stsutsuirealall: ${PROG} 221.1Sthorpej 231.10ScgdAFLAGS+= -DASSEMBLER 241.10Scgd# -I${.CURDIR}/../.. done by Makefile.inc 251.10ScgdCPPFLAGS+= -nostdinc -I${.OBJDIR} -D_STANDALONE -I${S} 261.21SthorpejCFLAGS= -ffreestanding -mno-fp-regs -g 271.12Scgd 281.24SlukemNETBSD_VERS!=${HOST_SH} ${.CURDIR}/../../../../conf/osrelease.sh 291.12ScgdCPPFLAGS+= -DNETBSD_VERS='"${NETBSD_VERS}"' 301.10Scgd 311.28StsutsuiCWARNFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith 321.28StsutsuiCFLAGS+= -Werror ${CWARNFLAGS} 331.18Sjdolecek 341.18Sjdolecek# if there is a 'version' file, add rule for vers.c and add it to SRCS 351.18Sjdolecek# and CLEANFILES 361.18Sjdolecek.if exists(version) 371.18Sjdolecek.PHONY: vers.c 381.18Sjdolecekvers.c: version 391.24Slukem ${HOST_SH} ${S}/conf/newvers_stand.sh -N ${.CURDIR}/version "alpha" 401.18Sjdolecek 411.18SjdolecekSRCS+= vers.c 421.18SjdolecekCLEANFILES+= vers.c 431.10Scgd.endif 441.1Sthorpej 451.1Sthorpej# For descriptions of regions available to bootstrap programs, see 461.1Sthorpej# section 3.4.1.2 (pp. III 3-14 - III 3-18) of the second edition of 471.1Sthorpej# the Alpha AXP Architecture Reference Manual. 481.1Sthorpej 491.8ScgdREGION1_START= 0x20000000 # "Region 1 start" 501.8ScgdREGION1_SIZE!= expr 256 \* 1024 # 256k 511.8Scgd 521.8Scgd# our memory lauout: 531.8Scgd 541.8Scgd# 'unified' boot loaders (e.g. netboot) can consume all of region 551.8Scgd# 1 for their text+data, or text+data+bss. 561.8Scgd 571.8ScgdUNIFIED_LOAD_ADDRESS= ${REGION1_START} 581.8ScgdUNIFIED_MAX_LOAD!= expr ${REGION1_SIZE} 591.8ScgdUNIFIED_MAX_TOTAL!= expr ${REGION1_SIZE} 601.8Scgd 611.8Scgd#UNIFIED_HEAP_START= right after secondary bss 621.8ScgdUNIFIED_HEAP_LIMIT= (${REGION1_START} + ${REGION1_SIZE}) 631.8Scgd 641.8Scgd# two-stage boot loaders must share region 1. The first stage 651.8Scgd# loads into the lowest portion, and uses the higest portion 661.8Scgd# for its heap. The second stage loads in between the primary image 671.8Scgd# and the heap, and can reuse the memory after it (i.e. the primary's 681.8Scgd# heap) for its own heap. 691.8Scgd 701.8ScgdPRIMARY_LOAD_ADDRESS= ${REGION1_START} 711.8Scgd#PRIMARY_MAX_LOAD= booter dependent, no more than ${PRIMARY_MAX_TOTAL} 721.8ScgdPRIMARY_MAX_TOTAL!= expr 16 \* 1024 731.8Scgd 741.8Scgd# XXX SECONDARY_LOAD_ADDRESS should be 751.8Scgd# XXX (${PRIMARY_LOAD_ADDRESS} + ${PRIMARY_MAX_TOTAL}) bt there's no easy 761.8Scgd# XXX way to do that calculation and 'ld' wants a single number. 771.8ScgdSECONDARY_LOAD_ADDRESS= 0x20004000 # XXX 781.8ScgdSECONDARY_MAX_LOAD!= expr 112 \* 1024 791.8ScgdSECONDARY_MAX_TOTAL!= expr ${REGION1_SIZE} - ${PRIMARY_MAX_TOTAL} 801.8Scgd 811.8ScgdPRIMARY_HEAP_START= (${SECONDARY_LOAD_ADDRESS} + ${SECONDARY_MAX_LOAD}) 821.8ScgdPRIMARY_HEAP_LIMIT= (${REGION1_START} + ${REGION1_SIZE}) 831.8Scgd 841.8Scgd#SECONDARY_HEAP_START= right after secondary bss 851.8ScgdSECONDARY_HEAP_LIMIT= (${REGION1_START} + ${REGION1_SIZE}) 861.1Sthorpej 871.13Scgd# standalone programs are like kernels. They load at 881.13Scgd# 0xfffffc0000300000 and can use the rest of memory. 891.13Scgd 901.13ScgdSTANDPROG_LOAD_ADDRESS= 0xfffffc0000300000 911.13Scgd 921.13Scgd 931.19SthorpejFILE_FORMAT_CPPFLAGS= -DBOOT_ECOFF -DBOOT_ELF64 941.1Sthorpej 951.8ScgdUNIFIED_CPPFLAGS= -DUNIFIED_BOOTBLOCK \ 961.8Scgd -DHEAP_LIMIT="${UNIFIED_HEAP_LIMIT}" \ 971.9Sross ${FILE_FORMAT_CPPFLAGS} 981.8Scgd 991.8ScgdPRIMARY_CPPFLAGS= -DPRIMARY_BOOTBLOCK \ 1001.8Scgd -DSECONDARY_LOAD_ADDRESS="${SECONDARY_LOAD_ADDRESS}" \ 1011.8Scgd -DSECONDARY_MAX_LOAD="${SECONDARY_MAX_LOAD}" \ 1021.8Scgd -DHEAP_LIMIT="${PRIMARY_HEAP_LIMIT}" \ 1031.8Scgd -DHEAP_START="${PRIMARY_HEAP_START}" 1041.8Scgd 1051.8ScgdSECONDARY_CPPFLAGS= -DSECONDARY_BOOTBLOCK \ 1061.8Scgd -DHEAP_LIMIT="${SECONDARY_HEAP_LIMIT}" \ 1071.9Sross ${FILE_FORMAT_CPPFLAGS} 1081.13Scgd 1091.13ScgdSTANDPROG_CPPFLAGS= -DSTANDALONE_PROGRAM 1101.8Scgd 1111.1Sthorpej.include <bsd.prog.mk> 1121.29Stsutsui.include <bsd.klinks.mk> 1131.20Slukem 1141.30StsutsuiSTRIPFLAG= # override values in ${MAKECONF} 1151.20SlukemCOPTS+=-Os # override -O supplied by user 1161.1Sthorpej 1171.1Sthorpej### find out what to use for libkern 1181.1SthorpejKERN_AS= library 1191.1Sthorpej.include "${S}/lib/libkern/Makefile.inc" 1201.1SthorpejLIBKERN= ${KERNLIB} 1211.1Sthorpej 1221.1Sthorpej### find out what to use for libz 1231.1SthorpejZ_AS= library 1241.1Sthorpej.include "${S}/lib/libz/Makefile.inc" 1251.1SthorpejLIBZ= ${ZLIB} 1261.1Sthorpej 1271.1Sthorpej### find out what to use for libsa 1281.1SthorpejSA_AS= library 1291.26SsimonbSAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes 1301.1Sthorpej.include "${S}/lib/libsa/Makefile.inc" 1311.1SthorpejLIBSA= ${SALIB} 132