1 # $NetBSD: Makefile,v 1.25 2014/01/27 08:18:07 apb Exp $ 2 3 .include <bsd.own.mk> 4 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" 5 6 .include <bsd.kernobj.mk> 7 8 # 9 # `make' or `make all' builds all gzimg files defined in ${TARGETS}. 10 # `make _KERNELNAME_' builds all gzimg files for specified kernels. 11 # 12 13 14 15 # TARGETS is a list of: 16 # KERNEL_name GZBOOT_name GZIMG_name 17 # RELOC_ADDR WHICH_kernel 18 # 19 .if ${MACHINE_ARCH} == "arm" 20 # Little endian platforms. 21 TARGETS= ADI_BRH ADI_BRH ADI_BRH_sd0 \ 22 0x00140000 netbsd-sd0 \ 23 \ 24 ADI_BRH ADI_BRH ADI_BRH_wd0 \ 25 0x00140000 netbsd-wd0 \ 26 \ 27 CP3100 IQ80321 CP3100_sd0 \ 28 0xf0080000 netbsd-sd0 \ 29 \ 30 CP3100 IQ80321 CP3100_wd0 \ 31 0xf0080000 netbsd-wd0 \ 32 \ 33 GEMINI GEMINI GEMINI \ 34 0x01600000 netbsd \ 35 \ 36 IQ80310 IQ80310 IQ80310_sd0 \ 37 0x00080000 netbsd-sd0 \ 38 \ 39 IQ80310 IQ80310 IQ80310_wd0 \ 40 0x00080000 netbsd-wd0 \ 41 \ 42 IQ80321 IQ80321 IQ80321_sd0 \ 43 0xf0080000 netbsd-sd0 \ 44 \ 45 IQ80321 IQ80321 IQ80321_wd0 \ 46 0xf0080000 netbsd-wd0 \ 47 \ 48 TEAMASA_NPWR IQ80310 TEAMASA_NPWR_sd0 \ 49 0x00080000 netbsd-sd0 \ 50 \ 51 TS7200 TS7200 TS7200_wd0 \ 52 0x60660000 netbsd-wd0 \ 53 \ 54 SMDK2800 SMDK2800 SMDK2800 \ 55 0x00000000 netbsd 56 .else 57 # Big endian platforms. 58 TARGETS= ADI_BRH ADI_BRH ADI_BRH_sd0 \ 59 0x00140000 netbsd-sd0 \ 60 \ 61 ADI_BRH ADI_BRH ADI_BRH_wd0 \ 62 0x00140000 netbsd-wd0 63 .endif 64 65 # Default is to build for all TARGETS 66 ALL_KERNELS?= + 67 68 .for K G I R W in ${TARGETS} # { 69 .for configsel in ${ALL_KERNELS} # { 70 .if ${configsel} == "+" || ${configsel} == ${K} 71 72 GZB${G}= ${DESTDIR}/usr/mdec/gzboot_${G}_${R}.bin 73 74 GZIMGS+= gzimg_${I}_flash_${R}.gz 75 76 gzimg_${I}_flash_${R}: .NOTMAIN ${GZB${G}} ${KERNOBJDIR}/${K}/${W}.bin 77 @echo "Populating ${.TARGET}" 78 -rm -f ${.TARGET}.kern.gz 79 ${TOOL_GZIP} -9nc ${KERNOBJDIR}/${K}/${W}.bin > ${.TARGET}.kern.gz 80 ${TOOL_CAT} ${GZB${G}} ${.TARGET}.kern.gz > ${.TARGET} 81 82 gzimg_${I}_flash_${R}.gz: .NOTMAIN gzimg_${I}_flash_${R} 83 -rm -f ${.TARGET} 84 ${TOOL_GZIP} -9nc ${.ALLSRC} > ${.TARGET} 85 86 CLEANFILES+= gzimg_${I}_flash_${R}.kern gzimg_${I}_flash_${R}.kern.gz \ 87 gzimg_${I}_flash_${R} 88 89 .if empty(GZKERNELS:M${K}) 90 GZKERNELS+= $K 91 .endif 92 KZ${K}+= gzimg_${I}_flash_${R}.gz 93 94 .endif 95 .endfor # } 96 .endfor # } 97 98 .for K in ${GZKERNELS} 99 ${K}: .PHONY ${KZ${K}} 100 .endfor 101 102 CLEANFILES+= ${GZIMGS} 103 104 105 realall: ${GZIMGS} 106 107 release: check_RELEASEDIR .WAIT ${GZIMGS} 108 .for img in ${GZIMGS} 109 ${RELEASE_INSTALL} ${img} ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/gzimg 110 .endfor 111 112 .include <bsd.prog.mk> 113