[BACK]Return to Makefile CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / distrib / cdrom

Annotation of src/distrib/cdrom/Makefile, Revision 1.49

1.49    ! pooka       1: # $NetBSD: Makefile,v 1.48 2009/03/29 04:56:16 tsutsui Exp $
1.1       tv          2: #
                      3: # Consult "*.conf" for the configuration variables; this Makefile is typically
                      4: # not edited for basic configuration changes.
                      5: ##############################################################################
                      6:
1.40      tsutsui     7: all:   cdimages
                      8:
1.38      apb         9: .include <bsd.own.mk>
                     10:
1.1       tv         11: .if exists(site.conf)
                     12: .include "site.conf"
                     13: .endif
                     14:
                     15: .if !defined(RELEASE)
                     16: .BEGIN:
                     17:        @echo "Please set RELEASE in the environment or in site.conf to the basename"
                     18:        @echo "of the release configuration file to use.  For example:"
                     19:        @echo "> ${MAKE} RELEASE=foo"
                     20:        @echo "will use the configuration file foo.conf."
                     21:        @false
                     22: .endif
                     23:
                     24: .if exists(${RELEASE}.conf)
                     25: .include "${RELEASE}.conf"
                     26: .elif !target(.BEGIN)
                     27: .BEGIN:
                     28:        @echo "Error: File does not exist: ${RELEASE}.conf"
                     29:        @false
                     30: .endif
                     31:
                     32: CD_RELEASE?=
1.8       lukem      33: CD_SIZE?=              650000
1.7       mrg        34: RELEASENAME?=          NetBSD-${CD_RELEASE}
1.9       lukem      35: MKISOFS_ARGS=          -A "NetBSD ${CD_RELEASE}" \
1.1       tv         36:                        -hide-rr-moved -m Split -m cdrom
1.3       tv         37: #                      -hide-list ${.CURDIR}/hide-iso.lst
1.1       tv         38:
                     39: ALL_PORTS=
                     40: .for image in ${CD_IMAGES}
                     41: BASE_PORTS.${image}?=
                     42: ALL_PORTS:=            ${ALL_PORTS} ${BASE_PORTS.${image}}
                     43: .endfor
                     44:
                     45: .if exists(${RELEASENAME}.mk)
                     46: .include "${RELEASENAME}.mk"
                     47: .elif !target(.BEGIN)
                     48: .if !empty(CD_RELEASE)
                     49: .BEGIN:
                     50:        @echo "Error: File does not exist: ${RELEASENAME}.mk"
                     51:        @echo "(specified by variable CD_RELEASE in ${RELEASE}.conf)"
                     52:        @false
                     53: .else
                     54: .BEGIN:
                     55:        @echo "Error: CD_RELEASE not set in ${RELEASE}.conf"
                     56:        @false
                     57: .endif
                     58: .endif
                     59:
                     60: SUBDIR=
                     61:
                     62: .if !empty(ALL_PORTS:Mmacppc)
1.48      tsutsui    63: SUBDIR+=       macppc_installboot
1.1       tv         64: .endif
                     65:
                     66: .if !empty(SUBDIR)
                     67: .include <bsd.subdir.mk>
                     68: .endif
                     69:
                     70: .include <bsd.obj.mk>
1.19      lukem      71: .include <bsd.own.mk>
1.1       tv         72:
                     73: ##### Default paths for programs #####
                     74:
1.41      tsutsui    75: MKISOFS?=      /usr/local/bin/mkisofs
1.1       tv         76: RSYNC?=                /usr/pkg/bin/rsync
1.18      lukem      77: ALPHA_IBOOT?=  ${TOOL_INSTALLBOOT} -m alpha -o sunsum,append
                     78: PMAX_IBOOT?=   ${TOOL_INSTALLBOOT} -m pmax -o sunsum,append
1.21      jmc        79: VAX_IBOOT?=    ${TOOL_INSTALLBOOT} -m vax -o sunsum,append
1.1       tv         80: .if !empty(ALL_PORTS:Mmacppc)
1.6       lukem      81: MACPPC_IBOOTDIR!= cd ${.CURDIR}/macppc_installboot && ${PRINTOBJDIR}
1.1       tv         82: .endif
1.33      tsutsui    83: .if !empty(ALL_PORTS:Msgimips)
                     84: SGIMIPS_SGIVOL?=       ${TOOLDIR}/bin/nbsgivol
                     85: .endif
1.1       tv         86:
1.44      tsutsui    87: check_mkisofs:
                     88: .if !exists(${MKISOFS})
                     89:        @echo "Error: File does not exist: ${MKISOFS}"
                     90:        @echo "Please build and install mkisofs(8) utility and set MKISOFS in the environment"
                     91:        @echo "or in site.conf to create image."
                     92:        @false
                     93: .endif
                     94:
                     95: check_rsync:
                     96: .if !exists(${RSYNC})
                     97:        @echo "Error: File does not exist: ${RSYNC}"
                     98:        @echo "Please build and install rsync(1) utility and set RSYNC in the environment"
                     99:        @echo "or in site.conf to fetch release binaries."
                    100:        @false
                    101: .endif
                    102:
1.36      tsutsui   103: ##### rsync settings #####
                    104:
                    105: # rsync host; check mirrors on http://www.NetBSD.org/mirrors/#rsync
                    106: # (note not all rsync mirrors provide NetBSD-daily)
                    107: RSYNC_HOST?=   rsync.NetBSD.org
                    108:
                    109: # extra path for rsync mirrors ("/pub", "/netbsd" etc.)
                    110: RSYNC_PATH_PREFIX?=
                    111:
1.43      tsutsui   112: .if !target(.BEGIN)
1.36      tsutsui   113: .if ${RELEASE} == "current"
                    114: # daily date dir name
                    115: BRANCH?=       HEAD
                    116: #DAILY_DIR?=   yyyymmddhhmmZ
                    117: RSYNC_PATH?=   ${RSYNC_PATH_PREFIX}/NetBSD-daily/${BRANCH}/${DAILY_DIR}
                    118: .else
                    119: # extra suffix on pre-release ("_BETA2", "_RC5" etc.)
                    120: RELEASE_SUFFIX?=
                    121: RSYNC_PATH?=   ${RSYNC_PATH_PREFIX}/NetBSD/${RELEASENAME}${RELEASE_SUFFIX}
                    122:
                    123: # alternative for NetBSD-daily sets of stable branches
                    124: #DAILY_DIR?=   yyyymmddhhmmZ
                    125: #BRANCH?=      netbsd-4
                    126: #RSYNC_PATH?=  ${RSYNC_PATH_PREFIX}/NetBSD-daily/${BRANCH}/${DAILY_DIR}
                    127: .endif
1.43      tsutsui   128: .endif
1.36      tsutsui   129:
                    130: RSYNC_SITE?=   rsync://${RSYNC_HOST}${RSYNC_PATH}
1.4       tv        131: RSYNC_ARGS?=   -va --delete
1.1       tv        132: RSYNC_EXCLUDE+=        --exclude=/* --exclude=Split --exclude=cdrom
                    133:
1.45      tsutsui   134: DOWNLOADDIR?=  ${.OBJDIR}/download
                    135: DISTRIBDIR?=   ${DOWNLOADDIR}
1.2       tv        136: STAGEDIR?=     ${.OBJDIR}/staging
                    137: IMAGEDIR?=     ${.OBJDIR}
                    138: EXTFILEDIR?=   ${.OBJDIR}/extfiles
1.1       tv        139: EASTER_EGG?=   /dev/null
                    140:
1.13      lukem     141: ##### MACHINE_ARCH for possible shared sets for each (shared) port #####
1.1       tv        142:
1.13      lukem     143: MACHINE_ARCH.acorn26=  arm
                    144: MACHINE_ARCH.acorn32=  arm
                    145: MACHINE_ARCH.algor=    mipsel
1.1       tv        146: MACHINE_ARCH.amiga=    m68k
                    147: MACHINE_ARCH.amigappc= powerpc
                    148: MACHINE_ARCH.arc=      mipsel
                    149: MACHINE_ARCH.atari=    m68k
                    150: MACHINE_ARCH.bebox=    powerpc
1.13      lukem     151: MACHINE_ARCH.cats=     arm
                    152: MACHINE_ARCH.cesfic=   m68k
1.1       tv        153: MACHINE_ARCH.cobalt=   mipsel
1.13      lukem     154: MACHINE_ARCH.dreamcast=        sh3el
                    155: MACHINE_ARCH.evbarm=   arm
                    156: MACHINE_ARCH.evbmips=  mipsel
1.15      scw       157: MACHINE_ARCH.evbppc=   powerpc
1.13      lukem     158: MACHINE_ARCH.evbsh3=   sh3eb
1.1       tv        159: MACHINE_ARCH.hp300=    m68k
1.13      lukem     160: MACHINE_ARCH.hpcarm=   arm
1.1       tv        161: MACHINE_ARCH.hpcmips=  mipsel
1.13      lukem     162: MACHINE_ARCH.hpcsh=    sh3el
1.22      gavan     163: MACHINE_ARCH.iyonix=   arm
1.1       tv        164: MACHINE_ARCH.luna68k=  m68k
                    165: MACHINE_ARCH.mac68k=   m68k
                    166: MACHINE_ARCH.macppc=   powerpc
                    167: MACHINE_ARCH.mipsco=   mipseb
1.13      lukem     168: MACHINE_ARCH.mmeye=    sh3eb
1.1       tv        169: MACHINE_ARCH.mvme68k=  m68k
1.13      lukem     170: MACHINE_ARCH.netwinder=        arm
1.1       tv        171: MACHINE_ARCH.news68k=  m68k
                    172: MACHINE_ARCH.newsmips= mipseb
                    173: MACHINE_ARCH.next68k=  m68k
                    174: MACHINE_ARCH.ofppc=    powerpc
                    175: MACHINE_ARCH.pmax=     mipsel
                    176: MACHINE_ARCH.prep=     powerpc
1.13      lukem     177: MACHINE_ARCH.sandpoint=        powerpc
                    178: MACHINE_ARCH.sbmips=   mipseb
1.1       tv        179: MACHINE_ARCH.sgimips=  mipseb
1.13      lukem     180: MACHINE_ARCH.shark=    arm
1.1       tv        181: MACHINE_ARCH.sun3=     m68k
                    182: MACHINE_ARCH.x68k=     m68k
                    183:
                    184: ##### Fetched directories from FTP server #####
                    185:
                    186: .if defined(ALL_PORTS) && !empty(ALL_PORTS)
1.28      tsutsui   187: RSYNC_INCLUDE+=                --include "/shared"
1.9       lukem     188: RSYNC_EXCLUDE+=                --exclude "/[a-z]*" \
1.28      tsutsui   189:                        --exclude "/shared/[a-z]*"
1.1       tv        190: .endif
                    191:
1.13      lukem     192: RSYNC_ARCHS=
                    193: .for port in ${ALL_PORTS:O:u}                  # {
1.28      tsutsui   194: RSYNC_INCLUDE+=                --include "/${port}"
1.1       tv        195: .if defined(MACHINE_ARCH.${port})
1.13      lukem     196: RSYNC_ARCHS+=          ${MACHINE_ARCH.${port}}
1.1       tv        197: .endif
1.9       lukem     198: .endfor                                                # }
1.13      lukem     199: .for arch in ${RSYNC_ARCHS:O:u}
1.28      tsutsui   200: RSYNC_INCLUDE+=                --include "/shared/${arch}"
1.13      lukem     201: .endfor
1.1       tv        202:
                    203: ##### Boot info and additional options for various platforms #####
                    204:
                    205: .if defined(PUBLISHER)
1.30      mrg       206: MKISOFS_ARGS+=         -publisher "${PUBLISHER}"
1.1       tv        207: .endif
                    208:
                    209: .if defined(PREPARER)
                    210: MKISOFS_ARGS+=         -p "${PREPARER}"
                    211: .endif
                    212:
1.13      lukem     213:
                    214: ##### Per image settings #####
                    215:
1.9       lukem     216: .for image in ${CD_IMAGES}                     # {
1.1       tv        217: ports:=${BASE_PORTS.${image}}
                    218:
                    219: .if !defined(VOLID.${image}) && !target(.BEGIN)
                    220: .BEGIN:
                    221:        @echo "Error: VOLID.${image} not set in ${RELEASE}.conf"
                    222:        @false
                    223: .endif
                    224:
                    225: MKISOFS_ARGS.${image}= -V "${VOLID.${image}}"
                    226:
1.9       lukem     227: pathlist.${image}:=${STAGEDIR}/${image}.pathlist
1.10      lukem     228: contents.${image}:=${IMAGEDIR}/${image}.contents
                    229:
1.9       lukem     230: MKISOFS_ARGS.${image}+=        -graft-points -path-list ${pathlist.${image}}
                    231:
1.1       tv        232: .if defined(ABSTRACT.${image})
                    233: MKISOFS_ARGS.${image}+=        -abstract ${ABSTRACT.${image}}
                    234: .endif
                    235:
                    236: # Options specified in release config file
                    237:
                    238: EXTFILES?=
                    239: INTFILES.${image}?=
                    240: INTDIRS.${image}?=
                    241: ADDFILES.${image}?=
                    242:
1.42      tsutsui   243: bports=                        # empty first
1.24      jmc       244: # For a source only cd just ignore the shared/ALL directory
1.40      tsutsui   245: .if ${ports} != "source" && exists(${DISTRIBDIR}/shared/ALL)
1.42      tsutsui   246: bports+=               shared/ALL
1.24      jmc       247: .endif
1.9       lukem     248: .for port in ${ports}                                  # {
1.1       tv        249: EXTFILES+=             ${EXTFILES.${port}}
                    250: INTFILES.${image}+=    ${INTFILES.${port}}
                    251: INTDIRS.${image}+=     ${INTDIRS.${port}}
                    252: ADDFILES.${image}+=    ${ADDFILES.${port}}
                    253: MKISOFS_ARGS.${image}+=        ${MKISOFS_ARGS.${port}}
1.13      lukem     254: # add shared/ALL and shared/${MACHINE_ARCH} to BASE_PORTS.${image}
                    255: bports+=               ${port}
1.40      tsutsui   256: .if defined(MACHINE_ARCH.${port}) &&   \
                    257:     exists(${DISTRIBDIR}/shared/${MACHINE_ARCH.${port}})
1.13      lukem     258: bports+=               shared/${MACHINE_ARCH.${port}}
                    259: .endif
1.9       lukem     260: .endfor                                                        # }
1.13      lukem     261: BASE_PORTS.${image}:=  ${bports:O:u}
                    262:
1.1       tv        263:
                    264: # i386
                    265:
                    266: .if !empty(ports:Mi386)
1.34      bouyer    267: .if empty(INTFILES.i386:Mbootxx_cd9660)
                    268: # non-emulation boot
                    269: MKISOFS_ARGS.${image}+=        -b ${BOOTFILE.i386} -c boot.catalog -no-emul-boot
                    270: .else
                    271: #2.88MB emulation boot
1.1       tv        272: MKISOFS_ARGS.${image}+=        -b ${BOOTFILE.i386} -c boot.catalog
                    273: .endif
1.34      bouyer    274: .endif
1.1       tv        275:
1.23      jmc       276: # amd64
                    277:
                    278: .if !empty(ports:Mamd64)
1.34      bouyer    279: .if empty(INTFILES.amd64:Mbootxx_cd9660)
                    280: # non-emulation boot
                    281: MKISOFS_ARGS.${image}+=        -b ${BOOTFILE.amd64} -c boot.catalog -no-emul-boot
                    282: .else
                    283: #2.88MB emulation boot
1.23      jmc       284: MKISOFS_ARGS.${image}+= -b ${BOOTFILE.amd64} -c boot.catalog
                    285: .endif
1.34      bouyer    286: .endif
1.23      jmc       287:
1.1       tv        288: # Mac (mac68k, macppc)
                    289:
1.2       tv        290: .if !empty(ports:Mmacppc)
1.48      tsutsui   291: BOOTHFS=       boothfs
1.1       tv        292: MKISOFS_ARGS.${image}+=        -hfs -part -hide-hfs-list ${.CURDIR}/hide-hfs.lst \
1.8       lukem     293:        --macbin -map ${.CURDIR}/hfsmap.lst \
1.48      tsutsui   294:        -boot-hfs-file ${.OBJDIR}/${BOOTHFS}
                    295: UUDECODE_FILES=        ${BOOTHFS}
                    296: .include <bsd.files.mk>
1.2       tv        297: .elif defined(USE_APPLE_ISO) || !empty(ports:Mmac68k)
1.3       tv        298: MKISOFS_ARGS.${image}+=        -apple --macbin -map ${.CURDIR}/hfsmap.lst
1.1       tv        299: .endif
                    300:
                    301: # Sun (sparc, sparc64, sun3)
                    302:
1.2       tv        303: SUN_BOOT_ARGS.${image}:=
1.9       lukem     304: .if !empty(ports:Msparc*) || !empty(ports:Msun3*)      # {
1.17      lukem     305: SUN_BOOT.123:= -
                    306: SUN_BOOT.4:=   -
                    307: SUN_BOOT.5:=   -
1.1       tv        308:
                    309: .if !empty(ports:Msparc)
                    310: SUN_BOOT.123:= ${BOOTFILE.sparc}
                    311: .endif
                    312:
1.9       lukem     313: .if !empty(ports:Msun3)                                        # {
1.1       tv        314: .if !defined(BOOTFILE.sun3x)
                    315: # NetBSD >= 1.4; sun3 and sun3x are the same
                    316: SUN_BOOT.5:=   ${BOOTFILE.sun3}
                    317: .endif
                    318: SUN_BOOT.4:=   ${BOOTFILE.sun3}
1.9       lukem     319: .endif                                                 # }
1.1       tv        320:
                    321: .if !empty(ports:Msun3x) && defined(BOOTFILE.sun3x)
                    322: # NetBSD < 1.4; sun3 and sun3x are separate
                    323: SUN_BOOT.5:=   ${BOOTFILE.sun3x}
                    324: .endif
                    325:
1.9       lukem     326: .if !empty(ports:Msparc64)                             # {
1.17      lukem     327: .if (${SUN_BOOT.5} != "-")
1.1       tv        328: # add warning
                    329: SUN_BOOT.5:=   ${SUN_BOOT.5} ${BOOTFILE.sparc64}
                    330: .else
                    331: SUN_BOOT.5:=   ${BOOTFILE.sparc64}
                    332: .endif
1.9       lukem     333: .endif                                                 # }
1.1       tv        334:
                    335: SUN_BOOT_ARGS.${image}:= ${SUN_BOOT.123} ${SUN_BOOT.123} ${SUN_BOOT.123} ${SUN_BOOT.4} ${SUN_BOOT.5}
1.2       tv        336:
                    337: .if empty(SUN_BOOT_ARGS.${image}:N/dev/null)
                    338: SUN_BOOT_ARGS.${image}:=
                    339: .endif
1.9       lukem     340: .endif                                                 # }
1.1       tv        341:
1.9       lukem     342: .endfor                # image in ${CD_IMAGES}         # }
1.1       tv        343:
                    344: ##### Additional options for host OS's #####
                    345:
                    346: # (USE_APPLE_ISO is tested above)
                    347:
                    348: .if defined(USE_ROCK_RIDGE)
                    349: MKISOFS_ARGS+=         -r
                    350: .endif
                    351:
                    352: .if defined(USE_LONG_NAMES)
                    353: MKISOFS_ARGS+=         -l
                    354: .endif
                    355:
                    356: .if defined(USE_TRANS_TBL)
                    357: MKISOFS_ARGS+=         -T
                    358: .endif
                    359:
                    360: .if defined(USE_JOLIET)
                    361: MKISOFS_ARGS+=         -J -hide-joliet-list ${.CURDIR}/hide-jol.lst
                    362: .if defined(USE_TRANS_TBL)
                    363: MKISOFS_ARGS+=         -hide-joliet-trans-tbl
                    364: .endif
                    365: .endif
                    366:
                    367: ##### File extract rule #####
                    368:
                    369: USE-FILE: .USE
1.3       tv        370:        @if [ ! -r $@ ]; then case $> in \
1.1       tv        371:                /*,link) \
1.9       lukem     372:                        echo "cp ${>:S/,link$//} $@"; \
                    373:                        cp ${>:S/,link$//} $@;; \
1.1       tv        374:                *,link) \
1.9       lukem     375:                        echo "cp `pwd -P`/${>:S/,link$//} $@"; \
                    376:                        cp `pwd -P`/${>:S/,link$//} $@;; \
1.1       tv        377:                *.tgz,*) \
                    378:                        echo "Extracting: $> --> $@..."; \
1.46      tsutsui   379:                        ${TOOL_PAX} -rnz -f ${>:C/,.*$//} ${>:C/^.*,//} ; \
1.16      jmc       380:                        cp ${>:C/^.*,//} $@; rm -rf ${>:C/^.*,//} ;; \
1.1       tv        381:                *.gz) echo "gunzip -c <$> >$@"; gunzip -c <$> >$@;; \
                    382:                *) echo "Unknown archive method for $@"; false;; \
1.3       tv        383:        esac; else true; fi
1.1       tv        384:
                    385: ##### Makefile rules #####
                    386:
1.9       lukem     387: .for image in ${CD_IMAGES}                     # {
1.40      tsutsui   388: cdimages: ${IMAGEDIR}/${image}.iso
1.1       tv        389:
                    390: stage-${image}:
                    391:        mkdir -p ${STAGEDIR}/${image} ${EXTFILEDIR}
1.10      lukem     392:        rm -f ${pathlist.${image}} ${contents.${image}}
1.1       tv        393: .if defined(BASE_PORTS.${image}) && !empty(BASE_PORTS.${image})
                    394: .for dir in ${INTDIRS.${image}}
                    395:        mkdir -p ${STAGEDIR}/${image}/${dir}
                    396: .endfor
                    397: .for arch in ${BASE_PORTS.${image}}
1.10      lukem     398:        @echo "${arch}=${DISTRIBDIR}/${arch}" >> ${pathlist.${image}}
                    399:        @echo "${arch}" >> ${contents.${image}}
1.1       tv        400: .endfor
                    401: .endif
                    402:
                    403: extfileprep:
1.9       lukem     404: .for file in ${EXTFILES}                       # {
1.1       tv        405: extfileprep: ${EXTFILEDIR}/${file:C/:.*$//}
1.9       lukem     406: ${EXTFILEDIR}/${file:C/:.*$//}: ${DISTRIBDIR}/${file:C/^.*://} USE-FILE
                    407: ${DISTRIBDIR}/${file:C/^.*://}: .PHONY
                    408: .endfor                                                # }
1.1       tv        409:
                    410: fileprep-${image}:
1.9       lukem     411: .for file in ${INTFILES.${image}}              # {
1.1       tv        412: fileprep-${image}: ${STAGEDIR}/${image}/${file:C/:.*$//}
1.9       lukem     413: ${STAGEDIR}/${image}/${file:C/:.*$//}: ${DISTRIBDIR}/${file:C/^.*://} USE-FILE
                    414: ${DISTRIBDIR}/${file:C/^.*://}: .PHONY
                    415: .endfor                                                # }
                    416: .for file in ${ADDFILES.${image}}              # {
1.1       tv        417: fileprep-${image}: ${STAGEDIR}/${image}/${file:C/:.*$//}
                    418: ${STAGEDIR}/${image}/${file:C/:.*$//}: ${file:C/^.*://} USE-FILE
                    419: ${file:C/^.*://}: .PHONY
1.9       lukem     420: .endfor                                                # }
1.1       tv        421:
1.48      tsutsui   422: .if !empty(BASE_PORTS.${image}:Mmacppc)
                    423: fileprep-${image}: ${BOOTHFS}
                    424: .endif
                    425:
1.1       tv        426: # Size the CD image.  This is done via the following formula:
                    427: # 1. Size the image produced by mkisofs.
1.17      lukem     428: # 2. Add images added by distrib/common/sunbootcd.sh by rounding to a 320k
                    429: #    boundary and adding each Sun image rounded to a 320k boundary.
1.29      tsutsui   430: # 3. Add bootfile sizes rounded up to 512 bytes for pmax and vax.
                    431: # 4. Round up to a 32k boundary, then add another 32k for TAO padding.
1.1       tv        432:
1.33      tsutsui   433: SGIVOLHDR.size= 4096
1.2       tv        434:
1.44      tsutsui   435: size-${image}: stage-${image} extfileprep fileprep-${image} check_mkisofs
1.38      apb       436:        @size=$$((`cd ${STAGEDIR}/${image} && \
                    437:                   ${MKISOFS} ${MKISOFS_ARGS} ${MKISOFS_ARGS.${image}} \
1.39      tsutsui   438:                        -print-size . 2>&1 \
1.38      apb       439:                   | tee /dev/stderr \
1.47      tsutsui   440:                   | ${TOOL_SED} '/=/!d;s/^[^=]*=//'` * 2048)) && \
1.1       tv        441:        if [ "${SUN_BOOT_ARGS.${image}}" != "" ]; then \
                    442:                size=$$(($$(($$size + 327679)) / 327680 * 327680)) && \
1.17      lukem     443:                bootfiles=`for f in ${SUN_BOOT_ARGS.${image}:N-:O}; do echo $$f; done | uniq` && \
1.1       tv        444:                for f in $$bootfiles; do \
1.37      tsutsui   445:                        bfsize=$$(${TOOL_STAT} -f '%z' $$f) && \
1.1       tv        446:                        size=$$(($$size + $$(($$(($$bfsize + 327679)) / 327680 * 327680)))); \
                    447:                done; \
                    448:        fi && \
                    449:        if [ "${BASE_PORTS.${image}:Mpmax}" != "" ]; then \
1.37      tsutsui   450:                size=$$(($$size + $$(($$(($$(${TOOL_STAT} -f '%z' ${BOOTFILE.pmax}) + 511)) / 512 * 512)))); \
1.1       tv        451:        fi && \
                    452:        if [ "${BASE_PORTS.${image}:Mvax}" != "" ]; then \
1.37      tsutsui   453:                size=$$(($$size + $$(($$(($$(${TOOL_STAT} -f '%z' ${BOOTFILE.vax})  + 511)) / 512 * 512)))); \
1.1       tv        454:        fi && \
1.32      tsutsui   455:        if [ "${BASE_PORTS.${image}:Msgimips}" != "" -a \
1.26      riz       456:            "${EXTFILES.sgimips}" != "" ]; then \
1.33      tsutsui   457:                size=$$(($$size + ${SGIVOLHDR.size} * 512)); \
1.25      martin    458:        fi && \
1.1       tv        459:        size=$$(($$(($$size + 16383)) / 16384 * 16384 + 32768)) && \
                    460:        sizek=$$(($$size / 1024)) && \
                    461:        echo "Projected size of ${image}.iso: $$size bytes ($${sizek}K)." && \
1.8       lukem     462:        if [ $$sizek -gt ${CD_SIZE} ]; then echo "Image too large for ${CD_SIZE} KB CD!"; false; fi
1.1       tv        463:
1.2       tv        464: # Actually build the image with all the bootstrap goo....
                    465:
1.48      tsutsui   466: .if !empty(BASE_PORTS.${image}:Mmacppc)
                    467: ${IMAGEDIR}/${image}.iso: all-macppc_installboot
                    468: .endif
                    469:
1.44      tsutsui   470: ${IMAGEDIR}/${image}.iso: size-${image} check_mkisofs
1.10      lukem     471:        @sort -o ${contents.${image}} ${contents.${image}}
1.5       tv        472: .if defined(LOG_MKISOFS)
                    473:        cd ${STAGEDIR}/${image} && ${MKISOFS} -o $@ ${MKISOFS_ARGS} ${MKISOFS_ARGS.${image}} -v -v . >${IMAGEDIR}/${image}.iso.log 2>&1
                    474: .else
1.2       tv        475:        cd ${STAGEDIR}/${image} && ${MKISOFS} -o $@ ${MKISOFS_ARGS} ${MKISOFS_ARGS.${image}} .
1.5       tv        476: .endif
1.2       tv        477: .if !empty(SUN_BOOT_ARGS.${image})
1.18      lukem     478:        SUNLABEL=${TOOL_SUNLABEL:Q} \
                    479:            ${HOST_SH} ${NETBSDSRCDIR}/distrib/common/sunbootcd.sh \
1.17      lukem     480:            ${.TARGET} ${SUN_BOOT_ARGS.${image}}
1.1       tv        481: .endif
                    482: .if !empty(BASE_PORTS.${image}:Mmacppc)
1.29      tsutsui   483:        ${MACPPC_IBOOTDIR}/macppc_installboot \
                    484:            $@ ${EXTFILEDIR}/macppc.bootxx /ofwboot
1.1       tv        485: .endif
                    486: .if !empty(BASE_PORTS.${image}:Mpmax)
1.8       lukem     487:        ${PMAX_IBOOT} $@ ${BOOTFILE.pmax}
1.1       tv        488: .endif
                    489: .if !empty(BASE_PORTS.${image}:Mvax)
1.7       mrg       490:        ${VAX_IBOOT} $@ ${BOOTFILE.vax}
1.11      lukem     491: .endif
                    492: .if !empty(BASE_PORTS.${image}:Malpha)
                    493:        ${ALPHA_IBOOT} $@ ${BOOTFILE.alpha}
1.1       tv        494: .endif
1.26      riz       495: .if !empty(BASE_PORTS.${image}:Msgimips) && defined(EXTFILES.sgimips)
1.25      martin    496:        @echo "Prepending SGI volume header"
1.33      tsutsui   497:        mv $@ $@.raw
                    498:        dd if=/dev/zero of=$@.tmp bs=512 count=${SGIVOLHDR.size}
                    499:        dd if=$@.raw of=$@.tmp bs=512 seek=${SGIVOLHDR.size}
                    500:        ${SGIMIPS_SGIVOL} -f -i -h ${SGIVOLHDR.size} $@.tmp
                    501:        ${SGIMIPS_SGIVOL} -f -w aoutboot ${STAGEDIR}/${image}/aoutboot $@.tmp
                    502:        ${SGIMIPS_SGIVOL} -f -w ip2xboot ${STAGEDIR}/${image}/ip2xboot $@.tmp
                    503:        ${SGIMIPS_SGIVOL} -f -w ip3xboot ${STAGEDIR}/${image}/ip3xboot $@.tmp
                    504:        mv $@.tmp $@
                    505:        rm -f $@.raw $@.tmp
1.25      martin    506: .endif
1.1       tv        507:        @echo Rounding up to 32k boundary and padding 32k....
1.35      tsutsui   508:        @size=$$(${TOOL_STAT} -f '%z' $@); \
                    509:            pad=$$(( 32768 - ( $$size & 32767 ) )); \
                    510:            [ $$pad = 32768 ] || \
                    511:            dd if=/dev/zero bs=1 count=$$pad >>$@ 2>/dev/null
1.1       tv        512:
1.9       lukem     513: .endfor                # image in ${CD_IMAGES}         # }
1.1       tv        514:
1.44      tsutsui   515: fetch: check_rsync
1.7       mrg       516:        @mkdir -p ${DISTRIBDIR}
1.1       tv        517:        @echo Fetching distributions....
1.9       lukem     518:        ${RSYNC} ${RSYNC_INCLUDE} ${RSYNC_ARGS} ${RSYNC_EXCLUDE} ${RSYNC_SITE}/ ${DISTRIBDIR}/
1.1       tv        519:
                    520: clean: cleanstagedir cleanimages
1.45      tsutsui   521: cleandir distclean: cleandownloaddir
1.1       tv        522:
                    523: cleanimages:
                    524: .for image in ${CD_IMAGES}
1.10      lukem     525:        -rm -f ${IMAGEDIR}/${image}.iso ${IMAGEDIR}/${image}.iso.log \
                    526:                ${contents.${image}}
1.1       tv        527: .endfor
                    528:
                    529: cleanstagedir:
                    530:        -rm -rf ${STAGEDIR} ${EXTFILEDIR}
                    531:
1.45      tsutsui   532: cleandownloaddir:
                    533:        -rm -rf ${DOWNLOADDIR}

CVSweb <webmaster@jp.NetBSD.org>