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

Annotation of src/tools/Makefile, Revision 1.148

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

CVSweb <webmaster@jp.NetBSD.org>