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

Annotation of pkgsrc/Makefile, Revision 1.64

1.64    ! wiz         1: # $NetBSD: Makefile,v 1.63 2004/02/28 06:04:13 grant Exp $
1.1       agc         2: #
                      3:
1.22      hubertf     4: .include "mk/bsd.prefs.mk"
1.19      agc         5:
                      6: .ifdef SPECIFIC_PKGS
                      7: SUBDIR+=       ${SITE_SPECIFIC_PKGS}
                      8: SUBDIR+=       ${HOST_SPECIFIC_PKGS}
                      9: SUBDIR+=       ${GROUP_SPECIFIC_PKGS}
                     10: SUBDIR+=       ${USER_SPECIFIC_PKGS}
                     11: .else
1.1       agc        12: SUBDIR += archivers
                     13: SUBDIR += audio
                     14: SUBDIR += benchmarks
1.23      rh         15: SUBDIR += biology
1.9       frueauf    16: SUBDIR += cad
1.41      wiz        17: SUBDIR += chat
1.1       agc        18: SUBDIR += comms
                     19: SUBDIR += converters
1.14      tv         20: SUBDIR += cross
1.1       agc        21: SUBDIR += databases
                     22: SUBDIR += devel
                     23: SUBDIR += editors
                     24: SUBDIR += emulators
1.38      wiz        25: SUBDIR += finance
1.35      sakamoto   26: SUBDIR += fonts
1.1       agc        27: SUBDIR += games
1.60      agc        28: SUBDIR += geography
1.1       agc        29: SUBDIR += graphics
1.24      frueauf    30: SUBDIR += ham
1.47      seb        31: SUBDIR += inputmethod
1.1       agc        32: SUBDIR += lang
                     33: SUBDIR += mail
1.9       frueauf    34: SUBDIR += math
1.1       agc        35: SUBDIR += mbone
1.13      agc        36: SUBDIR += meta-pkgs
1.1       agc        37: SUBDIR += misc
1.61      jmmv       38: SUBDIR += multimedia
1.1       agc        39: SUBDIR += net
                     40: SUBDIR += news
1.17      garbled    41: SUBDIR += parallel
1.16      agc        42: SUBDIR += pkgtools
1.1       agc        43: SUBDIR += print
                     44: SUBDIR += security
                     45: SUBDIR += shells
                     46: SUBDIR += sysutils
1.55      hubertf    47: SUBDIR += textproc
1.42      wiz        48: SUBDIR += time
1.39      wiz        49: SUBDIR += wm
1.1       agc        50: SUBDIR += www
                     51: SUBDIR += x11
1.53      cjep       52: .endif
                     53:
                     54: .ifdef USER_ADDITIONAL_PKGS
                     55: SUBDIR+=       ${USER_ADDITIONAL_PKGS}
1.19      agc        56: .endif
1.1       agc        57:
1.22      hubertf    58: PKGSRCTOP=     yes
1.51      dmcmahil   59:
                     60:
                     61: # If PACKAGES is set to the default (${_PKGSRCDIR}/packages), the current
                     62: # ${MACHINE_ARCH} and "release" (uname -r) will be used. Otherwise a directory
                     63: # structure of ...pkgsrc/packages/`uname -r`/${MACHINE_ARCH} is assumed.
                     64: # The PKG_URL is set from FTP_PKG_URL_* or CDROM_PKG_URL_*, depending on
                     65: # the target used to generate the README.html file.
                     66: .PHONY: README.html
                     67: _README_TYPE_FLAG?=    none
                     68: README.html: .PRECIOUS
                     69: .if ${_README_TYPE_FLAG} == "--ftp" || ${_README_TYPE_FLAG} == "--cdrom"
                     70:        @if [ -e ${PACKAGES} ]; then                                    \
                     71:                cd ${PACKAGES};                                         \
                     72:                case `pwd` in                                           \
                     73:                        ${.CURDIR}/packages)                            \
                     74:                                MULTIARCH=;                             \
                     75:                                ;;                                      \
                     76:                        *)                                              \
                     77:                                MULTIARCH=--multi-arch;                 \
                     78:                                ;;                                      \
                     79:                esac;                                                   \
                     80:                cd ${.CURDIR} ;                                         \
                     81:        fi;                                                             \
1.52      wiz        82:        ${SETENV} TMPDIR=${TMPDIR:U/tmp}/mkreadme                       \
1.51      dmcmahil   83:                BMAKE=${MAKE} AWK=${AWK} EXPR=${EXPR}                   \
                     84:                ./mk/scripts/mkreadme --pkgsrc ${.CURDIR}               \
                     85:                --packages ${PACKAGES} ${_README_TYPE_FLAG} $$MULTIARCH \
1.54      jmmv       86:                --prune
1.51      dmcmahil   87: .else
                     88:        @${ECHO} "ERROR:  please do not use the README.html target directly."
                     89:        @${ECHO} "        Instead use either the \"readme\" or \"cdrom-readme\""
                     90:        @${ECHO} "        target."
                     91:        @${FALSE}
                     92: .endif
1.22      hubertf    93:
                     94: .include "mk/bsd.pkg.subdir.mk"
1.45      dmcmahil   95:
                     96: # the bulk-cache and clean-bulk-cache targets are a global-pkgsrc
                     97: # thing and thus it makes sense to run it from the top level pkgsrc
                     98: # directory.
                     99: .if make(bulk-cache) || make(clean-bulk-cache)
                    100: .include "${.CURDIR}/mk/bulk/bsd.bulk-pkg.mk"
1.49      dmcmahil  101: # force the setting of _PKGSRCDIR because the way it gets
                    102: # set in bsd.prefs.mk is broken if you're in this top level directory
                    103: _PKGSRCDIR=${.CURDIR}
1.45      dmcmahil  104: .endif
1.1       agc       105:
1.63      grant     106: .PHONY: ${.CURDIR}/PKGDB
1.57      grant     107: ${.CURDIR}/PKGDB:
                    108:        @${RM} -f ${.CURDIR}/PKGDB
1.56      dmcmahil  109:        @${ECHO_MSG} "Extracting complete dependency database.  This may take a while..."
1.57      grant     110:        @DB=${.CURDIR}/PKGDB ; \
1.56      dmcmahil  111:        PKGSRCDIR=${.CURDIR} ; \
                    112:        npkg=1; \
1.57      grant     113:        list=`${GREP} '^[[:space:]]*'SUBDIR */Makefile | ${SED} 's,/Makefile.*=[[:space:]]*,/,'` ; \
1.56      dmcmahil  114:        for pkgdir in $$list ; do \
                    115:                if [ ! -d $$pkgdir ]; then  \
                    116:                        echo " " ; \
                    117:                        echo "WARNING:  the package directory $pkgdir is listed in" > /dev/stderr ; \
1.57      grant     118:                        echo $pkgdir | ${SED} 's;/.*;/Makefile;g' > /dev/stderr ; \
1.56      dmcmahil  119:                        echo "but the directory does not exist.  Please fix this!" > /dev/stderr ; \
                    120:                else \
                    121:                        cd $$pkgdir ; \
                    122:                        l=`${MAKE} print-summary-data`  ; \
                    123:                        if [ $$? != 0 ]; then \
                    124:                                echo "WARNING (printdepends):  the package in $$pkgdir had problem with" \
                    125:                                        > /dev/stderr ; \
                    126:                                echo "    ${MAKE} print-summary-data" > /dev/stderr ; \
                    127:                                echo "    database information for this package" > /dev/stderr ; \
                    128:                                echo "    will be dropped." > /dev/stderr ; \
                    129:                                ${MAKE} print-summary-data  2>&1 > /dev/stderr ; \
                    130:                        else \
                    131:                                echo "$$l" >> $$DB ; \
                    132:                        fi ; \
                    133:                fi ; \
                    134:                echo -n "." ; \
                    135:                if [ `${EXPR} $$npkg % 100 = 0` -eq 1 ]; then \
                    136:                        echo " " ; \
                    137:                        echo "$$npkg" ; \
                    138:                fi ; \
                    139:                npkg=`${EXPR} $$npkg + 1` ; \
                    140:                cd $$PKGSRCDIR  ; \
                    141:        done
1.57      grant     142:
                    143: .PHONY: index
                    144: index: ${.CURDIR}/INDEX
                    145:
                    146: ${.CURDIR}/INDEX: ${.CURDIR}/PKGDB
1.56      dmcmahil  147:        @${RM} -f ${.CURDIR}/INDEX
1.57      grant     148:        @${AWK} -f ./mk/scripts/genindex.awk PKGSRCDIR=${.CURDIR} SORT=${SORT} ${.CURDIR}/PKGDB
                    149:        @${RM} -f ${.CURDIR}/PKGDB
1.1       agc       150:
1.58      grant     151: print-index: ${.CURDIR}/INDEX
1.62      grant     152:        @${AWK} -F\| '{ printf("Pkg:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nB-deps:\t%s\nR-deps:\t%s\nArch:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9, $$10); }' < ${.CURDIR}/INDEX
1.1       agc       153:
1.58      grant     154: search: ${.CURDIR}/INDEX
1.1       agc       155: .if !defined(key)
1.43      hubertf   156:        @${ECHO} "The search target requires a keyword parameter,"
                    157:        @${ECHO} "e.g.: \"${MAKE} search key=somekeyword\""
1.1       agc       158: .else
1.62      grant     159:        @${GREP} ${key} ${.CURDIR}/INDEX | ${AWK} -F\| '{ printf("Pkg:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nB-deps:\t%s\nR-deps:\t%s\nArch:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9, $$10); }'
1.1       agc       160: .endif
1.19      agc       161:
1.48      wiz       162: #
1.25      hubertf   163: # Generate list of all packages by extracting information from
                    164: # the category/README.html pages
                    165: #
                    166: readme-all:
1.29      hubertf   167:        @if [ -f README-all.html ]; then \
1.50      salo      168:                ${MV} README-all.html README-all.html.BAK ; \
1.29      hubertf   169:        fi
1.25      hubertf   170:        @${MAKE} README-all.html
1.50      salo      171:        @if ${CMP} -s README-all.html README-all.html.BAK ; then \
                    172:                ${MV} README-all.html.BAK README-all.html ; \
1.25      hubertf   173:        else \
1.50      salo      174:                ${RM} -f README-all.html.BAK ; \
1.25      hubertf   175:        fi
                    176:
                    177: README-all.html:
1.50      salo      178:        @${RM} -f $@.new
                    179:        @${RM} -f $@.newsorted
1.43      hubertf   180:        @${ECHO} -n "Processing categories for $@:"
1.25      hubertf   181: .for category in ${SUBDIR}
                    182:        @if [ -f ${category}/README.html ]; then \
1.43      hubertf   183:                ${ECHO} -n ' ${category}' ; \
1.50      salo      184:                ${GREP} '^<TR>' ${category}/README.html \
                    185:                | ${SED} -e 's|"|"${category}/|' \
1.25      hubertf   186:                      -e 's| <TD>| <TD>(<A HREF="${category}/README.html">${category}</A>) <TD>|' \
                    187:                      -e 's|<TR>|<TR VALIGN=TOP>|' \
1.27      hubertf   188:                      -e 's|<TD VALIGN=TOP>|<TD>|' \
1.25      hubertf   189:                >> $@.new ; \
                    190:        fi
                    191: .endfor
1.43      hubertf   192:        @${ECHO} "."
1.59      jmmv      193:        @if [ ! -f $@.new ]; then \
                    194:                ${ECHO} "There are no categories with README.html files available."; \
                    195:                ${ECHO} "You need to run \`${MAKE} readme' to generate them before running this target."; \
                    196:                ${FALSE}; \
                    197:        fi
1.50      salo      198:        @${SORT} -f -t '">' +2 <$@.new >$@.newsorted
                    199:        @${WC} -l $@.newsorted | ${AWK} '{ print $$1 }'  >$@.npkgs
                    200:        @${CAT} templates/README.all \
1.25      hubertf   201:        | ${SED} \
1.46      dmcmahil  202:                -e '/%%NPKGS%%/r$@.npkgs' \
                    203:                -e '/%%NPKGS%%/d' \
                    204:                -e '/%%PKGS%%/r$@.newsorted' \
                    205:                -e '/%%PKGS%%/d' \
1.48      wiz       206:                > $@
1.50      salo      207:        @${RM} -f $@.npkgs
                    208:        @${RM} -f $@.new
                    209:        @${RM} -f $@.newsorted
1.30      hubertf   210:
                    211: readme-ipv6:
                    212:        @if [ -f README-IPv6.html ]; then \
1.50      salo      213:                ${MV} README-IPv6.html README-IPv6.html.BAK ; \
1.30      hubertf   214:        fi
                    215:        @${MAKE} README-IPv6.html
1.50      salo      216:        @if ${CMP} -s README-IPv6.html README-IPv6.html.BAK  ; then \
                    217:                ${MV} README-IPv6.html.BAK README-IPv6.html ; \
1.30      hubertf   218:        else \
1.50      salo      219:                ${RM} -f README-IPv6.html.BAK ; \
1.30      hubertf   220:        fi
                    221:
                    222: README-IPv6.html:
1.50      salo      223:        @${GREP} -l '^BUILD_DEFS.*=.*USE_INET6' */*/Makefile \
                    224:         | ${SED} s,Makefile,, >$@.pkgs
                    225:        @${FGREP} -f $@.pkgs README-all.html | ${SORT} -t/ +1 >$@.trs
                    226:        @${CAT} templates/README.ipv6 \
1.30      hubertf   227:        | ${SED} \
1.48      wiz       228:                -e '/%%TRS%%/r$@.trs' \
                    229:                -e '/%%TRS%%/d' \
1.30      hubertf   230:                >$@
                    231:        @${RM} $@.trs
                    232:        @${RM} $@.pkgs
1.33      agc       233:
                    234: show-host-specific-pkgs:
1.43      hubertf   235:        @${ECHO} "HOST_SPECIFIC_PKGS= \\";                                      \
1.50      salo      236:        ${MAKE} show-pkgsrc-dir | ${AWK} '/^===/ { next; } { printf("%s \\\n", $$1) }'; \
1.43      hubertf   237:        ${ECHO} ""
1.64    ! wiz       238:
        !           239: # list all packages that depend on a particular package; needs the INDEX file
        !           240: # usage: 'make show-deps PKG=openssl'
        !           241: # PKG: name of the package
        !           242: show-deps:
        !           243:        @if [ ! -f "${.CURDIR}/INDEX" ]; then ${ECHO} "No index available -- please build it with 'make index'" >&2; ${FALSE}; fi
        !           244:        @if [ -z "${PKG}" ]; then ${ECHO} "PKG variable not set" >&2; ${FALSE}; fi
        !           245:        @${GREP} -E "^([^|]*\|){7}([^|]* |)${PKG}>=" ${.CURDIR}/INDEX | ${SED} -n "s/^[^|]*|\([^|]*\)|.*/\1/p" | ${SORT}

CVSweb <webmaster@jp.NetBSD.org>