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

Annotation of src/tools/Makefile, Revision 1.131

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

CVSweb <webmaster@jp.NetBSD.org>