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

Annotation of src/tools/Makefile, Revision 1.132

1.132   ! mrg         1: #      $NetBSD: Makefile,v 1.131 2009/12/21 20:57:36 mrg Exp $
1.1       tv          2:
1.3       tv          3: .include <bsd.own.mk>
                      4:
1.118     gmcgarry    5: .if defined(HAVE_GCC)
1.96      mrg         6: .if ${HAVE_GCC} == "4"
1.94      jmc         7: TOOLCHAIN_BITS= gmake .WAIT
                      8: .endif
1.81      lukem       9: .if ${TOOLCHAIN_MISSING} == "no"
1.94      jmc        10: TOOLCHAIN_BITS+= binutils .WAIT
1.77      mrg        11: TOOLCHAIN_BITS+= gcc
1.97      mrg        12: .  if ${MKCROSSGDB:Uno} != "no"
1.74      cl         13: TOOLCHAIN_BITS+= gdb
1.70      mrg        14: .  endif
                     15: TOOLCHAIN_BITS+= .WAIT dbsym mdsetimage
1.58      thorpej    16: # XXX Eventually, we want to be able to build dbsym and mdsetimage
                     17: # XXX if EXTERNAL_TOOLCHAIN is set.
1.31      tv         18: .endif
1.118     gmcgarry   19: .endif
                     20:
                     21: .if defined(HAVE_PCC)
                     22: TOOLCHAIN_BITS= gmake .WAIT
                     23: .if ${TOOLCHAIN_MISSING} == "no"
                     24: TOOLCHAIN_BITS+= binutils .WAIT
                     25: TOOLCHAIN_BITS+= pcc
                     26: .endif
                     27: TOOLCHAIN_BITS+= .WAIT dbsym mdsetimage
                     28: .endif
1.31      tv         29:
1.99      mrg        30: LINT_BITS=
                     31: .if ${MKLINT} != "no"
                     32: LINT_BITS= lint lint2
                     33: .endif
                     34:
1.16      tv         35: # Dependencies in SUBDIR below ordered to maximize parallel ability.
1.29      tv         36: SUBDIR=        host-mkdep .WAIT compat .WAIT \
1.124     apb        37:        binstall .WAIT mktemp .WAIT sed .WAIT \
1.113     apb        38:                cap_mkdb crunchgen ctags genassym gencat hexdump join \
1.99      mrg        39:                ${LINT_BITS} \
1.132   ! mrg        40:                lorder makewhatis mkdep mtree rpcgen tsort uudecode m4 \
        !            41:        .WAIT texinfo \
        !            42:        .WAIT yacc \
        !            43:        .WAIT awk \
        !            44:        .WAIT lex \
        !            45:        .WAIT pax \
        !            46:        .WAIT libelf \
        !            47:        .WAIT ${TOOLCHAIN_BITS} \
1.114     jmmv       48:                asn1_compile atf-compile cat cksum compile_et config db \
1.127     sketch     49:                file lint1 \
1.90      dyoung     50:                makefs menuc mkcsmapper mkesdb mklocale mknod msgc \
1.132   ! mrg        51:                .WAIT disklabel \
        !            52:                .WAIT paxctl \
        !            53:                .WAIT fdisk \
        !            54:                .WAIT installboot \
1.119     apb        55:                pwd_mkdb stat strfile sunlabel zic
1.39      tv         56:
1.121     dyoung     57: .if ${MKMAN} != "no" || ${MKDOC} != "no" || ${MKHTML} != "no"
1.39      tv         58: SUBDIR+=       groff
1.128     joerg      59: .  if ${MKMANDOC} == "yes"
                     60: SUBDIR+=       mandoc
                     61: .  endif
1.39      tv         62: .endif
1.22      tv         63:
                     64: .if ${MKMAINTAINERTOOLS:Uno} != "no"
1.103     lukem      65: SUBDIR+=       autoconf .WAIT gettext
1.72      matt       66: .endif
                     67:
1.86      jmc        68: .if ${MACHINE} == "hp700"
1.83      skrll      69: SUBDIR+=       hp700-mkboot
                     70: .endif
                     71:
1.86      jmc        72: .if ${MACHINE} == "ibmnws"
1.72      matt       73: SUBDIR+=       ibmnws-ncdcs
1.79      matt       74: .endif
                     75:
1.86      jmc        76: .if ${MACHINE} == "macppc"
1.79      matt       77: SUBDIR+=       macppc-fixcoff
1.48      kleink     78: .endif
                     79:
1.116     garbled    80: .if (${MACHINE} == "prep" || ${MACHINE} == "rs6000" || ${MACHINE} == "bebox")
1.115     garbled    81: SUBDIR+=       powerpc-mkbootimage
1.22      tv         82: .endif
1.37      gmcgarry   83:
                     84: .if (${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb")
                     85: SUBDIR+=       mips-elf2ecoff
1.76      sekiya     86: .endif
                     87:
                     88: .if (${MACHINE} == "sgimips")
                     89: SUBDIR+=       sgivol
1.51      bjh21      90: .endif
                     91:
1.82      abs        92: .if ${MACHINE} == "acorn32"
                     93: SUBDIR+=       sparkcrc
                     94: .endif
                     95:
1.125     abs        96: .if (${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64")
1.51      bjh21      97: SUBDIR+=       fgen
1.37      gmcgarry   98: .endif
                     99:
1.85      jmc       100: .if ${MACHINE} == "amiga"
                    101: SUBDIR+=       amiga-elf2bb
                    102: SUBDIR+=       amiga-txlt
                    103: .endif
                    104:
1.86      jmc       105: .if ${MACHINE} == "hp300"
                    106: SUBDIR+=       hp300-mkboot
                    107: .endif
                    108:
1.66      lukem     109: check_MKTOOLS: .PHONY .NOTMAIN
1.19      jmc       110: .if ${MKTOOLS:Uyes} == "no"
1.17      tv        111:        @echo '*** WARNING: "MKTOOLS" is set to "no"; this will prevent building and'
                    112:        @echo '*** updating your host toolchain.  This should be used only as a'
                    113:        @echo '*** temporary workaround for toolchain problems, as it will result'
1.23      wiz       114:        @echo '*** in version skew and build errors over time!'
1.18      jmc       115: .endif
1.17      tv        116:
1.66      lukem     117: .if ${MKTOOLS:Uyes} == "no" || ${USETOOLS} != "yes"    # {
1.67      lukem     118: realall realdepend install: check_MKTOOLS
1.66      lukem     119:
1.17      tv        120: .for dir in ${SUBDIR:N.WAIT}
                    121: all-${dir} depend-${dir} dependall-${dir} install-${dir}:
                    122:        @true
                    123: .endfor
1.66      lukem     124: .endif                                                 # }
1.1       tv        125:
                    126: .include <bsd.subdir.mk>
1.11      tv        127: .include <bsd.obj.mk>
1.16      tv        128:
1.102     tron      129: .if !defined(PREVIOUSTOOLDIR)
                    130: .  if exists(PREVIOUSTOOLDIR)
1.66      lukem     131: PREVIOUSTOOLDIR!=      cat PREVIOUSTOOLDIR
1.102     tron      132: .  else
1.66      lukem     133: PREVIOUSTOOLDIR=
1.102     tron      134: .  endif
1.66      lukem     135: .endif
                    136:
                    137: CLEANFILES+=   PREVIOUSTOOLDIR
                    138:
1.101     tron      139: realall realdepend: .MAKE
1.107     apb       140: .if !empty(PREVIOUSTOOLDIR) && "${PREVIOUSTOOLDIR}" != "${TOOLDIR}"
1.66      lukem     141:        @echo "*** WARNING: TOOLDIR has moved?"
                    142:        @echo "*** PREVIOUSTOOLDIR '${PREVIOUSTOOLDIR}'"
                    143:        @echo "***     !=  TOOLDIR '${TOOLDIR}'"
                    144:        @echo "*** Cleaning mis-matched tools"
                    145:        rm -f PREVIOUSTOOLDIR
1.106     freza     146:        (cd ${.CURDIR} && ${MAKE} PREVIOUSTOOLDIR=${TOOLDIR} cleandir)
1.66      lukem     147: .endif
1.102     tron      148:        echo ${TOOLDIR} >PREVIOUSTOOLDIR
1.66      lukem     149:
1.40      tv        150: # For each .WAIT point, make sure the immediately preceding target is
                    151: # installed before building anything after that point.
1.109     dsl       152: # (dsl: which means that with: 'a b .WAIT c' the build of 'c' waits for the
                    153: # install of 'b', but not the install of 'a'.)
1.36      pk        154: #
                    155: # We use the "internal" targets and dependencies generated by <bsd.subdir.mk>
                    156: # to achieve this. These targets look like:
                    157: #      subdir-all:     all-dir1     [.WAIT] all-dir2     etc..
                    158: #      subdir-install: install-dir1 [.WAIT] install-dir2 etc..
                    159: # and so on for each element in ${TARGETS}, with .WAIT sources inserted at
                    160: # places corresponding to the .WAITs in our $SUBDIR variable.
                    161: #
                    162: # Also, since we're now mixing `install' with `all' and `depend' targets
                    163: # an order relationship between those in each individual subdirectory
                    164: # must be established.
                    165: #
1.40      tv        166: _deps:=
                    167: _prev:=
                    168:
1.123     apb       169: .for d in ${SUBDIR}                            # {
1.16      tv        170: _this:=                ${d}
1.40      tv        171:
1.123     apb       172: .if ${_this} == ".WAIT"                                # {
1.36      pk        173:
                    174: # setup dependency to apply to all/depend targets in the next group
1.40      tv        175: _deps:=                ${_deps} ${_prev:S/^/install-/}
                    176:
                    177: # if we're building *only* individual targets (i.e. "dependall-yacc"),
                    178: # make sure prerequisite tools build before installing
1.109     dsl       179: # XXX: dsl: this is likely to generate a dependency loop since there is
                    180: # a .ORDER releation between the nodes as well.
                    181: .if !make(all) && !make(dependall) && !make(install)
1.40      tv        182: install-${_prev}: dependall-${_prev}
                    183: .endif
1.36      pk        184:
1.123     apb       185: .else # ${_this} != ".WAIT"                    # } {
1.36      pk        186:
1.109     dsl       187: # order depend/all/install targets for ${d} subdir.
                    188: .ORDER: depend-${d} all-${d} dependall-${d} install-${d}
1.40      tv        189:
1.106     freza     190: # prevent cleandir in real{all,depend} from interfering with subdir makes
                    191: .ORDER: realdepend dependall-${d}
                    192: .ORDER: realdepend depend-${d}
                    193: .ORDER: realall all-${d}
                    194:
1.40      tv        195: # make all/depend-${d} dependent on list of install targets
                    196: depend-${d} all-${d} dependall-${d}: ${_deps}
1.36      pk        197:
1.123     apb       198: .endif # ${_this} != ".WAIT"                   # }
1.40      tv        199:
                    200: # stash current name in case the next entry is .WAIT
                    201: _prev:=                ${d}
1.123     apb       202: .endfor                                                # }
1.69      tron      203:
                    204: cleandir:
                    205:        rm -f ${CLEANFILES}

CVSweb <webmaster@jp.NetBSD.org>