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

1.274   ! tron        1: #      $NetBSD: bsd.prog.mk,v 1.273 2012/02/21 01:41:09 matt 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 \
1.274   ! tron      110:        expat \
1.268     christos  111:        fetch \
                    112:        fl \
                    113:        form \
                    114:        g2c \
                    115:        gcc \
                    116:        gnumalloc \
                    117:        gssapi \
                    118:        hdb \
                    119:        heimbase \
                    120:        heimntlm \
                    121:        hx509 \
                    122:        intl \
                    123:        ipsec \
                    124:        isc \
                    125:        isccc \
                    126:        isccfg \
                    127:        kadm5clnt \
                    128:        kadm5srv \
                    129:        kafs \
                    130:        krb5 \
                    131:        kvm \
                    132:        l \
                    133:        lber \
                    134:        ldap \
                    135:        ldap_r \
                    136:        lua \
                    137:        lwres \
                    138:        m \
                    139:        magic \
                    140:        menu \
                    141:        objc \
                    142:        ossaudio \
                    143:        pam \
                    144:        pcap \
                    145:        pci \
                    146:        pmc \
                    147:        posix \
                    148:        pthread \
                    149:        pthread_dbg \
                    150:        puffs \
                    151:        quota \
                    152:        radius \
                    153:        resolv \
                    154:        rmt \
                    155:        roken \
                    156:        rpcsvc \
                    157:        rt \
                    158:        rump \
                    159:        rumpfs_cd9660fs \
                    160:        rumpfs_efs \
                    161:        rumpfs_ext2fs \
                    162:        rumpfs_ffs \
                    163:        rumpfs_hfs \
                    164:        rumpfs_lfs \
                    165:        rumpfs_msdosfs \
                    166:        rumpfs_nfs \
                    167:        rumpfs_ntfs \
                    168:        rumpfs_syspuffs \
                    169:        rumpfs_tmpfs \
                    170:        rumpfs_udf \
                    171:        rumpfs_ufs \
                    172:        rumpuser \
                    173:        saslc \
                    174:        skey \
                    175:        sl \
                    176:        sqlite3 \
                    177:        ss \
                    178:        ssh \
                    179:        ssl \
                    180:        ssp \
1.269     christos  181:        stdcxx \
                    182:        supcxx \
1.268     christos  183:        terminfo \
1.270     christos  184:        tre \
1.268     christos  185:        usbhid \
                    186:        util \
                    187:        wind \
                    188:        wrap \
                    189:        y \
                    190:        z
1.202     lukem     191: .ifndef LIB${_lib:tu}
1.269     christos  192: LIB${_lib:tu}= ${DESTDIR}/usr/lib/lib${_lib:S/xx/++/:S/atf_c/atf-c/}.a
1.202     lukem     193: .MADE:         ${LIB${_lib:tu}}        # Note: ${DESTDIR} will be expanded
                    194: .endif
                    195: .endfor
1.269     christos  196:
1.206     he        197: # PAM applications, if linked statically, need more libraries
                    198: .if (${MKPIC} == "no")
1.208     christos  199: .if (${MKCRYPTO} != "no")
                    200: PAM_STATIC_LDADD+= -lssh
                    201: PAM_STATIC_DPADD+= ${LIBSSH}
                    202: .endif
                    203: .if (${MKKERBEROS} != "no")
1.265     he        204: PAM_STATIC_LDADD+= -lkafs -lkrb5 -lhx509 -lwind -lasn1 \
                    205:        -lroken -lcom_err -lheimbase -lcrypto
                    206: PAM_STATIC_DPADD+= ${LIBKAFS} ${LIBKRB5} ${LIBHX509} ${LIBWIND} ${LIBASN1} \
                    207:        ${LIBROKEN} ${LIBCOM_ERR} ${LIBHEIMBASE} ${LIBCRYPTO}
1.208     christos  208: .endif
                    209: .if (${MKSKEY} != "no")
                    210: PAM_STATIC_LDADD+= -lskey
                    211: PAM_STATIC_DPADD+= ${LIBSKEY}
                    212: .endif
                    213: PAM_STATIC_LDADD+= -lradius -lcrypt -lrpcsvc -lutil
                    214: PAM_STATIC_DPADD+= ${LIBRADIUS} ${LIBCRYPT} ${LIBRPCSVC} ${LIBUTIL}
1.206     he        215: .else
                    216: PAM_STATIC_LDADD=
                    217: PAM_STATIC_DPADD=
                    218: .endif
                    219:
1.269     christos  220: #      NB:     If you are a library here, add it in bsd.README
1.202     lukem     221: .for _lib in \
1.268     christos  222:        FS \
                    223:        GL \
                    224:        GLU \
                    225:        ICE \
                    226:        SM \
                    227:        X11 \
                    228:        XTrap \
                    229:        Xau \
                    230:        Xaw \
                    231:        Xdmcp \
                    232:        Xext \
                    233:        Xfont \
                    234:        Xft \
                    235:        Xi \
                    236:        Xinerama \
                    237:        Xmu \
                    238:        Xmuu \
                    239:        Xpm \
                    240:        Xrandr \
                    241:        Xrender \
                    242:        Xss \
                    243:        Xt \
                    244:        Xtst \
                    245:        Xv \
                    246:        Xxf86dga \
                    247:        Xxf86misc \
                    248:        Xxf86vm \
                    249:        dps \
                    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: .if defined(CTFMERGE)
                    454:        ${CTFMERGE} ${CTFMFLAGS} -o ${.TARGET} ${OBJS.${_P}}
                    455: .endif
                    456: .if defined(PAXCTL_FLAGS.${_P})
                    457:        ${PAXCTL} ${PAXCTL_FLAGS.${_P}} ${.TARGET}
                    458: .endif
                    459: .if ${MKSTRIPIDENT} != "no"
                    460:        ${OBJCOPY} -R .ident ${.TARGET}
                    461: .endif
                    462:
                    463: CLEANFILES+=   ${_P}.d
                    464: .if exists(${_P}.d)
                    465: .include "${_P}.d"             # include -MD depend for program.
                    466: .endif
                    467: .else  # USE_COMBINE
                    468:
1.223     jmmv      469: ${OBJS.${_P}} ${LOBJS.${_P}}: ${DPSRCS}
1.182     lukem     470:
1.223     jmmv      471: ${_P}: .gdbinit ${LIBCRT0} ${OBJS.${_P}} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
                    472: .if !commands(${_P})
1.194     lukem     473:        ${_MKTARGET_LINK}
1.231     lukem     474:        ${_CCLINK.${_P}} \
1.232     lukem     475:            ${_LDFLAGS.${_P}} ${_LDSTATIC.${_P}} -o ${.TARGET} \
                    476:            ${OBJS.${_P}} ${_LDADD.${_P}} \
                    477:            ${_PROGLDOPTS}
1.247     darran    478: .if defined(CTFMERGE)
                    479:        ${CTFMERGE} ${CTFMFLAGS} -o ${.TARGET} ${OBJS.${_P}}
                    480: .endif
1.223     jmmv      481: .if defined(PAXCTL_FLAGS.${_P})
                    482:        ${PAXCTL} ${PAXCTL_FLAGS.${_P}} ${.TARGET}
1.218     christos  483: .endif
1.235     joerg     484: .if ${MKSTRIPIDENT} != "no"
                    485:        ${OBJCOPY} -R .ident ${.TARGET}
                    486: .endif
1.223     jmmv      487: .endif # !commands(${_P})
1.271     matt      488: .endif # USE_COMBINE
1.183     dsl       489:
1.223     jmmv      490: ${_P}.ro: ${OBJS.${_P}} ${DPADD}
1.207     dsl       491:        ${_MKTARGET_LINK}
1.254     joerg     492:        ${CC} ${LDFLAGS} -nostdlib -r -Wl,-dc -o ${.TARGET} ${OBJS.${_P}}
1.1       cgd       493:
1.223     jmmv      494: .if defined(_PROGDEBUG.${_P})
1.224     jmmv      495: ${_PROGDEBUG.${_P}}: ${_P}
1.215     lukem     496:        ${_MKTARGET_CREATE}
1.251     lukem     497:        (  ${OBJCOPY} --only-keep-debug ${_P} ${_PROGDEBUG.${_P}} \
                    498:        && ${OBJCOPY} --strip-debug -p -R .gnu_debuglink \
                    499:                --add-gnu-debuglink=${_PROGDEBUG.${_P}} ${_P} \
                    500:        ) || (rm -f ${_PROGDEBUG.${_P}}; false)
1.215     lukem     501: .endif
                    502:
1.223     jmmv      503: .endif # defined(OBJS.${_P}) && !empty(OBJS.${_P})                     # }
1.1       cgd       504:
1.223     jmmv      505: .if !defined(MAN.${_P})
                    506: MAN.${_P}=     ${_P}.1
                    507: .endif # !defined(MAN.${_P})
                    508: .if !empty(_APPEND_MANS:M[Yy][Ee][Ss])
                    509: MAN+=          ${MAN.${_P}}
                    510: .endif
1.11      mycroft   511:
1.223     jmmv      512: realall: ${_P} ${_PROGDEBUG.${_P}}
1.1       cgd       513:
1.267     apb       514: CLEANFILES+= ${_P} ${_PROGDEBUG.${_P}}
1.134     tls       515:
1.223     jmmv      516: .if defined(OBJS.${_P}) && !empty(OBJS.${_P})
1.267     apb       517: CLEANFILES+= ${OBJS.${_P}} ${LOBJS.${_P}}
1.59      cgd       518: .endif
1.27      mycroft   519:
1.223     jmmv      520: _PROG_INSTALL+=        proginstall-${_P}
1.114     mycroft   521:
1.223     jmmv      522: .if !target(proginstall-${_P})                                         # {
                    523: proginstall-${_P}::    ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} \
                    524:                ${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}}
                    525: .PRECIOUS:     ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} \
                    526:                ${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}}
1.215     lukem     527:
1.172     lukem     528: .if ${MKUPDATE} == "no"
1.255     pooka     529: .if defined(_RUMPINSTALL.${_P})
                    530: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! ${_P} __progrumpinstall
                    531: .else
1.223     jmmv      532: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! ${_P} __proginstall
1.255     pooka     533: .endif
1.223     jmmv      534: .if !defined(BUILD) && !make(all) && !make(${_P})
                    535: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! .MADE
                    536: .endif
                    537: .if defined(_PROGDEBUG.${_P})
                    538: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}! ${_PROGDEBUG.${_P}} __progdebuginstall
                    539: .if !defined(BUILD) && !make(all) && !make(${_P})
                    540: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}! .MADE
1.215     lukem     541: .endif
1.223     jmmv      542: .endif #  define(_PROGDEBUG.${_P})
1.215     lukem     543: .else  # MKUPDATE != no
1.255     pooka     544: .if defined(_RUMPINSTALL.${_P})
                    545: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __progrumpinstall
                    546: .else
1.223     jmmv      547: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __proginstall
1.255     pooka     548: .endif
1.223     jmmv      549: .if !defined(BUILD) && !make(all) && !make(${_P})
                    550: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: .MADE
                    551: .endif
                    552: .if defined(_PROGDEBUG.${_P})
                    553: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}: ${_PROGDEBUG.${_P}} __progdebuginstall
                    554: .if !defined(BUILD) && !make(all) && !make(${_P})
                    555: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}: .MADE
1.154     mycroft   556: .endif
1.223     jmmv      557: .endif #  defined(_PROGDEBUG.${_P})
1.215     lukem     558: .endif # MKUPDATE != no
                    559:
1.223     jmmv      560: .endif # !target(proginstall-${_P})                                    # }
                    561:
                    562: lint: lint-${_P}
                    563: lint-${_P}: ${LOBJS.${_P}}
                    564: .if defined(LOBJS.${_P}) && !empty(LOBJS.${_P})
                    565:        ${LINT} ${LINTFLAGS} ${_LDFLAGS.${_P}:C/-L[  ]*/-L/Wg:M-L*} ${LOBJS.${_P}} ${_LDADD.${_P}}
                    566: .endif
                    567:
                    568: .endfor # _P in ${PROGS} ${PROGS_CXX}                                  # }
1.23      mycroft   569:
1.225     jmmv      570: .if defined(OBJS) && !empty(OBJS) && \
                    571:     (empty(PROGS) && empty(PROGS_CXX))
1.267     apb       572: CLEANFILES+= ${OBJS} ${LOBJS}
1.225     jmmv      573: .endif
                    574:
1.74      mycroft   575: .if !target(proginstall)
1.223     jmmv      576: proginstall:: ${_PROG_INSTALL}
1.74      mycroft   577: .endif
1.197     lukem     578: .PHONY:                proginstall
1.74      mycroft   579:
1.223     jmmv      580:
                    581:
                    582: realall: ${SCRIPTS}
1.215     lukem     583: .if defined(SCRIPTS) && !target(scriptsinstall)                                # {
1.65      mycroft   584: SCRIPTSDIR?=${BINDIR}
                    585: SCRIPTSOWN?=${BINOWN}
                    586: SCRIPTSGRP?=${BINGRP}
                    587: SCRIPTSMODE?=${BINMODE}
1.113     mycroft   588:
                    589: scriptsinstall:: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.114     mycroft   590: .PRECIOUS: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.113     mycroft   591:
1.115     mycroft   592: __scriptinstall: .USE
1.192     lukem     593:        ${_MKTARGET_INSTALL}
1.139     tv        594:        ${INSTALL_FILE} \
1.116     mycroft   595:            -o ${SCRIPTSOWN_${.ALLSRC:T}:U${SCRIPTSOWN}} \
                    596:            -g ${SCRIPTSGRP_${.ALLSRC:T}:U${SCRIPTSGRP}} \
                    597:            -m ${SCRIPTSMODE_${.ALLSRC:T}:U${SCRIPTSMODE}} \
1.209     jwise     598:            ${.ALLSRC} ${.TARGET}
1.115     mycroft   599:
1.130     sommerfe  600: .for S in ${SCRIPTS:O:u}
1.172     lukem     601: .if ${MKUPDATE} == "no"
1.154     mycroft   602: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}! ${S} __scriptinstall
                    603: .if !defined(BUILD) && !make(all) && !make(${S})
                    604: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}! .MADE
                    605: .endif
                    606: .else
                    607: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: ${S} __scriptinstall
1.103     fredb     608: .if !defined(BUILD) && !make(all) && !make(${S})
1.113     mycroft   609: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: .MADE
1.63      christos  610: .endif
1.154     mycroft   611: .endif
1.63      christos  612: .endfor
1.215     lukem     613: .endif                                                                 # }
1.1       cgd       614:
1.74      mycroft   615: .if !target(scriptsinstall)
                    616: scriptsinstall::
1.1       cgd       617: .endif
1.197     lukem     618: .PHONY:                scriptsinstall
1.1       cgd       619:
1.138     tv        620: ##### Pull in related .mk logic
1.241     apb       621: LINKSOWN?= ${BINOWN}
                    622: LINKSGRP?= ${BINGRP}
                    623: LINKSMODE?= ${BINMODE}
1.1       cgd       624: .include <bsd.man.mk>
1.50      jtc       625: .include <bsd.nls.mk>
1.66      christos  626: .include <bsd.files.mk>
1.63      christos  627: .include <bsd.inc.mk>
1.83      mycroft   628: .include <bsd.links.mk>
1.180     lukem     629: .include <bsd.sys.mk>
1.26      mycroft   630: .include <bsd.dep.mk>
1.266     joerg     631: .include <bsd.clang-analyze.mk>
1.267     apb       632: .include <bsd.clean.mk>
1.240     cube      633:
1.138     tv        634: ${TARGETS}:    # ensure existence
1.166     lukem     635:
                    636: .endif # HOSTPROG

CVSweb <webmaster@jp.NetBSD.org>