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

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

1.50    ! martin      1: # $NetBSD: Makefile,v 1.49 2009/12/05 16:29:10 pooka 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
1.50    ! martin    175: MACHINE_ARCH.playstation2=mipsel
1.1       tv        176: MACHINE_ARCH.pmax=     mipsel
                    177: MACHINE_ARCH.prep=     powerpc
1.13      lukem     178: MACHINE_ARCH.sandpoint=        powerpc
                    179: MACHINE_ARCH.sbmips=   mipseb
1.1       tv        180: MACHINE_ARCH.sgimips=  mipseb
1.13      lukem     181: MACHINE_ARCH.shark=    arm
1.1       tv        182: MACHINE_ARCH.sun3=     m68k
                    183: MACHINE_ARCH.x68k=     m68k
                    184:
                    185: ##### Fetched directories from FTP server #####
                    186:
                    187: .if defined(ALL_PORTS) && !empty(ALL_PORTS)
1.28      tsutsui   188: RSYNC_INCLUDE+=                --include "/shared"
1.9       lukem     189: RSYNC_EXCLUDE+=                --exclude "/[a-z]*" \
1.28      tsutsui   190:                        --exclude "/shared/[a-z]*"
1.1       tv        191: .endif
                    192:
1.13      lukem     193: RSYNC_ARCHS=
                    194: .for port in ${ALL_PORTS:O:u}                  # {
1.28      tsutsui   195: RSYNC_INCLUDE+=                --include "/${port}"
1.1       tv        196: .if defined(MACHINE_ARCH.${port})
1.13      lukem     197: RSYNC_ARCHS+=          ${MACHINE_ARCH.${port}}
1.1       tv        198: .endif
1.9       lukem     199: .endfor                                                # }
1.13      lukem     200: .for arch in ${RSYNC_ARCHS:O:u}
1.28      tsutsui   201: RSYNC_INCLUDE+=                --include "/shared/${arch}"
1.13      lukem     202: .endfor
1.1       tv        203:
                    204: ##### Boot info and additional options for various platforms #####
                    205:
                    206: .if defined(PUBLISHER)
1.30      mrg       207: MKISOFS_ARGS+=         -publisher "${PUBLISHER}"
1.1       tv        208: .endif
                    209:
                    210: .if defined(PREPARER)
                    211: MKISOFS_ARGS+=         -p "${PREPARER}"
                    212: .endif
                    213:
1.13      lukem     214:
                    215: ##### Per image settings #####
                    216:
1.9       lukem     217: .for image in ${CD_IMAGES}                     # {
1.1       tv        218: ports:=${BASE_PORTS.${image}}
                    219:
                    220: .if !defined(VOLID.${image}) && !target(.BEGIN)
                    221: .BEGIN:
                    222:        @echo "Error: VOLID.${image} not set in ${RELEASE}.conf"
                    223:        @false
                    224: .endif
                    225:
                    226: MKISOFS_ARGS.${image}= -V "${VOLID.${image}}"
                    227:
1.9       lukem     228: pathlist.${image}:=${STAGEDIR}/${image}.pathlist
1.10      lukem     229: contents.${image}:=${IMAGEDIR}/${image}.contents
                    230:
1.9       lukem     231: MKISOFS_ARGS.${image}+=        -graft-points -path-list ${pathlist.${image}}
                    232:
1.1       tv        233: .if defined(ABSTRACT.${image})
                    234: MKISOFS_ARGS.${image}+=        -abstract ${ABSTRACT.${image}}
                    235: .endif
                    236:
                    237: # Options specified in release config file
                    238:
                    239: EXTFILES?=
                    240: INTFILES.${image}?=
                    241: INTDIRS.${image}?=
                    242: ADDFILES.${image}?=
                    243:
1.42      tsutsui   244: bports=                        # empty first
1.24      jmc       245: # For a source only cd just ignore the shared/ALL directory
1.40      tsutsui   246: .if ${ports} != "source" && exists(${DISTRIBDIR}/shared/ALL)
1.42      tsutsui   247: bports+=               shared/ALL
1.24      jmc       248: .endif
1.9       lukem     249: .for port in ${ports}                                  # {
1.1       tv        250: EXTFILES+=             ${EXTFILES.${port}}
                    251: INTFILES.${image}+=    ${INTFILES.${port}}
                    252: INTDIRS.${image}+=     ${INTDIRS.${port}}
                    253: ADDFILES.${image}+=    ${ADDFILES.${port}}
                    254: MKISOFS_ARGS.${image}+=        ${MKISOFS_ARGS.${port}}
1.13      lukem     255: # add shared/ALL and shared/${MACHINE_ARCH} to BASE_PORTS.${image}
                    256: bports+=               ${port}
1.40      tsutsui   257: .if defined(MACHINE_ARCH.${port}) &&   \
                    258:     exists(${DISTRIBDIR}/shared/${MACHINE_ARCH.${port}})
1.13      lukem     259: bports+=               shared/${MACHINE_ARCH.${port}}
                    260: .endif
1.9       lukem     261: .endfor                                                        # }
1.13      lukem     262: BASE_PORTS.${image}:=  ${bports:O:u}
                    263:
1.1       tv        264:
                    265: # i386
                    266:
                    267: .if !empty(ports:Mi386)
1.34      bouyer    268: .if empty(INTFILES.i386:Mbootxx_cd9660)
                    269: # non-emulation boot
                    270: MKISOFS_ARGS.${image}+=        -b ${BOOTFILE.i386} -c boot.catalog -no-emul-boot
                    271: .else
                    272: #2.88MB emulation boot
1.1       tv        273: MKISOFS_ARGS.${image}+=        -b ${BOOTFILE.i386} -c boot.catalog
                    274: .endif
1.34      bouyer    275: .endif
1.1       tv        276:
1.23      jmc       277: # amd64
                    278:
                    279: .if !empty(ports:Mamd64)
1.34      bouyer    280: .if empty(INTFILES.amd64:Mbootxx_cd9660)
                    281: # non-emulation boot
                    282: MKISOFS_ARGS.${image}+=        -b ${BOOTFILE.amd64} -c boot.catalog -no-emul-boot
                    283: .else
                    284: #2.88MB emulation boot
1.23      jmc       285: MKISOFS_ARGS.${image}+= -b ${BOOTFILE.amd64} -c boot.catalog
                    286: .endif
1.34      bouyer    287: .endif
1.23      jmc       288:
1.1       tv        289: # Mac (mac68k, macppc)
                    290:
1.2       tv        291: .if !empty(ports:Mmacppc)
1.48      tsutsui   292: BOOTHFS=       boothfs
1.1       tv        293: MKISOFS_ARGS.${image}+=        -hfs -part -hide-hfs-list ${.CURDIR}/hide-hfs.lst \
1.8       lukem     294:        --macbin -map ${.CURDIR}/hfsmap.lst \
1.48      tsutsui   295:        -boot-hfs-file ${.OBJDIR}/${BOOTHFS}
                    296: UUDECODE_FILES=        ${BOOTHFS}
                    297: .include <bsd.files.mk>
1.2       tv        298: .elif defined(USE_APPLE_ISO) || !empty(ports:Mmac68k)
1.3       tv        299: MKISOFS_ARGS.${image}+=        -apple --macbin -map ${.CURDIR}/hfsmap.lst
1.1       tv        300: .endif
                    301:
                    302: # Sun (sparc, sparc64, sun3)
                    303:
1.2       tv        304: SUN_BOOT_ARGS.${image}:=
1.9       lukem     305: .if !empty(ports:Msparc*) || !empty(ports:Msun3*)      # {
1.17      lukem     306: SUN_BOOT.123:= -
                    307: SUN_BOOT.4:=   -
                    308: SUN_BOOT.5:=   -
1.1       tv        309:
                    310: .if !empty(ports:Msparc)
                    311: SUN_BOOT.123:= ${BOOTFILE.sparc}
                    312: .endif
                    313:
1.9       lukem     314: .if !empty(ports:Msun3)                                        # {
1.1       tv        315: .if !defined(BOOTFILE.sun3x)
                    316: # NetBSD >= 1.4; sun3 and sun3x are the same
                    317: SUN_BOOT.5:=   ${BOOTFILE.sun3}
                    318: .endif
                    319: SUN_BOOT.4:=   ${BOOTFILE.sun3}
1.9       lukem     320: .endif                                                 # }
1.1       tv        321:
                    322: .if !empty(ports:Msun3x) && defined(BOOTFILE.sun3x)
                    323: # NetBSD < 1.4; sun3 and sun3x are separate
                    324: SUN_BOOT.5:=   ${BOOTFILE.sun3x}
                    325: .endif
                    326:
1.9       lukem     327: .if !empty(ports:Msparc64)                             # {
1.17      lukem     328: .if (${SUN_BOOT.5} != "-")
1.1       tv        329: # add warning
                    330: SUN_BOOT.5:=   ${SUN_BOOT.5} ${BOOTFILE.sparc64}
                    331: .else
                    332: SUN_BOOT.5:=   ${BOOTFILE.sparc64}
                    333: .endif
1.9       lukem     334: .endif                                                 # }
1.1       tv        335:
                    336: SUN_BOOT_ARGS.${image}:= ${SUN_BOOT.123} ${SUN_BOOT.123} ${SUN_BOOT.123} ${SUN_BOOT.4} ${SUN_BOOT.5}
1.2       tv        337:
                    338: .if empty(SUN_BOOT_ARGS.${image}:N/dev/null)
                    339: SUN_BOOT_ARGS.${image}:=
                    340: .endif
1.9       lukem     341: .endif                                                 # }
1.1       tv        342:
1.9       lukem     343: .endfor                # image in ${CD_IMAGES}         # }
1.1       tv        344:
                    345: ##### Additional options for host OS's #####
                    346:
                    347: # (USE_APPLE_ISO is tested above)
                    348:
                    349: .if defined(USE_ROCK_RIDGE)
                    350: MKISOFS_ARGS+=         -r
                    351: .endif
                    352:
                    353: .if defined(USE_LONG_NAMES)
                    354: MKISOFS_ARGS+=         -l
                    355: .endif
                    356:
                    357: .if defined(USE_TRANS_TBL)
                    358: MKISOFS_ARGS+=         -T
                    359: .endif
                    360:
                    361: .if defined(USE_JOLIET)
                    362: MKISOFS_ARGS+=         -J -hide-joliet-list ${.CURDIR}/hide-jol.lst
                    363: .if defined(USE_TRANS_TBL)
                    364: MKISOFS_ARGS+=         -hide-joliet-trans-tbl
                    365: .endif
                    366: .endif
                    367:
                    368: ##### File extract rule #####
                    369:
                    370: USE-FILE: .USE
1.3       tv        371:        @if [ ! -r $@ ]; then case $> in \
1.1       tv        372:                /*,link) \
1.9       lukem     373:                        echo "cp ${>:S/,link$//} $@"; \
                    374:                        cp ${>:S/,link$//} $@;; \
1.1       tv        375:                *,link) \
1.9       lukem     376:                        echo "cp `pwd -P`/${>:S/,link$//} $@"; \
                    377:                        cp `pwd -P`/${>:S/,link$//} $@;; \
1.1       tv        378:                *.tgz,*) \
                    379:                        echo "Extracting: $> --> $@..."; \
1.46      tsutsui   380:                        ${TOOL_PAX} -rnz -f ${>:C/,.*$//} ${>:C/^.*,//} ; \
1.16      jmc       381:                        cp ${>:C/^.*,//} $@; rm -rf ${>:C/^.*,//} ;; \
1.1       tv        382:                *.gz) echo "gunzip -c <$> >$@"; gunzip -c <$> >$@;; \
                    383:                *) echo "Unknown archive method for $@"; false;; \
1.3       tv        384:        esac; else true; fi
1.1       tv        385:
                    386: ##### Makefile rules #####
                    387:
1.9       lukem     388: .for image in ${CD_IMAGES}                     # {
1.40      tsutsui   389: cdimages: ${IMAGEDIR}/${image}.iso
1.1       tv        390:
                    391: stage-${image}:
                    392:        mkdir -p ${STAGEDIR}/${image} ${EXTFILEDIR}
1.10      lukem     393:        rm -f ${pathlist.${image}} ${contents.${image}}
1.1       tv        394: .if defined(BASE_PORTS.${image}) && !empty(BASE_PORTS.${image})
                    395: .for dir in ${INTDIRS.${image}}
                    396:        mkdir -p ${STAGEDIR}/${image}/${dir}
                    397: .endfor
                    398: .for arch in ${BASE_PORTS.${image}}
1.10      lukem     399:        @echo "${arch}=${DISTRIBDIR}/${arch}" >> ${pathlist.${image}}
                    400:        @echo "${arch}" >> ${contents.${image}}
1.1       tv        401: .endfor
                    402: .endif
                    403:
                    404: extfileprep:
1.9       lukem     405: .for file in ${EXTFILES}                       # {
1.1       tv        406: extfileprep: ${EXTFILEDIR}/${file:C/:.*$//}
1.9       lukem     407: ${EXTFILEDIR}/${file:C/:.*$//}: ${DISTRIBDIR}/${file:C/^.*://} USE-FILE
                    408: ${DISTRIBDIR}/${file:C/^.*://}: .PHONY
                    409: .endfor                                                # }
1.1       tv        410:
                    411: fileprep-${image}:
1.9       lukem     412: .for file in ${INTFILES.${image}}              # {
1.1       tv        413: fileprep-${image}: ${STAGEDIR}/${image}/${file:C/:.*$//}
1.9       lukem     414: ${STAGEDIR}/${image}/${file:C/:.*$//}: ${DISTRIBDIR}/${file:C/^.*://} USE-FILE
                    415: ${DISTRIBDIR}/${file:C/^.*://}: .PHONY
                    416: .endfor                                                # }
                    417: .for file in ${ADDFILES.${image}}              # {
1.1       tv        418: fileprep-${image}: ${STAGEDIR}/${image}/${file:C/:.*$//}
                    419: ${STAGEDIR}/${image}/${file:C/:.*$//}: ${file:C/^.*://} USE-FILE
                    420: ${file:C/^.*://}: .PHONY
1.9       lukem     421: .endfor                                                # }
1.1       tv        422:
1.48      tsutsui   423: .if !empty(BASE_PORTS.${image}:Mmacppc)
                    424: fileprep-${image}: ${BOOTHFS}
                    425: .endif
                    426:
1.1       tv        427: # Size the CD image.  This is done via the following formula:
                    428: # 1. Size the image produced by mkisofs.
1.17      lukem     429: # 2. Add images added by distrib/common/sunbootcd.sh by rounding to a 320k
                    430: #    boundary and adding each Sun image rounded to a 320k boundary.
1.29      tsutsui   431: # 3. Add bootfile sizes rounded up to 512 bytes for pmax and vax.
                    432: # 4. Round up to a 32k boundary, then add another 32k for TAO padding.
1.1       tv        433:
1.33      tsutsui   434: SGIVOLHDR.size= 4096
1.2       tv        435:
1.44      tsutsui   436: size-${image}: stage-${image} extfileprep fileprep-${image} check_mkisofs
1.38      apb       437:        @size=$$((`cd ${STAGEDIR}/${image} && \
                    438:                   ${MKISOFS} ${MKISOFS_ARGS} ${MKISOFS_ARGS.${image}} \
1.39      tsutsui   439:                        -print-size . 2>&1 \
1.38      apb       440:                   | tee /dev/stderr \
1.47      tsutsui   441:                   | ${TOOL_SED} '/=/!d;s/^[^=]*=//'` * 2048)) && \
1.1       tv        442:        if [ "${SUN_BOOT_ARGS.${image}}" != "" ]; then \
                    443:                size=$$(($$(($$size + 327679)) / 327680 * 327680)) && \
1.17      lukem     444:                bootfiles=`for f in ${SUN_BOOT_ARGS.${image}:N-:O}; do echo $$f; done | uniq` && \
1.1       tv        445:                for f in $$bootfiles; do \
1.37      tsutsui   446:                        bfsize=$$(${TOOL_STAT} -f '%z' $$f) && \
1.1       tv        447:                        size=$$(($$size + $$(($$(($$bfsize + 327679)) / 327680 * 327680)))); \
                    448:                done; \
                    449:        fi && \
                    450:        if [ "${BASE_PORTS.${image}:Mpmax}" != "" ]; then \
1.37      tsutsui   451:                size=$$(($$size + $$(($$(($$(${TOOL_STAT} -f '%z' ${BOOTFILE.pmax}) + 511)) / 512 * 512)))); \
1.1       tv        452:        fi && \
                    453:        if [ "${BASE_PORTS.${image}:Mvax}" != "" ]; then \
1.37      tsutsui   454:                size=$$(($$size + $$(($$(($$(${TOOL_STAT} -f '%z' ${BOOTFILE.vax})  + 511)) / 512 * 512)))); \
1.1       tv        455:        fi && \
1.32      tsutsui   456:        if [ "${BASE_PORTS.${image}:Msgimips}" != "" -a \
1.26      riz       457:            "${EXTFILES.sgimips}" != "" ]; then \
1.33      tsutsui   458:                size=$$(($$size + ${SGIVOLHDR.size} * 512)); \
1.25      martin    459:        fi && \
1.1       tv        460:        size=$$(($$(($$size + 16383)) / 16384 * 16384 + 32768)) && \
                    461:        sizek=$$(($$size / 1024)) && \
                    462:        echo "Projected size of ${image}.iso: $$size bytes ($${sizek}K)." && \
1.8       lukem     463:        if [ $$sizek -gt ${CD_SIZE} ]; then echo "Image too large for ${CD_SIZE} KB CD!"; false; fi
1.1       tv        464:
1.2       tv        465: # Actually build the image with all the bootstrap goo....
                    466:
1.48      tsutsui   467: .if !empty(BASE_PORTS.${image}:Mmacppc)
                    468: ${IMAGEDIR}/${image}.iso: all-macppc_installboot
                    469: .endif
                    470:
1.44      tsutsui   471: ${IMAGEDIR}/${image}.iso: size-${image} check_mkisofs
1.10      lukem     472:        @sort -o ${contents.${image}} ${contents.${image}}
1.5       tv        473: .if defined(LOG_MKISOFS)
                    474:        cd ${STAGEDIR}/${image} && ${MKISOFS} -o $@ ${MKISOFS_ARGS} ${MKISOFS_ARGS.${image}} -v -v . >${IMAGEDIR}/${image}.iso.log 2>&1
                    475: .else
1.2       tv        476:        cd ${STAGEDIR}/${image} && ${MKISOFS} -o $@ ${MKISOFS_ARGS} ${MKISOFS_ARGS.${image}} .
1.5       tv        477: .endif
1.2       tv        478: .if !empty(SUN_BOOT_ARGS.${image})
1.18      lukem     479:        SUNLABEL=${TOOL_SUNLABEL:Q} \
                    480:            ${HOST_SH} ${NETBSDSRCDIR}/distrib/common/sunbootcd.sh \
1.17      lukem     481:            ${.TARGET} ${SUN_BOOT_ARGS.${image}}
1.1       tv        482: .endif
                    483: .if !empty(BASE_PORTS.${image}:Mmacppc)
1.29      tsutsui   484:        ${MACPPC_IBOOTDIR}/macppc_installboot \
                    485:            $@ ${EXTFILEDIR}/macppc.bootxx /ofwboot
1.1       tv        486: .endif
                    487: .if !empty(BASE_PORTS.${image}:Mpmax)
1.8       lukem     488:        ${PMAX_IBOOT} $@ ${BOOTFILE.pmax}
1.1       tv        489: .endif
                    490: .if !empty(BASE_PORTS.${image}:Mvax)
1.7       mrg       491:        ${VAX_IBOOT} $@ ${BOOTFILE.vax}
1.11      lukem     492: .endif
                    493: .if !empty(BASE_PORTS.${image}:Malpha)
                    494:        ${ALPHA_IBOOT} $@ ${BOOTFILE.alpha}
1.1       tv        495: .endif
1.26      riz       496: .if !empty(BASE_PORTS.${image}:Msgimips) && defined(EXTFILES.sgimips)
1.25      martin    497:        @echo "Prepending SGI volume header"
1.33      tsutsui   498:        mv $@ $@.raw
                    499:        dd if=/dev/zero of=$@.tmp bs=512 count=${SGIVOLHDR.size}
                    500:        dd if=$@.raw of=$@.tmp bs=512 seek=${SGIVOLHDR.size}
                    501:        ${SGIMIPS_SGIVOL} -f -i -h ${SGIVOLHDR.size} $@.tmp
                    502:        ${SGIMIPS_SGIVOL} -f -w aoutboot ${STAGEDIR}/${image}/aoutboot $@.tmp
                    503:        ${SGIMIPS_SGIVOL} -f -w ip2xboot ${STAGEDIR}/${image}/ip2xboot $@.tmp
                    504:        ${SGIMIPS_SGIVOL} -f -w ip3xboot ${STAGEDIR}/${image}/ip3xboot $@.tmp
                    505:        mv $@.tmp $@
                    506:        rm -f $@.raw $@.tmp
1.25      martin    507: .endif
1.1       tv        508:        @echo Rounding up to 32k boundary and padding 32k....
1.35      tsutsui   509:        @size=$$(${TOOL_STAT} -f '%z' $@); \
                    510:            pad=$$(( 32768 - ( $$size & 32767 ) )); \
                    511:            [ $$pad = 32768 ] || \
                    512:            dd if=/dev/zero bs=1 count=$$pad >>$@ 2>/dev/null
1.1       tv        513:
1.9       lukem     514: .endfor                # image in ${CD_IMAGES}         # }
1.1       tv        515:
1.44      tsutsui   516: fetch: check_rsync
1.7       mrg       517:        @mkdir -p ${DISTRIBDIR}
1.1       tv        518:        @echo Fetching distributions....
1.9       lukem     519:        ${RSYNC} ${RSYNC_INCLUDE} ${RSYNC_ARGS} ${RSYNC_EXCLUDE} ${RSYNC_SITE}/ ${DISTRIBDIR}/
1.1       tv        520:
                    521: clean: cleanstagedir cleanimages
1.45      tsutsui   522: cleandir distclean: cleandownloaddir
1.1       tv        523:
                    524: cleanimages:
                    525: .for image in ${CD_IMAGES}
1.10      lukem     526:        -rm -f ${IMAGEDIR}/${image}.iso ${IMAGEDIR}/${image}.iso.log \
                    527:                ${contents.${image}}
1.1       tv        528: .endfor
                    529:
                    530: cleanstagedir:
                    531:        -rm -rf ${STAGEDIR} ${EXTFILEDIR}
                    532:
1.45      tsutsui   533: cleandownloaddir:
                    534:        -rm -rf ${DOWNLOADDIR}

CVSweb <webmaster@jp.NetBSD.org>