Home | History | Annotate | Line # | Download | only in etc.riscv
      1 #	$NetBSD: Makefile.inc,v 1.7 2025/03/22 09:25:14 hgutch Exp $
      2 #
      3 #	etc.riscv/Makefile.inc -- riscv-specific etc Makefile targets
      4 #
      5 
      6 .if ${MACHINE_ARCH} == "riscv64"
      7 KERNEL_SETS=		GENERIC64
      8 .else
      9 KERNEL_SETS=		GENERIC
     10 .endif
     11 
     12 # Support for mkimage
     13 MKIMAGE= 	${NETBSDSRCDIR}/distrib/utils/embedded/mkimage
     14 IMAGE.rel=      ${RELEASEDIR}/${RELEASEMACHINEDIR}
     15 IMAGE.dir=      ${IMAGE.rel}/binary/gzimg
     16 IMAGE.kern=     ${IMAGE.rel}/binary/kernel
     17 
     18 #	TOOL_MKUBOOTIMAGE=${TOOL_MKUBOOTIMAGE} \
     19 
     20 __mkimage: .USE
     21 	TOOL_MAKE=${MAKE} \
     22 	TOOL_MAKEFS=${TOOL_MAKEFS} \
     23 	TOOL_DISKLABEL=${TOOL_DISKLABEL} \
     24 	TOOL_FDISK=${TOOL_FDISK} \
     25 	TOOL_GPT=${TOOL_GPT} \
     26 	TOOL_GZIP=${TOOL_GZIP} \
     27 	TOOL_MKNOD=${TOOL_MKNOD} \
     28 	TOOL_PAX=${TOOL_PAX} \
     29 	TOOL_MTREE=${TOOL_MTREE} \
     30 	TOOL_SED=${TOOL_SED} \
     31 	TOOL_PWD_MKDB=${TOOL_PWD_MKDB} \
     32 	HOST_SH=${HOST_SH} \
     33 	KERNOBJDIR=${KERNOBJDIR} \
     34 	MACHINE=${MACHINE} \
     35 	MKDTB=${MKDTB} \
     36 	MKPOSTFIX=${MKPOSTFIX} \
     37 	CKSUM=${CKSUM} \
     38 	IMAGEDIR=${IMAGE.dir} \
     39 	${HOST_SH} ${MKIMAGE} -h ${.TARGET:S/smp_//} -D ${DESTDIR} \
     40             -S ${NETBSDSRCDIR} ${MKI_OPTS.${.TARGET}} \
     41             ${IMAGE.dir}/${.TARGET:S/smp_//}.img.gz
     42 
     43 
     44 .if ${MACHINE_ARCH} == "riscv64"
     45 .if ${HAVE_UEFI} == "yes"
     46 smp_efibootriscv64:
     47 	cd ${KERNSRCDIR}/stand/efiboot/bootriscv64 && ${MAKE} release
     48 	${MAKESUMS} -t ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc '*.efi'
     49 SNAP_MD_POST_DEPS+=	smp_efibootriscv64
     50 INSTALLATION_DIRS+=	installation/misc
     51 .endif
     52 
     53 smp_riscv64: __mkimage
     54 MKI_OPTS.smp_riscv64=	-K ${IMAGE.kern}
     55 SNAP_MD_POST_DEPS+=	smp_riscv64
     56 .endif
     57 
     58 
     59 .if ${MACHINE_ARCH} == "riscv32"
     60 smp_riscv32: __mkimage
     61 MKI_OPTS.smp_riscv32=	-K ${IMAGE.kern}
     62 SNAP_MD_POST_DEPS+=	smp_riscv32
     63 .endif
     64 
     65 snap_md_post: check_DESTDIR check_RELEASEDIR snap_post .WAIT ${SNAP_MD_POST_DEPS}
     66 
     67 INSTALLATION_DIRS+=	binary/gzimg		\
     68 			installation/instkernel
     69