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

Annotation of pkgsrc/Makefile, Revision 1.60

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

CVSweb <webmaster@jp.NetBSD.org>