Makefile revision 1.46
11.46Shauke# $NetBSD: Makefile,v 1.46 2008/05/22 19:49:43 hauke Exp $ 21.1Stsubai 31.1StsubaiS= ${.CURDIR}/../../../.. 41.1Stsubai 51.1StsubaiPROG= ofwboot 61.12SdmcmahilFILES= ${PROG}.elf ${PROG}.xcf 71.42SwrstudenSRCS= Locore.c boot.c ofdev.c hfs.c net.c netif_of.c alloc.c vers.c 81.7SwrstudenXCOFFXTRA= Xcoffxtra.c 91.7SwrstudenXCOFFXTRAOBJ= Xcoffxtra.o 101.37SmattCFLAGS+= -Wno-main -msoft-float -mmultiple -ffreestanding 111.29Stsutsui#CPPFLAGS+= -DDEBUG -DNETIF_DEBUG 121.29StsutsuiCPPFLAGS+= -D_STANDALONE -DSUPPORT_DHCP 131.31StsutsuiCPPFLAGS+= -DSUPPORT_USTARFS -DHAVE_CHANGEDISK_HOOK 141.32StsutsuiCPPFLAGS+= -DLIBSA_USE_MEMCPY -DLIBSA_USE_MEMSET 151.41SaymericDBG= -Os 161.36Sthorpej 171.36SthorpejLIBCRT0= # nothing 181.36SthorpejLIBCRTBEGIN= # nothing 191.36SthorpejLIBCRTEND= # nothing 201.36SthorpejLIBC= # nothing 211.9Stsubai 221.1Stsubai.PATH: ${S}/arch/powerpc/powerpc 231.1StsubaiSRCS+= ofwmagic.S 241.34Sitojun 251.34Sitojun.PATH: ${S}/lib/libsa 261.34SitojunSRCS+= byteorder.c 271.9Stsubai 281.24StvNOMAN= # defined 291.1StsubaiSTRIPFLAG= 301.1StsubaiBINMODE= 444 311.1Stsubai 321.7Swrstuden.if !defined(FIXCOFF) 331.23Stv.include <bsd.own.mk> 341.23Stv 351.39Smatt.if !defined(TOOL_MACPPCFIXCOFF) 361.39SmattTOOL_MACPPCFIXCOFFDIR!= cd ${.CURDIR}/../fixcoff && ${PRINTOBJDIR} 371.46ShaukeTOOL_MACPPCFIXCOFF= ${TOOL_MACPPCFIXCOFFDIR}/fixcoff 381.39Smatt.endif 391.7Swrstuden.endif 401.7Swrstuden 411.1StsubaiNEWVERSWHAT= "OpenFirmware Boot" 421.1Stsubai 431.1Stsubai# For now... 441.1Stsubai#RELOC= 20000 451.42SwrstudenRELOC= E00000 461.1Stsubai 471.1StsubaiENTRY= _start 481.1Stsubai 491.26SwrstudenCLEANFILES+= vers.c ${PROG}.elf ${PROG}.el1 ${PROG}.mrg ${PROG}.xcf 501.26SwrstudenCLEANFILES+= machine powerpc 511.1Stsubai 521.30StsutsuiCPPFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/../../.. -I${.CURDIR}/../../../.. 531.26SwrstudenCPPFLAGS+= -DRELOC=0x${RELOC} -DRELOC_FLATFILE=0x${RELOC_FLATFILE} 541.1Stsubai#CPPFLAGS+= -DXCOFF_GLUE # for booting PCI Powermacs 551.1Stsubai 561.42SwrstudenCLEANFILES+= ${XCOFFXTRAOBJ} 571.5Stsubai 581.28Sjmc.if !make(obj) && !make(clean) && !make(cleandir) 591.5Stsubai.BEGIN: 601.5Stsubai @[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine 611.5Stsubai @[ -h powerpc ] || ln -s ${S}/arch/powerpc/include powerpc 621.8Smycroft.NOPATH: machine powerpc 631.28Sjmc.endif 641.8SmycroftCLEANFILES+= machine powerpc 651.5Stsubai 661.1Stsubai### find out what to use for libkern 671.1StsubaiKERN_AS= library 681.1Stsubai.include "${S}/lib/libkern/Makefile.inc" 691.1StsubaiLIBKERN= ${KERNLIB} 701.1Stsubai 711.1Stsubai### find out what to use for libz 721.1StsubaiZ_AS= library 731.1Stsubai.include "${S}/lib/libz/Makefile.inc" 741.1StsubaiLIBZ= ${ZLIB} 751.1Stsubai 761.1Stsubai### find out what to use for libsa 771.1StsubaiSA_AS= library 781.5StsubaiSAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes 791.1Stsubai.include "${S}/lib/libsa/Makefile.inc" 801.1StsubaiLIBSA= ${SALIB} 811.33Stsutsui 821.33Stsutsuicleandir distclean: cleanlibdir 831.33Stsutsui 841.33Stsutsuicleanlibdir: 851.44Sjmc -rm -rf lib 861.1Stsubai 871.13Sjdolecek.PHONY: vers.c 881.13Sjdolecekvers.c: version 891.38Slukem ${HOST_SH} ${S}/conf/newvers_stand.sh ${.CURDIR}/version "macppc" ${NEWVERSWHAT} 901.13Sjdolecek 911.27Swrstudenall realall: ${PROG} ${PROG}.xcf ${PROG}.elf 921.26Swrstuden 931.42Swrstuden${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 941.43Smatt ${_MKTARGET_LINK} 951.42Swrstuden ${LD} -s -N -Ttext ${RELOC} -Bstatic -o ${PROG}.el1 \ 961.42Swrstuden ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 971.26Swrstuden ${OBJCOPY} -O binary ${PROG}.el1 ${PROG} 981.26Swrstuden 991.26Swrstuden.include <bsd.prog.mk> 1001.26Swrstuden 1011.42Swrstuden${PROG}.elf: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 1021.43Smatt ${_MKTARGET_LINK} 1031.7Swrstuden ${LD} -s -N -Ttext ${RELOC} -Bstatic -o ${PROG}.elf \ 1041.42Swrstuden ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 1051.26Swrstuden 1061.42Swrstuden${PROG}.xcf: ${OBJS} ${XCOFFXTRAOBJ} ${LIBSA} ${LIBZ} ${LIBKERN} 1071.43Smatt ${_MKTARGET_LINK} 1081.7Swrstuden ${LD} -s -N -T ${.CURDIR}/../fixcoff/elf32_powerpc_merge.x -e _entry \ 1091.7Swrstuden -Ttext ${RELOC} -Bstatic -o ${PROG}.mrg ${XCOFFXTRAOBJ} \ 1101.42Swrstuden ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 1111.7Swrstuden ${OBJCOPY} -O aixcoff-rs6000 -R .comment -R .note \ 1121.7Swrstuden ${PROG}.mrg ${PROG}.xcf 1131.39Smatt ${TOOL_MACPPCFIXCOFF} ${PROG}.xcf 114