1 # $NetBSD: Makefile,v 1.1 2025/11/16 20:11:47 jmcneill Exp $ 2 3 S= ${.CURDIR}/../../../.. 4 POWERPC= ${S}/arch/powerpc 5 6 PROG?= ppcboot.elf 7 NEWVERSWHAT= "Wii MINI boot" 8 9 SRCS+= start.S 10 SRCS+= boot.c 11 SRCS+= console.c 12 SRCS+= conf.c 13 SRCS+= devopen.c 14 SRCS+= gecko.c 15 SRCS+= gpio.c 16 SRCS+= miniipc.c 17 SRCS+= sdmmc.c 18 SRCS+= timer.c 19 20 NOMAN= # defined 21 NOSANITIZER= # defined 22 NORELRO= # defined 23 STRIPFLAG= # nothing 24 25 LIBCRT0= # nothing 26 LIBCRTI= # nothing 27 LIBCRTBEGIN= # nothing 28 LIBCRTEND= # nothing 29 LIBC= # nothing 30 31 BINDIR= /usr/mdec 32 BINMODE= 444 33 34 .include <bsd.own.mk> 35 36 TEXTADDR= 0x01004000 37 STACKADDR= 0x01100000 38 ENTRY= __start 39 40 AFLAGS+= -mcpu=750 41 42 CFLAGS+= -mcpu=750 -msdata=none -mno-strict-align -msoft-float 43 CFLAGS+= -ffreestanding 44 CFLAGS+= -nostdinc 45 CFLAGS+= -Wall -Wmissing-prototypes 46 47 CPPFLAGS+= -D_STANDALONE 48 CPPFLAGS+= -DSUPPORT_DOSFS 49 CPPFLAGS+= -DLIBSA_FFS_EI 50 CPPFLAGS+= -DLIBSA_DISKLABEL_EI 51 52 CPPFLAGS+= -DTEXTADDR=${TEXTADDR} 53 CPPFLAGS+= -DSTACKADDR=${STACKADDR} 54 CPPFLAGS+= -DPPC_OEA -DDISTANT_KERNEL -D__wii__ -Devbppc=evbppc 55 CPPFLAGS+= -DCACHE_LINE_SIZE=32 56 CPPFLAGS+= -DEVBPPC_HAS_MBR 57 58 CPPFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/../../.. -I${.CURDIR}/../../../.. 59 60 # Follow the suit of Makefile.kern.inc; needed for the lfs64 union 61 # accessors -- they don't actually dereference the resulting pointer, 62 # just use it for type-checking. 63 CWARNFLAGS+= ${CC_WNO_ADDRESS_OF_PACKED_MEMBER} 64 65 ### find out what to use for libsa 66 SA_AS= library 67 SAMISCMAKEFLAGS+= SA_USE_LOADFILE=yes 68 SAMISCMAKEFLAGS+= SA_USE_CREAD=yes 69 SAMISCMAKEFLAGS+= SA_INCLUDE_NET=no 70 .include "${S}/lib/libsa/Makefile.inc" 71 LIBSA= ${SALIB} 72 73 ### find out what to use for libkern 74 KERN_AS= library 75 .include "${S}/lib/libkern/Makefile.inc" 76 LIBKERN= ${KERNLIB} 77 78 ### find out what to use for libz 79 Z_AS= library 80 .include "${S}/lib/libz/Makefile.inc" 81 LIBZ= ${ZLIB} 82 83 cleandir distclean: .WAIT cleanlibdir 84 85 cleanlibdir: 86 -rm -rf lib 87 88 LIBLIST= ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBSA} 89 90 .include "${S}/conf/newvers_stand.mk" 91 92 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 93 ${_MKTARGET_LINK} 94 ${LD} -N -T ${POWERPC}/conf/kern.ldscript \ 95 -Ttext ${TEXTADDR} -e ${ENTRY} -q -X \ 96 -o ${PROG} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 97 98 release: check_RELEASEDIR 99 ${HOST_INSTALL_FILE} -m ${BINMODE} ${PROG} \ 100 ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc 101 102 .include <bsd.klinks.mk> 103 .include <bsd.prog.mk> 104