[BACK]Return to bsd.prog.mk CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / share / mk

Annotation of src/share/mk/bsd.prog.mk, Revision 1.281

1.281   ! christos    1: #      $NetBSD: bsd.prog.mk,v 1.280 2013/01/26 21:49:20 christos Exp $
1.67      mikel       2: #      @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
1.1       cgd         3:
1.166     lukem       4: .ifndef HOSTPROG
                      5:
1.138     tv          6: .include <bsd.init.mk>
1.159     thorpej     7: .include <bsd.shlib.mk>
1.167     thorpej     8: .include <bsd.gcc.mk>
1.74      mycroft     9:
1.223     jmmv       10: #
                     11: # Definitions and targets shared among all programs built by a single
                     12: # Makefile.
                     13: #
                     14:
                     15: ##### Basic targets
                     16: realinstall:   proginstall scriptsinstall
                     17:
                     18: .gdbinit:
                     19:        rm -f .gdbinit
                     20: .if defined(DESTDIR) && !empty(DESTDIR)
                     21:        echo "set solib-absolute-prefix ${DESTDIR}" > .gdbinit
                     22: .else
                     23:        touch .gdbinit
1.185     erh        24: .endif
1.223     jmmv       25: .for __gdbinit in ${GDBINIT}
                     26:        echo "source ${__gdbinit}" >> .gdbinit
                     27: .endfor
1.185     erh        28:
1.267     apb        29: CLEANFILES+= a.out [Ee]rrs mklog core *.core .gdbinit
1.223     jmmv       30:
                     31: .if defined(SHAREDSTRINGS)
                     32: CLEANFILES+=strings
                     33: .c.o:
                     34:        ${CC} -E ${CPPFLAGS} ${CFLAGS} ${.IMPSRC} | xstr -c -
                     35:        @${CC} ${CPPFLAGS} ${CFLAGS} -c x.c -o ${.TARGET}
1.280     christos   36: .if defined(CTFCONVERT)
                     37:        ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
                     38: .endif
1.223     jmmv       39:        @rm -f x.c
1.1       cgd        40:
1.223     jmmv       41: .cc.o .cpp.o .cxx.o .C.o:
                     42:        ${CXX} -E ${CPPFLAGS} ${CXXFLAGS} ${.IMPSRC} | xstr -c -
                     43:        @mv -f x.c x.cc
                     44:        @${CXX} ${CPPFLAGS} ${CXXFLAGS} -c x.cc -o ${.TARGET}
1.280     christos   45: .if defined(CTFCONVERT)
                     46:        ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
                     47: .endif
1.223     jmmv       48:        @rm -f x.cc
                     49: .endif
1.185     erh        50:
1.237     christos   51: .if defined(MKPIE) && (${MKPIE} != "no")
1.238     christos   52: CFLAGS+=       ${PIE_CFLAGS}
1.239     christos   53: AFLAGS+=       ${PIE_AFLAGS}
1.238     christos   54: LDFLAGS+=      ${PIE_LDFLAGS}
1.237     christos   55: .endif
                     56:
1.25      mycroft    57: CFLAGS+=       ${COPTS}
1.279     christos   58: .if defined(MKDEBUG) && (${MKDEBUG} != "no")
                     59: CFLAGS+=       -g
                     60: .endif
1.212     mrg        61: OBJCFLAGS+=    ${OBJCOPTS}
1.193     dsl        62: MKDEP_SUFFIXES?=       .o .ln
1.1       cgd        63:
1.247     darran     64: # CTF preserve debug symbols
                     65: .if defined(MKDTRACE) && (${MKDTRACE} != "no") && (${CFLAGS:M-g} != "")
                     66: CTFFLAGS+= -g
                     67: CTFMFLAGS+= -g
                     68: .endif
                     69:
1.162     thorpej    70: # ELF platforms depend on crti.o, crtbegin.o, crtend.o, and crtn.o
1.153     pk         71: .ifndef LIBCRTBEGIN
1.167     thorpej    72: LIBCRTBEGIN=   ${DESTDIR}/usr/lib/crti.o ${_GCC_CRTBEGIN}
1.152     christos   73: .MADE: ${LIBCRTBEGIN}
1.153     pk         74: .endif
                     75: .ifndef LIBCRTEND
1.167     thorpej    76: LIBCRTEND=     ${_GCC_CRTEND} ${DESTDIR}/usr/lib/crtn.o
1.152     christos   77: .MADE: ${LIBCRTEND}
1.153     pk         78: .endif
1.144     lukem      79: _SHLINKER=     ${SHLINKDIR}/ld.elf_so
1.69      thorpej    80:
1.153     pk         81: .ifndef LIBCRT0
                     82: LIBCRT0=       ${DESTDIR}/usr/lib/crt0.o
1.152     christos   83: .MADE: ${LIBCRT0}
1.153     pk         84: .endif
1.95      ross       85:
1.202     lukem      86: ##### Installed system library definitions
                     87: #
                     88: #      E.g.
                     89: #              LIBC?=${DESTDIR}/usr/lib/libc.a
1.234     mrg        90: #              LIBX11?=${DESTDIR}/usr/X11R7/lib/libX11.a
1.202     lukem      91: #      etc..
1.269     christos   92: #      NB:     If you are a library here, add it in bsd.README
1.202     lukem      93:
                     94: .for _lib in \
1.268     christos   95:        archive \
                     96:        asn1 \
1.269     christos   97:        atf_c \
                     98:        atf_cxx \
1.268     christos   99:        bind9 \
                    100:        bluetooth \
                    101:        bsdmalloc \
                    102:        bz2 \
                    103:        c \
                    104:        c_pic \
                    105:        com_err \
                    106:        compat \
                    107:        crt0 \
                    108:        crypt \
                    109:        crypto \
                    110:        crypto_idea \
                    111:        crypto_mdc2 \
                    112:        crypto_rc5 \
                    113:        curses \
                    114:        dbm \
                    115:        des \
                    116:        dns \
                    117:        edit \
                    118:        event \
1.274     tron      119:        expat \
1.268     christos  120:        fetch \
                    121:        fl \
                    122:        form \
                    123:        g2c \
                    124:        gcc \
                    125:        gnumalloc \
                    126:        gssapi \
                    127:        hdb \
                    128:        heimbase \
                    129:        heimntlm \
                    130:        hx509 \
                    131:        intl \
                    132:        ipsec \
                    133:        isc \
                    134:        isccc \
                    135:        isccfg \
                    136:        kadm5clnt \
                    137:        kadm5srv \
                    138:        kafs \
                    139:        krb5 \
                    140:        kvm \
                    141:        l \
                    142:        lber \
                    143:        ldap \
                    144:        ldap_r \
                    145:        lua \
                    146:        lwres \
                    147:        m \
                    148:        magic \
                    149:        menu \
                    150:        objc \
                    151:        ossaudio \
                    152:        pam \
                    153:        pcap \
                    154:        pci \
                    155:        pmc \
                    156:        posix \
                    157:        pthread \
                    158:        pthread_dbg \
                    159:        puffs \
                    160:        quota \
                    161:        radius \
                    162:        resolv \
                    163:        rmt \
                    164:        roken \
                    165:        rpcsvc \
                    166:        rt \
                    167:        rump \
                    168:        rumpfs_cd9660fs \
                    169:        rumpfs_efs \
                    170:        rumpfs_ext2fs \
                    171:        rumpfs_ffs \
                    172:        rumpfs_hfs \
                    173:        rumpfs_lfs \
                    174:        rumpfs_msdosfs \
                    175:        rumpfs_nfs \
                    176:        rumpfs_ntfs \
                    177:        rumpfs_syspuffs \
                    178:        rumpfs_tmpfs \
                    179:        rumpfs_udf \
                    180:        rumpfs_ufs \
                    181:        rumpuser \
                    182:        saslc \
                    183:        skey \
                    184:        sl \
                    185:        sqlite3 \
                    186:        ss \
                    187:        ssh \
                    188:        ssl \
                    189:        ssp \
1.269     christos  190:        stdcxx \
                    191:        supcxx \
1.268     christos  192:        terminfo \
1.270     christos  193:        tre \
1.268     christos  194:        usbhid \
                    195:        util \
                    196:        wind \
                    197:        wrap \
                    198:        y \
                    199:        z
1.202     lukem     200: .ifndef LIB${_lib:tu}
1.269     christos  201: LIB${_lib:tu}= ${DESTDIR}/usr/lib/lib${_lib:S/xx/++/:S/atf_c/atf-c/}.a
1.202     lukem     202: .MADE:         ${LIB${_lib:tu}}        # Note: ${DESTDIR} will be expanded
                    203: .endif
                    204: .endfor
1.269     christos  205:
1.206     he        206: # PAM applications, if linked statically, need more libraries
                    207: .if (${MKPIC} == "no")
1.208     christos  208: .if (${MKCRYPTO} != "no")
                    209: PAM_STATIC_LDADD+= -lssh
                    210: PAM_STATIC_DPADD+= ${LIBSSH}
                    211: .endif
                    212: .if (${MKKERBEROS} != "no")
1.265     he        213: PAM_STATIC_LDADD+= -lkafs -lkrb5 -lhx509 -lwind -lasn1 \
                    214:        -lroken -lcom_err -lheimbase -lcrypto
                    215: PAM_STATIC_DPADD+= ${LIBKAFS} ${LIBKRB5} ${LIBHX509} ${LIBWIND} ${LIBASN1} \
                    216:        ${LIBROKEN} ${LIBCOM_ERR} ${LIBHEIMBASE} ${LIBCRYPTO}
1.208     christos  217: .endif
                    218: .if (${MKSKEY} != "no")
                    219: PAM_STATIC_LDADD+= -lskey
                    220: PAM_STATIC_DPADD+= ${LIBSKEY}
                    221: .endif
                    222: PAM_STATIC_LDADD+= -lradius -lcrypt -lrpcsvc -lutil
                    223: PAM_STATIC_DPADD+= ${LIBRADIUS} ${LIBCRYPT} ${LIBRPCSVC} ${LIBUTIL}
1.206     he        224: .else
                    225: PAM_STATIC_LDADD=
                    226: PAM_STATIC_DPADD=
                    227: .endif
                    228:
1.269     christos  229: #      NB:     If you are a library here, add it in bsd.README
1.202     lukem     230: .for _lib in \
1.268     christos  231:        FS \
                    232:        GL \
                    233:        GLU \
                    234:        ICE \
                    235:        SM \
                    236:        X11 \
                    237:        XTrap \
                    238:        Xau \
                    239:        Xaw \
                    240:        Xdmcp \
                    241:        Xext \
                    242:        Xfont \
                    243:        Xft \
                    244:        Xi \
                    245:        Xinerama \
                    246:        Xmu \
                    247:        Xmuu \
                    248:        Xpm \
                    249:        Xrandr \
                    250:        Xrender \
                    251:        Xss \
                    252:        Xt \
                    253:        Xtst \
                    254:        Xv \
                    255:        Xxf86dga \
                    256:        Xxf86misc \
                    257:        Xxf86vm \
                    258:        dps \
                    259:        fntstubs \
                    260:        fontcache \
                    261:        fontconfig \
                    262:        fontenc \
                    263:        freetype \
                    264:        lbxutil \
                    265:        xkbfile
1.202     lukem     266: .ifndef LIB${_lib:tu}
1.233     rtr       267: LIB${_lib:tu}= ${DESTDIR}${X11USRLIBDIR}/lib${_lib}.a
1.202     lukem     268: .MADE:         ${LIB${_lib:tu}}        # Note: ${DESTDIR} will be expanded
                    269: .endif
                    270: .endfor
                    271:
1.204     lukem     272: .if defined(RESCUEDIR)
                    273: CPPFLAGS+=     -DRESCUEDIR=\"${RESCUEDIR}\"
                    274: .endif
                    275:
1.144     lukem     276: _PROGLDOPTS=
                    277: .if ${SHLINKDIR} != "/usr/libexec"     # XXX: change or remove if ld.so moves
                    278: _PROGLDOPTS+=  -Wl,-dynamic-linker=${_SHLINKER}
1.161     itohy     279: .endif
1.187     lukem     280: .if ${SHLIBDIR} != "/usr/lib"
1.264     joerg     281: _PROGLDOPTS+=  -Wl,-rpath,${SHLIBDIR} \
1.263     joerg     282:                -L=${SHLIBDIR}
1.277     joerg     283: .elif ${SHLIBINSTALLDIR} != "/usr/lib"
                    284: _PROGLDOPTS+=  -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR} \
                    285:                -L=${SHLIBINSTALLDIR}
1.144     lukem     286: .endif
                    287:
1.223     jmmv      288: __proginstall: .USE
                    289:        ${_MKTARGET_INSTALL}
                    290:        ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
                    291:                ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
                    292:
1.255     pooka     293: __progrumpinstall: .USE
                    294:        ${_MKTARGET_INSTALL}
                    295:        ${INSTALL_FILE} -o ${RUMPBINOWN} -g ${RUMPBINGRP} -m ${RUMPBINMODE} \
                    296:                ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
                    297:
1.223     jmmv      298: __progdebuginstall: .USE
                    299:        ${_MKTARGET_INSTALL}
                    300:        ${INSTALL_FILE} -o ${DEBUGOWN} -g ${DEBUGGRP} -m ${DEBUGMODE} \
                    301:                ${.ALLSRC} ${.TARGET}
                    302:
                    303:
                    304:
                    305: #
                    306: # Backwards compatibility with Makefiles that assume that bsd.prog.mk
                    307: # can only build a single binary.
                    308: #
                    309:
                    310: _APPEND_MANS=yes
                    311: _APPEND_SRCS=yes
                    312:
1.231     lukem     313: _CCLINKFLAGS=
                    314:
1.145     thorpej   315: .if defined(PROG_CXX)
1.223     jmmv      316: PROG=          ${PROG_CXX}
1.231     lukem     317: _CCLINK=       ${CXX} ${_CCLINKFLAGS}
1.223     jmmv      318: .endif
                    319:
1.255     pooka     320: .if defined(RUMPPRG)
                    321: PROG=                  ${RUMPPRG}
1.275     christos  322: . ifndef CRUNCHEDPROG
                    323: .  if (${MKRUMP} != "no")
1.255     pooka     324: PROGS=                 ${RUMPPRG} rump.${RUMPPRG}
1.275     christos  325: .  else
                    326: PROGS=                 ${RUMPPRG}
                    327: .  endif
                    328: .  if defined(SRCS)
                    329: .   if (${MKRUMP} != "no")
1.255     pooka     330: SRCS.rump.${PROG}:=    ${SRCS} ${PROG}_rumpops.c ${RUMPSRCS}
1.275     christos  331: .   endif
1.255     pooka     332: SRCS+=                 ${PROG}_hostops.c
1.275     christos  333: .  else
1.255     pooka     334: SRCS=                  ${PROG}.c ${PROG}_hostops.c
1.275     christos  335: .   if (${MKRUMP} != "no")
1.255     pooka     336: SRCS.rump.${PROG}=     ${PROG}.c ${PROG}_rumpops.c ${RUMPSRCS}
1.275     christos  337: .   endif
                    338: .  endif
                    339: .   if (${MKRUMP} != "no")
1.257     pooka     340: DPSRCS+=               ${PROG}_rumpops.c ${RUMPSRCS}
1.255     pooka     341: LDADD.rump.${PROG}+=   -lrumpclient
                    342: DPADD.rump.${PROG}+=   ${LIBRUMPCLIENT}
                    343: MAN.rump.${PROG}=      # defined but feeling empty
                    344: _RUMPINSTALL.rump.${PROG}=# defined
1.275     christos  345: .   endif
                    346: . else # CRUNCHEDPROG
1.256     pooka     347: PROGS=                 ${PROG}
                    348: CPPFLAGS+=             -DCRUNCHOPS
1.275     christos  349: . endif
1.255     pooka     350: .endif
                    351:
1.223     jmmv      352: .if defined(PROG)
1.231     lukem     353: _CCLINK?=      ${CC} ${_CCLINKFLAGS}
1.223     jmmv      354: .  if defined(MAN)
                    355: MAN.${PROG}=   ${MAN}
                    356: _APPEND_MANS=  no
                    357: .  endif
                    358: .  if !defined(OBJS)
                    359: OBJS=          ${OBJS.${PROG}}
                    360: .  endif
                    361: .  if defined(PROGNAME)
                    362: PROGNAME.${PROG}=      ${PROGNAME}
                    363: .  endif
                    364: .  if defined(SRCS)
                    365: SRCS.${PROG}=  ${SRCS}
                    366: _APPEND_SRCS=  no
                    367: .  endif
                    368: .endif
                    369:
                    370: # Turn the single-program PROG and PROG_CXX variables into their multi-word
                    371: # counterparts, PROGS and PROGS_CXX.
1.255     pooka     372: .if !defined(RUMPPRG)
                    373: .  if defined(PROG_CXX) && !defined(PROGS_CXX)
1.223     jmmv      374: PROGS_CXX=     ${PROG_CXX}
1.262     jmmv      375: .  elif defined(PROG) && !defined(PROGS)
1.223     jmmv      376: PROGS=         ${PROG}
1.255     pooka     377: .  endif
1.223     jmmv      378: .endif
                    379:
1.281   ! christos  380: ##### Libraries that this may depend upon.
        !           381: .if defined(PROGDPLIBS)                                                # {
        !           382: .for _lib _dir in ${PROGDPLIBS}
        !           383: .if !defined(BINDO.${_lib})
        !           384: BINDO.${_lib}!=        cd "${_dir}" && ${PRINTOBJDIR}
        !           385: .MAKEOVERRIDES+=BINDO.${_lib}
        !           386: .endif
        !           387: LDADD+=                -L${BINDO.${_lib}} -l${_lib}
        !           388: .if ${MKPICLIB} != "no"
        !           389: DPADD+=                ${BINDO.${_lib}}/libamu_pic.a
        !           390: .elif ${MKPIC} != "no"
        !           391: DPADD+=                ${BINDO.${_lib}}/libamu.so
        !           392: .else
        !           393: DPADD+=                ${BINDO.${_lib}}/libamu.a
        !           394: .endif
        !           395: .endfor
        !           396: .endif                                                                 # }
1.223     jmmv      397: #
                    398: # Per-program definitions and targets.
                    399: #
                    400:
1.271     matt      401: _CCLINK.CDEFAULT= ${CC} ${_CCLINKFLAGS}
1.223     jmmv      402: # Definitions specific to C programs.
                    403: .for _P in ${PROGS}
                    404: SRCS.${_P}?=   ${_P}.c
1.231     lukem     405: _CCLINK.${_P}= ${CC} ${_CCLINKFLAGS}
1.271     matt      406: _CFLAGS.${_P}= ${CFLAGS} ${CPUFLAGS}
                    407: _CPPFLAGS.${_P}=       ${CPPFLAGS}
                    408: _COPTS.${_P}=  ${COPTS}
1.223     jmmv      409: .endfor
                    410:
1.271     matt      411: _CCLINK.CXXDEFAULT= ${CXX} ${_CCLINKFLAGS}
1.223     jmmv      412: # Definitions specific to C++ programs.
                    413: .for _P in ${PROGS_CXX}
                    414: SRCS.${_P}?=   ${_P}.cc
1.231     lukem     415: _CCLINK.${_P}= ${CXX} ${_CCLINKFLAGS}
1.223     jmmv      416: .endfor
                    417:
                    418: # Language-independent definitions.
                    419: .for _P in ${PROGS} ${PROGS_CXX}                                       # {
                    420:
                    421: BINDIR.${_P}?=         ${BINDIR}
                    422: PROGNAME.${_P}?=       ${_P}
                    423:
1.249     mrg       424: .if ${MKDEBUG} != "no" && !commands(${_P})
1.223     jmmv      425: _PROGDEBUG.${_P}:=     ${PROGNAME.${_P}}.debug
1.145     thorpej   426: .endif
                    427:
1.223     jmmv      428: .if defined(PAXCTL_FLAGS)
                    429: PAXCTL_FLAGS.${_P}?= ${PAXCTL_FLAGS}
1.215     lukem     430: .endif
                    431:
1.223     jmmv      432: ##### PROG specific flags.
1.244     uebayasi  433:
1.278     jmmv      434: _DPADD.${_P}=          ${DPADD}    ${DPADD.${_P}}
1.223     jmmv      435: _LDADD.${_P}=          ${LDADD}    ${LDADD.${_P}}
                    436: _LDFLAGS.${_P}=                ${LDFLAGS}  ${LDFLAGS.${_P}}
                    437: _LDSTATIC.${_P}=       ${LDSTATIC} ${LDSTATIC.${_P}}
                    438:
                    439: ##### Build and install rules
                    440: .if !empty(_APPEND_SRCS:M[Yy][Ee][Ss])
1.271     matt      441: SRCS+=         ${SRCS.${_P}}   # For bsd.dep.mk
1.223     jmmv      442: .endif
                    443:
                    444: _YPSRCS.${_P}= ${SRCS.${_P}:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS.${_P}:M*.y:.y=.h}}
                    445:
                    446: DPSRCS+=               ${_YPSRCS.${_P}}
                    447: CLEANFILES+=           ${_YPSRCS.${_P}}
                    448:
                    449: .if !empty(SRCS.${_P}:N*.h:N*.sh:N*.fth)
                    450: OBJS.${_P}+=   ${SRCS.${_P}:N*.h:N*.sh:N*.fth:R:S/$/.o/g}
                    451: LOBJS.${_P}+=  ${LSRCS:.c=.ln} ${SRCS.${_P}:M*.c:.c=.ln}
1.157     thorpej   452: .endif
                    453:
1.223     jmmv      454: .if defined(OBJS.${_P}) && !empty(OBJS.${_P})                  # {
                    455: .NOPATH: ${OBJS.${_P}} ${_P} ${_YPSRCS.${_P}}
                    456:
1.271     matt      457: .if (defined(USE_COMBINE) && ${USE_COMBINE} != "no" && !commands(${_P}) \
                    458:    && (${_CCLINK.${_P}} == ${_CCLINK.CDEFAULT} \
                    459:        || ${_CCLINK.${_P}} == ${_CCLINK.CXXDEFAULT}) \
                    460:    && !defined(NOCOMBINE.${_P}) && !defined(NOCOMBINE))
                    461: .for f in ${SRCS.${_P}:N*.h:N*.sh:N*.fth:C/\.[yl]$/.c/g}
                    462: #_XFLAGS.$f := ${CPPFLAGS.$f:D1} ${CPUFLAGS.$f:D2} \
                    463: #     ${COPTS.$f:D3} ${OBJCOPTS.$f:D4} ${CXXFLAGS.$f:D5}
                    464: .if (${CPPFLAGS.$f:D1} == "1" || ${CPUFLAGS.$f:D2} == "2" \
                    465:      || ${COPTS.$f:D3} == "3" || ${OBJCOPTS.$f:D4} == "4" \
                    466:      || ${CXXFLAGS.$f:D5} == "5") \
                    467:     || ("${f:M*.[cyl]}" == "" || commands(${f:R:S/$/.o/}))
                    468: XOBJS.${_P}+=  ${f:R:S/$/.o/}
                    469: .else
                    470: XSRCS.${_P}+=  ${f}
                    471: NODPSRCS+=     ${f}
                    472: .endif
                    473: .endfor
                    474:
1.278     jmmv      475: ${_P}: .gdbinit ${LIBCRT0} ${XOBJS.${_P}} ${SRCS.${_P}} ${DPSRCS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${_DPADD.${_P}}
1.271     matt      476:        ${_MKTARGET_LINK}
                    477: .if defined(DESTDIR)
                    478:        ${_CCLINK.${_P}} -Wl,-nostdlib \
                    479:            ${_LDFLAGS.${_P}} ${_LDSTATIC.${_P}} -o ${.TARGET} ${_PROGLDOPTS} \
                    480:            -B${_GCC_CRTDIR}/ -B${DESTDIR}/usr/lib/ \
                    481:            -MD --combine ${_CPPFLAGS.${_P}} ${_CFLAGS.${_P}} ${_COPTS.${_P}} \
                    482:            ${XSRCS.${_P}:@.SRC.@${.ALLSRC:M*.c:M*${.SRC.}}@:O:u} ${XOBJS.${_P}} \
                    483:            ${_LDADD.${_P}} -L${_GCC_LIBGCCDIR} -L${DESTDIR}/usr/lib
                    484: .else
                    485:        ${_CCLINK.${_P}} ${_LDFLAGS.${_P}} ${_LDSTATIC.${_P}} -o ${.TARGET} ${_PROGLDOPTS} \
                    486:            -MD --combine ${_CPPFLAGS.${_P}} ${_COPTS.${_P}}
                    487:            ${XSRCS.${_P}:@.SRC.@${.ALLSRC:M*.c:M*${.SRC.}}@:O:u} ${XOBJS.${_P}} \
                    488:            ${_LDADD.${_P}}
                    489: .endif # defined(DESTDIR)
                    490: .if defined(CTFMERGE)
                    491:        ${CTFMERGE} ${CTFMFLAGS} -o ${.TARGET} ${OBJS.${_P}}
                    492: .endif
                    493: .if defined(PAXCTL_FLAGS.${_P})
                    494:        ${PAXCTL} ${PAXCTL_FLAGS.${_P}} ${.TARGET}
                    495: .endif
                    496: .if ${MKSTRIPIDENT} != "no"
                    497:        ${OBJCOPY} -R .ident ${.TARGET}
                    498: .endif
                    499:
                    500: CLEANFILES+=   ${_P}.d
                    501: .if exists(${_P}.d)
                    502: .include "${_P}.d"             # include -MD depend for program.
                    503: .endif
                    504: .else  # USE_COMBINE
                    505:
1.223     jmmv      506: ${OBJS.${_P}} ${LOBJS.${_P}}: ${DPSRCS}
1.182     lukem     507:
1.278     jmmv      508: ${_P}: .gdbinit ${LIBCRT0} ${OBJS.${_P}} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${_DPADD.${_P}}
1.223     jmmv      509: .if !commands(${_P})
1.194     lukem     510:        ${_MKTARGET_LINK}
1.231     lukem     511:        ${_CCLINK.${_P}} \
1.232     lukem     512:            ${_LDFLAGS.${_P}} ${_LDSTATIC.${_P}} -o ${.TARGET} \
                    513:            ${OBJS.${_P}} ${_LDADD.${_P}} \
                    514:            ${_PROGLDOPTS}
1.247     darran    515: .if defined(CTFMERGE)
                    516:        ${CTFMERGE} ${CTFMFLAGS} -o ${.TARGET} ${OBJS.${_P}}
                    517: .endif
1.223     jmmv      518: .if defined(PAXCTL_FLAGS.${_P})
                    519:        ${PAXCTL} ${PAXCTL_FLAGS.${_P}} ${.TARGET}
1.218     christos  520: .endif
1.235     joerg     521: .if ${MKSTRIPIDENT} != "no"
                    522:        ${OBJCOPY} -R .ident ${.TARGET}
                    523: .endif
1.223     jmmv      524: .endif # !commands(${_P})
1.271     matt      525: .endif # USE_COMBINE
1.183     dsl       526:
1.278     jmmv      527: ${_P}.ro: ${OBJS.${_P}} ${_DPADD.${_P}}
1.207     dsl       528:        ${_MKTARGET_LINK}
1.254     joerg     529:        ${CC} ${LDFLAGS} -nostdlib -r -Wl,-dc -o ${.TARGET} ${OBJS.${_P}}
1.1       cgd       530:
1.223     jmmv      531: .if defined(_PROGDEBUG.${_P})
1.224     jmmv      532: ${_PROGDEBUG.${_P}}: ${_P}
1.215     lukem     533:        ${_MKTARGET_CREATE}
1.251     lukem     534:        (  ${OBJCOPY} --only-keep-debug ${_P} ${_PROGDEBUG.${_P}} \
                    535:        && ${OBJCOPY} --strip-debug -p -R .gnu_debuglink \
                    536:                --add-gnu-debuglink=${_PROGDEBUG.${_P}} ${_P} \
                    537:        ) || (rm -f ${_PROGDEBUG.${_P}}; false)
1.215     lukem     538: .endif
                    539:
1.223     jmmv      540: .endif # defined(OBJS.${_P}) && !empty(OBJS.${_P})                     # }
1.1       cgd       541:
1.223     jmmv      542: .if !defined(MAN.${_P})
                    543: MAN.${_P}=     ${_P}.1
                    544: .endif # !defined(MAN.${_P})
                    545: .if !empty(_APPEND_MANS:M[Yy][Ee][Ss])
                    546: MAN+=          ${MAN.${_P}}
                    547: .endif
1.11      mycroft   548:
1.223     jmmv      549: realall: ${_P} ${_PROGDEBUG.${_P}}
1.1       cgd       550:
1.267     apb       551: CLEANFILES+= ${_P} ${_PROGDEBUG.${_P}}
1.134     tls       552:
1.223     jmmv      553: .if defined(OBJS.${_P}) && !empty(OBJS.${_P})
1.267     apb       554: CLEANFILES+= ${OBJS.${_P}} ${LOBJS.${_P}}
1.59      cgd       555: .endif
1.27      mycroft   556:
1.223     jmmv      557: _PROG_INSTALL+=        proginstall-${_P}
1.114     mycroft   558:
1.223     jmmv      559: .if !target(proginstall-${_P})                                         # {
                    560: proginstall-${_P}::    ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} \
                    561:                ${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}}
                    562: .PRECIOUS:     ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} \
                    563:                ${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}}
1.215     lukem     564:
1.172     lukem     565: .if ${MKUPDATE} == "no"
1.255     pooka     566: .if defined(_RUMPINSTALL.${_P})
                    567: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! ${_P} __progrumpinstall
                    568: .else
1.223     jmmv      569: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! ${_P} __proginstall
1.255     pooka     570: .endif
1.223     jmmv      571: .if !defined(BUILD) && !make(all) && !make(${_P})
                    572: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! .MADE
                    573: .endif
                    574: .if defined(_PROGDEBUG.${_P})
                    575: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}! ${_PROGDEBUG.${_P}} __progdebuginstall
                    576: .if !defined(BUILD) && !make(all) && !make(${_P})
                    577: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}! .MADE
1.215     lukem     578: .endif
1.223     jmmv      579: .endif #  define(_PROGDEBUG.${_P})
1.215     lukem     580: .else  # MKUPDATE != no
1.255     pooka     581: .if defined(_RUMPINSTALL.${_P})
                    582: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __progrumpinstall
                    583: .else
1.223     jmmv      584: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __proginstall
1.255     pooka     585: .endif
1.223     jmmv      586: .if !defined(BUILD) && !make(all) && !make(${_P})
                    587: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: .MADE
                    588: .endif
                    589: .if defined(_PROGDEBUG.${_P})
                    590: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}: ${_PROGDEBUG.${_P}} __progdebuginstall
                    591: .if !defined(BUILD) && !make(all) && !make(${_P})
                    592: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}: .MADE
1.154     mycroft   593: .endif
1.223     jmmv      594: .endif #  defined(_PROGDEBUG.${_P})
1.215     lukem     595: .endif # MKUPDATE != no
                    596:
1.223     jmmv      597: .endif # !target(proginstall-${_P})                                    # }
                    598:
                    599: lint: lint-${_P}
                    600: lint-${_P}: ${LOBJS.${_P}}
                    601: .if defined(LOBJS.${_P}) && !empty(LOBJS.${_P})
                    602:        ${LINT} ${LINTFLAGS} ${_LDFLAGS.${_P}:C/-L[  ]*/-L/Wg:M-L*} ${LOBJS.${_P}} ${_LDADD.${_P}}
                    603: .endif
                    604:
                    605: .endfor # _P in ${PROGS} ${PROGS_CXX}                                  # }
1.23      mycroft   606:
1.225     jmmv      607: .if defined(OBJS) && !empty(OBJS) && \
                    608:     (empty(PROGS) && empty(PROGS_CXX))
1.267     apb       609: CLEANFILES+= ${OBJS} ${LOBJS}
1.225     jmmv      610: .endif
                    611:
1.74      mycroft   612: .if !target(proginstall)
1.223     jmmv      613: proginstall:: ${_PROG_INSTALL}
1.74      mycroft   614: .endif
1.197     lukem     615: .PHONY:                proginstall
1.74      mycroft   616:
1.223     jmmv      617:
                    618:
                    619: realall: ${SCRIPTS}
1.215     lukem     620: .if defined(SCRIPTS) && !target(scriptsinstall)                                # {
1.65      mycroft   621: SCRIPTSDIR?=${BINDIR}
                    622: SCRIPTSOWN?=${BINOWN}
                    623: SCRIPTSGRP?=${BINGRP}
                    624: SCRIPTSMODE?=${BINMODE}
1.113     mycroft   625:
                    626: scriptsinstall:: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.114     mycroft   627: .PRECIOUS: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.113     mycroft   628:
1.115     mycroft   629: __scriptinstall: .USE
1.192     lukem     630:        ${_MKTARGET_INSTALL}
1.139     tv        631:        ${INSTALL_FILE} \
1.116     mycroft   632:            -o ${SCRIPTSOWN_${.ALLSRC:T}:U${SCRIPTSOWN}} \
                    633:            -g ${SCRIPTSGRP_${.ALLSRC:T}:U${SCRIPTSGRP}} \
                    634:            -m ${SCRIPTSMODE_${.ALLSRC:T}:U${SCRIPTSMODE}} \
1.209     jwise     635:            ${.ALLSRC} ${.TARGET}
1.115     mycroft   636:
1.130     sommerfe  637: .for S in ${SCRIPTS:O:u}
1.172     lukem     638: .if ${MKUPDATE} == "no"
1.154     mycroft   639: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}! ${S} __scriptinstall
                    640: .if !defined(BUILD) && !make(all) && !make(${S})
                    641: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}! .MADE
                    642: .endif
                    643: .else
                    644: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: ${S} __scriptinstall
1.103     fredb     645: .if !defined(BUILD) && !make(all) && !make(${S})
1.113     mycroft   646: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: .MADE
1.63      christos  647: .endif
1.154     mycroft   648: .endif
1.63      christos  649: .endfor
1.215     lukem     650: .endif                                                                 # }
1.1       cgd       651:
1.74      mycroft   652: .if !target(scriptsinstall)
                    653: scriptsinstall::
1.1       cgd       654: .endif
1.197     lukem     655: .PHONY:                scriptsinstall
1.1       cgd       656:
1.138     tv        657: ##### Pull in related .mk logic
1.241     apb       658: LINKSOWN?= ${BINOWN}
                    659: LINKSGRP?= ${BINGRP}
                    660: LINKSMODE?= ${BINMODE}
1.1       cgd       661: .include <bsd.man.mk>
1.50      jtc       662: .include <bsd.nls.mk>
1.66      christos  663: .include <bsd.files.mk>
1.63      christos  664: .include <bsd.inc.mk>
1.83      mycroft   665: .include <bsd.links.mk>
1.180     lukem     666: .include <bsd.sys.mk>
1.26      mycroft   667: .include <bsd.dep.mk>
1.266     joerg     668: .include <bsd.clang-analyze.mk>
1.267     apb       669: .include <bsd.clean.mk>
1.240     cube      670:
1.138     tv        671: ${TARGETS}:    # ensure existence
1.166     lukem     672:
                    673: .endif # HOSTPROG

CVSweb <webmaster@jp.NetBSD.org>