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

1.269   ! christos    1: #      $NetBSD: bsd.prog.mk,v 1.268 2011/10/16 01:14:33 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 \
                    183:        usbhid \
                    184:        util \
                    185:        wind \
                    186:        wrap \
                    187:        y \
                    188:        z
1.202     lukem     189: .ifndef LIB${_lib:tu}
1.269   ! christos  190: LIB${_lib:tu}= ${DESTDIR}/usr/lib/lib${_lib:S/xx/++/:S/atf_c/atf-c/}.a
1.202     lukem     191: .MADE:         ${LIB${_lib:tu}}        # Note: ${DESTDIR} will be expanded
                    192: .endif
                    193: .endfor
1.269   ! christos  194:
1.206     he        195: # PAM applications, if linked statically, need more libraries
                    196: .if (${MKPIC} == "no")
1.208     christos  197: .if (${MKCRYPTO} != "no")
                    198: PAM_STATIC_LDADD+= -lssh
                    199: PAM_STATIC_DPADD+= ${LIBSSH}
                    200: .endif
                    201: .if (${MKKERBEROS} != "no")
1.265     he        202: PAM_STATIC_LDADD+= -lkafs -lkrb5 -lhx509 -lwind -lasn1 \
                    203:        -lroken -lcom_err -lheimbase -lcrypto
                    204: PAM_STATIC_DPADD+= ${LIBKAFS} ${LIBKRB5} ${LIBHX509} ${LIBWIND} ${LIBASN1} \
                    205:        ${LIBROKEN} ${LIBCOM_ERR} ${LIBHEIMBASE} ${LIBCRYPTO}
1.208     christos  206: .endif
                    207: .if (${MKSKEY} != "no")
                    208: PAM_STATIC_LDADD+= -lskey
                    209: PAM_STATIC_DPADD+= ${LIBSKEY}
                    210: .endif
                    211: PAM_STATIC_LDADD+= -lradius -lcrypt -lrpcsvc -lutil
                    212: PAM_STATIC_DPADD+= ${LIBRADIUS} ${LIBCRYPT} ${LIBRPCSVC} ${LIBUTIL}
1.206     he        213: .else
                    214: PAM_STATIC_LDADD=
                    215: PAM_STATIC_DPADD=
                    216: .endif
                    217:
1.269   ! christos  218: #      NB:     If you are a library here, add it in bsd.README
1.202     lukem     219: .for _lib in \
1.268     christos  220:        FS \
                    221:        GL \
                    222:        GLU \
                    223:        ICE \
                    224:        SM \
                    225:        X11 \
                    226:        XTrap \
                    227:        Xau \
                    228:        Xaw \
                    229:        Xdmcp \
                    230:        Xext \
                    231:        Xfont \
                    232:        Xft \
                    233:        Xi \
                    234:        Xinerama \
                    235:        Xmu \
                    236:        Xmuu \
                    237:        Xpm \
                    238:        Xrandr \
                    239:        Xrender \
                    240:        Xss \
                    241:        Xt \
                    242:        Xtst \
                    243:        Xv \
                    244:        Xxf86dga \
                    245:        Xxf86misc \
                    246:        Xxf86vm \
                    247:        dps \
                    248:        expat \
                    249:        fntstubs \
                    250:        fontcache \
                    251:        fontconfig \
                    252:        fontenc \
                    253:        freetype \
                    254:        lbxutil \
                    255:        xkbfile
1.202     lukem     256: .ifndef LIB${_lib:tu}
1.233     rtr       257: LIB${_lib:tu}= ${DESTDIR}${X11USRLIBDIR}/lib${_lib}.a
1.202     lukem     258: .MADE:         ${LIB${_lib:tu}}        # Note: ${DESTDIR} will be expanded
                    259: .endif
                    260: .endfor
                    261:
1.204     lukem     262: .if defined(RESCUEDIR)
                    263: CPPFLAGS+=     -DRESCUEDIR=\"${RESCUEDIR}\"
                    264: .endif
                    265:
1.144     lukem     266: _PROGLDOPTS=
                    267: .if ${SHLINKDIR} != "/usr/libexec"     # XXX: change or remove if ld.so moves
                    268: _PROGLDOPTS+=  -Wl,-dynamic-linker=${_SHLINKER}
1.161     itohy     269: .endif
1.187     lukem     270: .if ${SHLIBDIR} != "/usr/lib"
1.264     joerg     271: _PROGLDOPTS+=  -Wl,-rpath,${SHLIBDIR} \
1.263     joerg     272:                -L=${SHLIBDIR}
1.187     lukem     273: .elif ${SHLIBINSTALLDIR} != "/usr/lib"
1.264     joerg     274: _PROGLDOPTS+=  -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR} \
1.263     joerg     275:                -L=${SHLIBINSTALLDIR}
1.144     lukem     276: .endif
                    277:
1.223     jmmv      278: __proginstall: .USE
                    279:        ${_MKTARGET_INSTALL}
                    280:        ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
                    281:                ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
                    282:
1.255     pooka     283: __progrumpinstall: .USE
                    284:        ${_MKTARGET_INSTALL}
                    285:        ${INSTALL_FILE} -o ${RUMPBINOWN} -g ${RUMPBINGRP} -m ${RUMPBINMODE} \
                    286:                ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
                    287:
1.223     jmmv      288: __progdebuginstall: .USE
                    289:        ${_MKTARGET_INSTALL}
                    290:        ${INSTALL_FILE} -o ${DEBUGOWN} -g ${DEBUGGRP} -m ${DEBUGMODE} \
                    291:                ${.ALLSRC} ${.TARGET}
                    292:
                    293:
                    294:
                    295: #
                    296: # Backwards compatibility with Makefiles that assume that bsd.prog.mk
                    297: # can only build a single binary.
                    298: #
                    299:
                    300: _APPEND_MANS=yes
                    301: _APPEND_SRCS=yes
                    302:
1.231     lukem     303: _CCLINKFLAGS=
                    304:
1.145     thorpej   305: .if defined(PROG_CXX)
1.223     jmmv      306: PROG=          ${PROG_CXX}
1.231     lukem     307: _CCLINK=       ${CXX} ${_CCLINKFLAGS}
1.223     jmmv      308: .endif
                    309:
1.255     pooka     310: .if defined(RUMPPRG)
                    311: PROG=                  ${RUMPPRG}
1.256     pooka     312: .ifndef CRUNCHEDPROG
1.255     pooka     313: PROGS=                 ${RUMPPRG} rump.${RUMPPRG}
                    314: . if defined(SRCS)
                    315: SRCS.rump.${PROG}:=    ${SRCS} ${PROG}_rumpops.c ${RUMPSRCS}
                    316: SRCS+=                 ${PROG}_hostops.c
                    317: . else
                    318: SRCS=                  ${PROG}.c ${PROG}_hostops.c
                    319: SRCS.rump.${PROG}=     ${PROG}.c ${PROG}_rumpops.c ${RUMPSRCS}
                    320: . endif
1.257     pooka     321: DPSRCS+=               ${PROG}_rumpops.c ${RUMPSRCS}
1.255     pooka     322: LDADD.rump.${PROG}+=   -lrumpclient
                    323: DPADD.rump.${PROG}+=   ${LIBRUMPCLIENT}
                    324: MAN.rump.${PROG}=      # defined but feeling empty
                    325: _RUMPINSTALL.rump.${PROG}=# defined
1.256     pooka     326: .else # CRUNCHEDPROG
                    327: PROGS=                 ${PROG}
                    328: CPPFLAGS+=             -DCRUNCHOPS
                    329: .endif
1.255     pooka     330: .endif
                    331:
1.223     jmmv      332: .if defined(PROG)
1.231     lukem     333: _CCLINK?=      ${CC} ${_CCLINKFLAGS}
1.223     jmmv      334: .  if defined(MAN)
                    335: MAN.${PROG}=   ${MAN}
                    336: _APPEND_MANS=  no
                    337: .  endif
                    338: .  if !defined(OBJS)
                    339: OBJS=          ${OBJS.${PROG}}
                    340: .  endif
                    341: .  if defined(PROGNAME)
                    342: PROGNAME.${PROG}=      ${PROGNAME}
                    343: .  endif
                    344: .  if defined(SRCS)
                    345: SRCS.${PROG}=  ${SRCS}
                    346: _APPEND_SRCS=  no
                    347: .  endif
                    348: .endif
                    349:
                    350: # Turn the single-program PROG and PROG_CXX variables into their multi-word
                    351: # counterparts, PROGS and PROGS_CXX.
1.255     pooka     352: .if !defined(RUMPPRG)
                    353: .  if defined(PROG_CXX) && !defined(PROGS_CXX)
1.223     jmmv      354: PROGS_CXX=     ${PROG_CXX}
1.262     jmmv      355: .  elif defined(PROG) && !defined(PROGS)
1.223     jmmv      356: PROGS=         ${PROG}
1.255     pooka     357: .  endif
1.223     jmmv      358: .endif
                    359:
                    360: #
                    361: # Per-program definitions and targets.
                    362: #
                    363:
                    364: # Definitions specific to C programs.
                    365: .for _P in ${PROGS}
                    366: SRCS.${_P}?=   ${_P}.c
1.231     lukem     367: _CCLINK.${_P}= ${CC} ${_CCLINKFLAGS}
1.223     jmmv      368: .endfor
                    369:
                    370: # Definitions specific to C++ programs.
                    371: .for _P in ${PROGS_CXX}
                    372: SRCS.${_P}?=   ${_P}.cc
1.231     lukem     373: _CCLINK.${_P}= ${CXX} ${_CCLINKFLAGS}
1.223     jmmv      374: .endfor
                    375:
                    376: # Language-independent definitions.
                    377: .for _P in ${PROGS} ${PROGS_CXX}                                       # {
                    378:
                    379: BINDIR.${_P}?=         ${BINDIR}
                    380: PROGNAME.${_P}?=       ${_P}
                    381:
1.249     mrg       382: .if ${MKDEBUG} != "no" && !commands(${_P})
1.223     jmmv      383: _PROGDEBUG.${_P}:=     ${PROGNAME.${_P}}.debug
1.145     thorpej   384: .endif
                    385:
1.223     jmmv      386: .if defined(PAXCTL_FLAGS)
                    387: PAXCTL_FLAGS.${_P}?= ${PAXCTL_FLAGS}
1.215     lukem     388: .endif
                    389:
1.223     jmmv      390: ##### PROG specific flags.
1.244     uebayasi  391:
1.223     jmmv      392: _LDADD.${_P}=          ${LDADD}    ${LDADD.${_P}}
                    393: _LDFLAGS.${_P}=                ${LDFLAGS}  ${LDFLAGS.${_P}}
                    394: _LDSTATIC.${_P}=       ${LDSTATIC} ${LDSTATIC.${_P}}
                    395:
                    396: ##### Build and install rules
                    397: .if !empty(_APPEND_SRCS:M[Yy][Ee][Ss])
                    398: SRCS+=         ${SRCS.${_P}} # For bsd.dep.mk
                    399: .endif
                    400:
                    401: _YPSRCS.${_P}= ${SRCS.${_P}:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS.${_P}:M*.y:.y=.h}}
                    402:
                    403: DPSRCS+=               ${_YPSRCS.${_P}}
                    404: CLEANFILES+=           ${_YPSRCS.${_P}}
                    405:
                    406: .if !empty(SRCS.${_P}:N*.h:N*.sh:N*.fth)
                    407: OBJS.${_P}+=   ${SRCS.${_P}:N*.h:N*.sh:N*.fth:R:S/$/.o/g}
                    408: LOBJS.${_P}+=  ${LSRCS:.c=.ln} ${SRCS.${_P}:M*.c:.c=.ln}
1.157     thorpej   409: .endif
                    410:
1.223     jmmv      411: .if defined(OBJS.${_P}) && !empty(OBJS.${_P})                  # {
                    412: .NOPATH: ${OBJS.${_P}} ${_P} ${_YPSRCS.${_P}}
                    413:
                    414: ${OBJS.${_P}} ${LOBJS.${_P}}: ${DPSRCS}
1.182     lukem     415:
1.223     jmmv      416: ${_P}: .gdbinit ${LIBCRT0} ${OBJS.${_P}} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
                    417: .if !commands(${_P})
1.194     lukem     418:        ${_MKTARGET_LINK}
1.231     lukem     419:        ${_CCLINK.${_P}} \
1.232     lukem     420:            ${_LDFLAGS.${_P}} ${_LDSTATIC.${_P}} -o ${.TARGET} \
                    421:            ${OBJS.${_P}} ${_LDADD.${_P}} \
                    422:            ${_PROGLDOPTS}
1.247     darran    423: .if defined(CTFMERGE)
                    424:        ${CTFMERGE} ${CTFMFLAGS} -o ${.TARGET} ${OBJS.${_P}}
                    425: .endif
1.223     jmmv      426: .if defined(PAXCTL_FLAGS.${_P})
                    427:        ${PAXCTL} ${PAXCTL_FLAGS.${_P}} ${.TARGET}
1.218     christos  428: .endif
1.235     joerg     429: .if ${MKSTRIPIDENT} != "no"
                    430:        ${OBJCOPY} -R .ident ${.TARGET}
                    431: .endif
1.223     jmmv      432: .endif # !commands(${_P})
1.183     dsl       433:
1.223     jmmv      434: ${_P}.ro: ${OBJS.${_P}} ${DPADD}
1.207     dsl       435:        ${_MKTARGET_LINK}
1.254     joerg     436:        ${CC} ${LDFLAGS} -nostdlib -r -Wl,-dc -o ${.TARGET} ${OBJS.${_P}}
1.1       cgd       437:
1.223     jmmv      438: .if defined(_PROGDEBUG.${_P})
1.224     jmmv      439: ${_PROGDEBUG.${_P}}: ${_P}
1.215     lukem     440:        ${_MKTARGET_CREATE}
1.251     lukem     441:        (  ${OBJCOPY} --only-keep-debug ${_P} ${_PROGDEBUG.${_P}} \
                    442:        && ${OBJCOPY} --strip-debug -p -R .gnu_debuglink \
                    443:                --add-gnu-debuglink=${_PROGDEBUG.${_P}} ${_P} \
                    444:        ) || (rm -f ${_PROGDEBUG.${_P}}; false)
1.215     lukem     445: .endif
                    446:
1.223     jmmv      447: .endif # defined(OBJS.${_P}) && !empty(OBJS.${_P})                     # }
1.1       cgd       448:
1.223     jmmv      449: .if !defined(MAN.${_P})
                    450: MAN.${_P}=     ${_P}.1
                    451: .endif # !defined(MAN.${_P})
                    452: .if !empty(_APPEND_MANS:M[Yy][Ee][Ss])
                    453: MAN+=          ${MAN.${_P}}
                    454: .endif
1.11      mycroft   455:
1.223     jmmv      456: realall: ${_P} ${_PROGDEBUG.${_P}}
1.1       cgd       457:
1.267     apb       458: CLEANFILES+= ${_P} ${_PROGDEBUG.${_P}}
1.134     tls       459:
1.223     jmmv      460: .if defined(OBJS.${_P}) && !empty(OBJS.${_P})
1.267     apb       461: CLEANFILES+= ${OBJS.${_P}} ${LOBJS.${_P}}
1.59      cgd       462: .endif
1.27      mycroft   463:
1.223     jmmv      464: _PROG_INSTALL+=        proginstall-${_P}
1.114     mycroft   465:
1.223     jmmv      466: .if !target(proginstall-${_P})                                         # {
                    467: proginstall-${_P}::    ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} \
                    468:                ${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}}
                    469: .PRECIOUS:     ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} \
                    470:                ${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}}
1.215     lukem     471:
1.172     lukem     472: .if ${MKUPDATE} == "no"
1.255     pooka     473: .if defined(_RUMPINSTALL.${_P})
                    474: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! ${_P} __progrumpinstall
                    475: .else
1.223     jmmv      476: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! ${_P} __proginstall
1.255     pooka     477: .endif
1.223     jmmv      478: .if !defined(BUILD) && !make(all) && !make(${_P})
                    479: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! .MADE
                    480: .endif
                    481: .if defined(_PROGDEBUG.${_P})
                    482: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}! ${_PROGDEBUG.${_P}} __progdebuginstall
                    483: .if !defined(BUILD) && !make(all) && !make(${_P})
                    484: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}! .MADE
1.215     lukem     485: .endif
1.223     jmmv      486: .endif #  define(_PROGDEBUG.${_P})
1.215     lukem     487: .else  # MKUPDATE != no
1.255     pooka     488: .if defined(_RUMPINSTALL.${_P})
                    489: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __progrumpinstall
                    490: .else
1.223     jmmv      491: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __proginstall
1.255     pooka     492: .endif
1.223     jmmv      493: .if !defined(BUILD) && !make(all) && !make(${_P})
                    494: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: .MADE
                    495: .endif
                    496: .if defined(_PROGDEBUG.${_P})
                    497: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}: ${_PROGDEBUG.${_P}} __progdebuginstall
                    498: .if !defined(BUILD) && !make(all) && !make(${_P})
                    499: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}: .MADE
1.154     mycroft   500: .endif
1.223     jmmv      501: .endif #  defined(_PROGDEBUG.${_P})
1.215     lukem     502: .endif # MKUPDATE != no
                    503:
1.223     jmmv      504: .endif # !target(proginstall-${_P})                                    # }
                    505:
                    506: lint: lint-${_P}
                    507: lint-${_P}: ${LOBJS.${_P}}
                    508: .if defined(LOBJS.${_P}) && !empty(LOBJS.${_P})
                    509:        ${LINT} ${LINTFLAGS} ${_LDFLAGS.${_P}:C/-L[  ]*/-L/Wg:M-L*} ${LOBJS.${_P}} ${_LDADD.${_P}}
                    510: .endif
                    511:
                    512: .endfor # _P in ${PROGS} ${PROGS_CXX}                                  # }
1.23      mycroft   513:
1.225     jmmv      514: .if defined(OBJS) && !empty(OBJS) && \
                    515:     (empty(PROGS) && empty(PROGS_CXX))
1.267     apb       516: CLEANFILES+= ${OBJS} ${LOBJS}
1.225     jmmv      517: .endif
                    518:
1.74      mycroft   519: .if !target(proginstall)
1.223     jmmv      520: proginstall:: ${_PROG_INSTALL}
1.74      mycroft   521: .endif
1.197     lukem     522: .PHONY:                proginstall
1.74      mycroft   523:
1.223     jmmv      524:
                    525:
                    526: realall: ${SCRIPTS}
1.215     lukem     527: .if defined(SCRIPTS) && !target(scriptsinstall)                                # {
1.65      mycroft   528: SCRIPTSDIR?=${BINDIR}
                    529: SCRIPTSOWN?=${BINOWN}
                    530: SCRIPTSGRP?=${BINGRP}
                    531: SCRIPTSMODE?=${BINMODE}
1.113     mycroft   532:
                    533: scriptsinstall:: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.114     mycroft   534: .PRECIOUS: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.113     mycroft   535:
1.115     mycroft   536: __scriptinstall: .USE
1.192     lukem     537:        ${_MKTARGET_INSTALL}
1.139     tv        538:        ${INSTALL_FILE} \
1.116     mycroft   539:            -o ${SCRIPTSOWN_${.ALLSRC:T}:U${SCRIPTSOWN}} \
                    540:            -g ${SCRIPTSGRP_${.ALLSRC:T}:U${SCRIPTSGRP}} \
                    541:            -m ${SCRIPTSMODE_${.ALLSRC:T}:U${SCRIPTSMODE}} \
1.209     jwise     542:            ${.ALLSRC} ${.TARGET}
1.115     mycroft   543:
1.130     sommerfe  544: .for S in ${SCRIPTS:O:u}
1.172     lukem     545: .if ${MKUPDATE} == "no"
1.154     mycroft   546: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}! ${S} __scriptinstall
                    547: .if !defined(BUILD) && !make(all) && !make(${S})
                    548: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}! .MADE
                    549: .endif
                    550: .else
                    551: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: ${S} __scriptinstall
1.103     fredb     552: .if !defined(BUILD) && !make(all) && !make(${S})
1.113     mycroft   553: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: .MADE
1.63      christos  554: .endif
1.154     mycroft   555: .endif
1.63      christos  556: .endfor
1.215     lukem     557: .endif                                                                 # }
1.1       cgd       558:
1.74      mycroft   559: .if !target(scriptsinstall)
                    560: scriptsinstall::
1.1       cgd       561: .endif
1.197     lukem     562: .PHONY:                scriptsinstall
1.1       cgd       563:
1.138     tv        564: ##### Pull in related .mk logic
1.241     apb       565: LINKSOWN?= ${BINOWN}
                    566: LINKSGRP?= ${BINGRP}
                    567: LINKSMODE?= ${BINMODE}
1.1       cgd       568: .include <bsd.man.mk>
1.50      jtc       569: .include <bsd.nls.mk>
1.66      christos  570: .include <bsd.files.mk>
1.63      christos  571: .include <bsd.inc.mk>
1.83      mycroft   572: .include <bsd.links.mk>
1.180     lukem     573: .include <bsd.sys.mk>
1.26      mycroft   574: .include <bsd.dep.mk>
1.266     joerg     575: .include <bsd.clang-analyze.mk>
1.267     apb       576: .include <bsd.clean.mk>
1.240     cube      577:
1.138     tv        578: ${TARGETS}:    # ensure existence
1.166     lukem     579:
                    580: .endif # HOSTPROG

CVSweb <webmaster@jp.NetBSD.org>