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

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

CVSweb <webmaster@jp.NetBSD.org>