[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.271

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

CVSweb <webmaster@jp.NetBSD.org>