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

1.235   ! joerg       1: #      $NetBSD: bsd.prog.mk,v 1.234 2008/08/28 07:17:06 mrg 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: clean:         cleanprog
                     18:
                     19: .gdbinit:
                     20:        rm -f .gdbinit
                     21: .if defined(DESTDIR) && !empty(DESTDIR)
                     22:        echo "set solib-absolute-prefix ${DESTDIR}" > .gdbinit
                     23: .else
                     24:        touch .gdbinit
1.185     erh        25: .endif
1.223     jmmv       26: .for __gdbinit in ${GDBINIT}
                     27:        echo "source ${__gdbinit}" >> .gdbinit
                     28: .endfor
1.185     erh        29:
1.223     jmmv       30: cleanextra: .PHONY
                     31: .if defined(CLEANFILES) && !empty(CLEANFILES)
                     32:        rm -f ${CLEANFILES}
1.218     christos   33: .endif
                     34:
1.223     jmmv       35: cleanobjs: .PHONY
                     36:
                     37: cleanprog: .PHONY cleanobjs cleanextra
                     38:        rm -f a.out [Ee]rrs mklog core *.core .gdbinit
                     39:
                     40: .if defined(SHAREDSTRINGS)
                     41: CLEANFILES+=strings
                     42: .c.o:
                     43:        ${CC} -E ${CPPFLAGS} ${CFLAGS} ${.IMPSRC} | xstr -c -
                     44:        @${CC} ${CPPFLAGS} ${CFLAGS} -c x.c -o ${.TARGET}
                     45:        @rm -f x.c
1.1       cgd        46:
1.223     jmmv       47: .cc.o .cpp.o .cxx.o .C.o:
                     48:        ${CXX} -E ${CPPFLAGS} ${CXXFLAGS} ${.IMPSRC} | xstr -c -
                     49:        @mv -f x.c x.cc
                     50:        @${CXX} ${CPPFLAGS} ${CXXFLAGS} -c x.cc -o ${.TARGET}
                     51:        @rm -f x.cc
                     52: .endif
1.185     erh        53:
1.138     tv         54: ##### Default values
1.142     thorpej    55: CPPFLAGS+=     ${DESTDIR:D-nostdinc ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include}
1.175     mrg        56: CXXFLAGS+=     ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEMXX} ${DESTDIR}/usr/include/g++}
1.25      mycroft    57: CFLAGS+=       ${COPTS}
1.212     mrg        58: OBJCFLAGS+=    ${OBJCOPTS}
1.193     dsl        59: MKDEP_SUFFIXES?=       .o .ln
1.1       cgd        60:
1.162     thorpej    61: # ELF platforms depend on crti.o, crtbegin.o, crtend.o, and crtn.o
1.100     lukem      62: .if ${OBJECT_FMT} == "ELF"
1.153     pk         63: .ifndef LIBCRTBEGIN
1.167     thorpej    64: LIBCRTBEGIN=   ${DESTDIR}/usr/lib/crti.o ${_GCC_CRTBEGIN}
1.152     christos   65: .MADE: ${LIBCRTBEGIN}
1.153     pk         66: .endif
                     67: .ifndef LIBCRTEND
1.167     thorpej    68: LIBCRTEND=     ${_GCC_CRTEND} ${DESTDIR}/usr/lib/crtn.o
1.152     christos   69: .MADE: ${LIBCRTEND}
1.153     pk         70: .endif
1.144     lukem      71: _SHLINKER=     ${SHLINKDIR}/ld.elf_so
1.69      thorpej    72: .else
                     73: LIBCRTBEGIN?=
                     74: LIBCRTEND?=
1.144     lukem      75: _SHLINKER=     ${SHLINKDIR}/ld.so
1.69      thorpej    76: .endif
                     77:
1.153     pk         78: .ifndef LIBCRT0
                     79: LIBCRT0=       ${DESTDIR}/usr/lib/crt0.o
1.152     christos   80: .MADE: ${LIBCRT0}
1.153     pk         81: .endif
1.95      ross       82:
1.202     lukem      83: ##### Installed system library definitions
                     84: #
                     85: #      E.g.
                     86: #              LIBC?=${DESTDIR}/usr/lib/libc.a
1.234     mrg        87: #              LIBX11?=${DESTDIR}/usr/X11R7/lib/libX11.a
1.202     lukem      88: #      etc..
                     89:
                     90: .for _lib in \
1.221     joerg      91:        archive asn1 bluetooth bsdmalloc bz2 c c_pic cdk com_err compat \
                     92:        crypt crypto crypto_idea crypto_mdc2 crypto_rc5 \
1.203     lukem      93:        curses dbm des edit event \
1.226     mlelstv    94:        form fl g2c gcc gnumalloc gssapi hdb heimntlm hx509 intl ipsec \
1.229     lukem      95:        kadm5clnt kadm5srv kafs krb5 kvm l lber ldap ldap_r \
1.203     lukem      96:        m magic menu objc ossaudio pam pcap pci pmc posix pthread pthread_dbg \
1.230     pooka      97:        puffs radius resolv rmt roken rpcsvc rt rump rumpuser sdp skey sl ss \
                     98:        ssh ssl termcap usbhid util wrap y z bind9 dns lwres isccfg isccc isc \
                     99:        \
                    100:        rumpfs_cd9660fs rumpfs_efs rumpfs_ext2fs rumpfs_ffs rumpfs_hfs \
                    101:        rumpfs_lfs rumpfs_msdosfs rumpfs_nfs rumpfs_ntfs rumpfs_syspuffs \
                    102:        rumpfs_tmpfs rumpfs_udf rumpfs_ufs
1.202     lukem     103: .ifndef LIB${_lib:tu}
                    104: LIB${_lib:tu}= ${DESTDIR}/usr/lib/lib${_lib}.a
                    105: .MADE:         ${LIB${_lib:tu}}        # Note: ${DESTDIR} will be expanded
                    106: .endif
                    107: .endfor
                    108:
1.206     he        109: # PAM applications, if linked statically, need more libraries
                    110: .if (${MKPIC} == "no")
1.208     christos  111: .if (${MKCRYPTO} != "no")
                    112: PAM_STATIC_LDADD+= -lssh
                    113: PAM_STATIC_DPADD+= ${LIBSSH}
                    114: .endif
                    115: .if (${MKKERBEROS} != "no")
1.227     tsutsui   116: PAM_STATIC_LDADD+= -lkafs -lkrb5 -lhx509 -lasn1 -lroken -lcom_err -lcrypto
                    117: PAM_STATIC_DPADD+= ${LIBKAFS} ${LIBKRB5} ${LIBHX509} ${LIBASN1} ${LIBROKEN} \
1.208     christos  118:        ${LIBCOM_ERR} ${LIBCRYPTO}
                    119: .endif
                    120: .if (${MKSKEY} != "no")
                    121: PAM_STATIC_LDADD+= -lskey
                    122: PAM_STATIC_DPADD+= ${LIBSKEY}
                    123: .endif
                    124: PAM_STATIC_LDADD+= -lradius -lcrypt -lrpcsvc -lutil
                    125: PAM_STATIC_DPADD+= ${LIBRADIUS} ${LIBCRYPT} ${LIBRPCSVC} ${LIBUTIL}
1.206     he        126: .else
                    127: PAM_STATIC_LDADD=
                    128: PAM_STATIC_DPADD=
                    129: .endif
                    130:
1.216     mrg       131: # These need + -> X transformations
1.202     lukem     132: .ifndef LIBSTDCXX
                    133: LIBSTDCXX=     ${DESTDIR}/usr/lib/libstdc++.a
                    134: .MADE:         ${LIBSTDCXX}
                    135: .endif
                    136:
1.216     mrg       137: .ifndef LIBSUPCXX
                    138: LIBSUPCXX=     ${DESTDIR}/usr/lib/libsupc++.a
                    139: .MADE:         ${LIBSUPCXX}
                    140: .endif
                    141:
1.202     lukem     142: .for _lib in \
                    143:        dps expat fntstubs fontcache fontconfig fontenc freetype FS \
                    144:        GL GLU ICE lbxutil SM X11 Xau Xaw Xdmcp Xext Xfont Xft \
                    145:        Xi Xinerama xkbfile Xmu Xmuu Xpm Xrandr Xrender Xss Xt \
                    146:        XTrap Xtst Xv Xxf86dga Xxf86misc Xxf86vm
                    147: .ifndef LIB${_lib:tu}
1.233     rtr       148: LIB${_lib:tu}= ${DESTDIR}${X11USRLIBDIR}/lib${_lib}.a
1.202     lukem     149: .MADE:         ${LIB${_lib:tu}}        # Note: ${DESTDIR} will be expanded
                    150: .endif
                    151: .endfor
                    152:
1.204     lukem     153: .if defined(RESCUEDIR)
                    154: CPPFLAGS+=     -DRESCUEDIR=\"${RESCUEDIR}\"
                    155: .endif
                    156:
1.144     lukem     157: _PROGLDOPTS=
                    158: .if ${SHLINKDIR} != "/usr/libexec"     # XXX: change or remove if ld.so moves
1.161     itohy     159: .if ${OBJECT_FMT} == "ELF"
1.144     lukem     160: _PROGLDOPTS+=  -Wl,-dynamic-linker=${_SHLINKER}
1.161     itohy     161: .endif
1.144     lukem     162: .endif
1.187     lukem     163: .if ${SHLIBDIR} != "/usr/lib"
1.231     lukem     164: _PROGLDOPTS+=  -Wl,-rpath-link,${DESTDIR}${SHLIBDIR} \
1.179     lukem     165:                -R${SHLIBDIR} \
1.144     lukem     166:                -L${DESTDIR}${SHLIBDIR}
1.187     lukem     167: .elif ${SHLIBINSTALLDIR} != "/usr/lib"
1.231     lukem     168: _PROGLDOPTS+=  -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR} \
1.159     thorpej   169:                -L${DESTDIR}${SHLIBINSTALLDIR}
1.144     lukem     170: .endif
1.231     lukem     171: _PROGLDOPTS+=  -Wl,-rpath-link,${DESTDIR}/usr/lib \
                    172:                -L${DESTDIR}/usr/lib
1.144     lukem     173:
1.223     jmmv      174: __proginstall: .USE
                    175:        ${_MKTARGET_INSTALL}
                    176:        ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
                    177:                ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
                    178:
                    179: __progdebuginstall: .USE
                    180:        ${_MKTARGET_INSTALL}
                    181:        ${INSTALL_FILE} -o ${DEBUGOWN} -g ${DEBUGGRP} -m ${DEBUGMODE} \
                    182:                ${.ALLSRC} ${.TARGET}
                    183:
                    184:
                    185:
                    186: #
                    187: # Backwards compatibility with Makefiles that assume that bsd.prog.mk
                    188: # can only build a single binary.
                    189: #
                    190:
                    191: _APPEND_MANS=yes
                    192: _APPEND_SRCS=yes
                    193:
1.231     lukem     194: _CCLINKFLAGS=
                    195: .if defined(DESTDIR)
                    196: _CCLINKFLAGS+= -B${_GCC_CRTDIR}/ -B${DESTDIR}/usr/lib/
                    197: .endif
                    198:
1.145     thorpej   199: .if defined(PROG_CXX)
1.223     jmmv      200: PROG=          ${PROG_CXX}
1.231     lukem     201: _CCLINK=       ${CXX} ${_CCLINKFLAGS}
1.223     jmmv      202: .endif
                    203:
                    204: .if defined(PROG)
1.231     lukem     205: _CCLINK?=      ${CC} ${_CCLINKFLAGS}
1.223     jmmv      206: .  if defined(MAN)
                    207: MAN.${PROG}=   ${MAN}
                    208: _APPEND_MANS=  no
                    209: .  endif
                    210: .  if !defined(OBJS)
                    211: OBJS=          ${OBJS.${PROG}}
                    212: .  endif
                    213: .  if defined(PROGNAME)
                    214: PROGNAME.${PROG}=      ${PROGNAME}
                    215: .  endif
                    216: .  if defined(SRCS)
                    217: SRCS.${PROG}=  ${SRCS}
                    218: _APPEND_SRCS=  no
                    219: .  endif
                    220: .endif
                    221:
                    222: # Turn the single-program PROG and PROG_CXX variables into their multi-word
                    223: # counterparts, PROGS and PROGS_CXX.
                    224: .if defined(PROG_CXX) && !defined(PROGS_CXX)
                    225: PROGS_CXX=     ${PROG_CXX}
                    226: .elif defined(PROG) && !defined(PROGS)
                    227: PROGS=         ${PROG}
                    228: .endif
                    229:
                    230:
                    231:
                    232: #
                    233: # Per-program definitions and targets.
                    234: #
                    235:
                    236: # Definitions specific to C programs.
                    237: .for _P in ${PROGS}
                    238: SRCS.${_P}?=   ${_P}.c
1.231     lukem     239: _CCLINK.${_P}= ${CC} ${_CCLINKFLAGS}
1.223     jmmv      240: .endfor
                    241:
                    242: # Definitions specific to C++ programs.
                    243: .for _P in ${PROGS_CXX}
                    244: SRCS.${_P}?=   ${_P}.cc
1.231     lukem     245: _CCLINK.${_P}= ${CXX} ${_CCLINKFLAGS}
1.223     jmmv      246: .endfor
                    247:
                    248: # Language-independent definitions.
                    249: .for _P in ${PROGS} ${PROGS_CXX}                                       # {
                    250:
                    251: BINDIR.${_P}?=         ${BINDIR}
                    252: PROGNAME.${_P}?=       ${_P}
                    253:
                    254: .if ${MKDEBUG} != "no" && ${OBJECT_FMT} == "ELF" && !commands(${_P})
                    255: _PROGDEBUG.${_P}:=     ${PROGNAME.${_P}}.debug
1.145     thorpej   256: .endif
                    257:
1.223     jmmv      258: .if defined(PAXCTL_FLAGS)
                    259: PAXCTL_FLAGS.${_P}?= ${PAXCTL_FLAGS}
1.215     lukem     260: .endif
                    261:
1.223     jmmv      262: ##### PROG specific flags.
                    263: COPTS+=     ${COPTS.${_P}}
                    264: CPPFLAGS+=  ${CPPFLAGS.${_P}}
                    265: CXXFLAGS+=  ${CXXFLAGS.${_P}}
                    266: OBJCOPTS+=  ${OBJCOPTS.${_P}}
                    267: LDADD+=     ${LDADD.${_P}}
                    268: LDFLAGS+=   ${LDFLAGS.${_P}}
                    269: LDSTATIC+=  ${LDSTATIC.${_P}}
                    270:
                    271: _COPTS.${_P}=          ${COPTS}    ${COPTS.${_P}}
                    272: _CPPFLAGS.${_P}=       ${CPPFLAGS} ${CPPFLAGS.${_P}}
                    273: _CXXFLAGS.${_P}=       ${CXXFLAGS} ${CXXFLAGS.${_P}}
                    274: _OBJCOPTS.${_P}=       ${OBJCOPTS} ${OBJCOPTS.${_P}}
                    275: _LDADD.${_P}=          ${LDADD}    ${LDADD.${_P}}
                    276: _LDFLAGS.${_P}=                ${LDFLAGS}  ${LDFLAGS.${_P}}
                    277: _LDSTATIC.${_P}=       ${LDSTATIC} ${LDSTATIC.${_P}}
                    278:
                    279: ##### Build and install rules
                    280: .if !empty(_APPEND_SRCS:M[Yy][Ee][Ss])
                    281: SRCS+=         ${SRCS.${_P}} # For bsd.dep.mk
                    282: .endif
                    283:
                    284: _YPSRCS.${_P}= ${SRCS.${_P}:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS.${_P}:M*.y:.y=.h}}
                    285:
                    286: DPSRCS+=               ${_YPSRCS.${_P}}
                    287: CLEANFILES+=           ${_YPSRCS.${_P}}
                    288:
                    289: .if !empty(SRCS.${_P}:N*.h:N*.sh:N*.fth)
                    290: OBJS.${_P}+=   ${SRCS.${_P}:N*.h:N*.sh:N*.fth:R:S/$/.o/g}
                    291: LOBJS.${_P}+=  ${LSRCS:.c=.ln} ${SRCS.${_P}:M*.c:.c=.ln}
1.157     thorpej   292: .endif
                    293:
1.223     jmmv      294: .if defined(OBJS.${_P}) && !empty(OBJS.${_P})                  # {
                    295: .NOPATH: ${OBJS.${_P}} ${_P} ${_YPSRCS.${_P}}
                    296:
                    297: ${OBJS.${_P}} ${LOBJS.${_P}}: ${DPSRCS}
1.182     lukem     298:
1.223     jmmv      299: ${_P}: .gdbinit ${LIBCRT0} ${OBJS.${_P}} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
                    300: .if !commands(${_P})
1.194     lukem     301:        ${_MKTARGET_LINK}
1.231     lukem     302:        ${_CCLINK.${_P}} \
1.232     lukem     303:            ${DESTDIR:D-Wl,-nostdlib} \
                    304:            ${_LDFLAGS.${_P}} ${_LDSTATIC.${_P}} -o ${.TARGET} \
                    305:            ${OBJS.${_P}} ${_LDADD.${_P}} \
                    306:            ${DESTDIR:D-L${_GCC_LIBGCCDIR}} \
                    307:            ${_PROGLDOPTS}
1.223     jmmv      308: .if defined(PAXCTL_FLAGS.${_P})
                    309:        ${PAXCTL} ${PAXCTL_FLAGS.${_P}} ${.TARGET}
1.218     christos  310: .endif
1.235   ! joerg     311: .if ${MKSTRIPIDENT} != "no"
        !           312:        ${OBJCOPY} -R .ident ${.TARGET}
        !           313: .endif
1.223     jmmv      314: .endif # !commands(${_P})
1.183     dsl       315:
1.223     jmmv      316: ${_P}.ro: ${OBJS.${_P}} ${DPADD}
1.207     dsl       317:        ${_MKTARGET_LINK}
1.223     jmmv      318:        ${LD} -r -dc -o ${.TARGET} ${OBJS.${_P}}
1.1       cgd       319:
1.223     jmmv      320: .if defined(_PROGDEBUG.${_P})
1.224     jmmv      321: ${_PROGDEBUG.${_P}}: ${_P}
1.215     lukem     322:        ${_MKTARGET_CREATE}
1.223     jmmv      323:        ${OBJCOPY} --only-keep-debug ${_P} ${_PROGDEBUG.${_P}}
                    324:        ${OBJCOPY} -R .gnu_debuglink --add-gnu-debuglink=${_PROGDEBUG.${_P}} ${_P} \
                    325:            || rm -f ${_PROGDEBUG.${_P}}
1.215     lukem     326: .endif
                    327:
1.223     jmmv      328: .endif # defined(OBJS.${_P}) && !empty(OBJS.${_P})                     # }
1.1       cgd       329:
1.223     jmmv      330: .if !defined(MAN.${_P})
                    331: MAN.${_P}=     ${_P}.1
                    332: .endif # !defined(MAN.${_P})
                    333: .if !empty(_APPEND_MANS:M[Yy][Ee][Ss])
                    334: MAN+=          ${MAN.${_P}}
                    335: .endif
1.11      mycroft   336:
1.223     jmmv      337: realall: ${_P} ${_PROGDEBUG.${_P}}
1.1       cgd       338:
1.223     jmmv      339: cleanprog: cleanprog-${_P}
                    340: cleanprog-${_P}:
                    341:        rm -f ${_P} ${_PROGDEBUG.${_P}}
1.134     tls       342:
1.223     jmmv      343: .if defined(OBJS.${_P}) && !empty(OBJS.${_P})
                    344: cleanobjs: cleanobjs-${_P}
                    345: cleanobjs-${_P}:
                    346:        rm -f ${OBJS.${_P}} ${LOBJS.${_P}}
1.59      cgd       347: .endif
1.27      mycroft   348:
1.223     jmmv      349: _PROG_INSTALL+=        proginstall-${_P}
1.114     mycroft   350:
1.223     jmmv      351: .if !target(proginstall-${_P})                                         # {
                    352: proginstall-${_P}::    ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} \
                    353:                ${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}}
                    354: .PRECIOUS:     ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} \
                    355:                ${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}}
1.215     lukem     356:
1.172     lukem     357: .if ${MKUPDATE} == "no"
1.223     jmmv      358: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! ${_P} __proginstall
                    359: .if !defined(BUILD) && !make(all) && !make(${_P})
                    360: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! .MADE
                    361: .endif
                    362: .if defined(_PROGDEBUG.${_P})
                    363: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}! ${_PROGDEBUG.${_P}} __progdebuginstall
                    364: .if !defined(BUILD) && !make(all) && !make(${_P})
                    365: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}! .MADE
1.215     lukem     366: .endif
1.223     jmmv      367: .endif #  define(_PROGDEBUG.${_P})
1.215     lukem     368: .else  # MKUPDATE != no
1.223     jmmv      369: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __proginstall
                    370: .if !defined(BUILD) && !make(all) && !make(${_P})
                    371: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: .MADE
                    372: .endif
                    373: .if defined(_PROGDEBUG.${_P})
                    374: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}: ${_PROGDEBUG.${_P}} __progdebuginstall
                    375: .if !defined(BUILD) && !make(all) && !make(${_P})
                    376: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}: .MADE
1.154     mycroft   377: .endif
1.223     jmmv      378: .endif #  defined(_PROGDEBUG.${_P})
1.215     lukem     379: .endif # MKUPDATE != no
                    380:
1.223     jmmv      381: .endif # !target(proginstall-${_P})                                    # }
                    382:
                    383: lint: lint-${_P}
                    384: lint-${_P}: ${LOBJS.${_P}}
                    385: .if defined(LOBJS.${_P}) && !empty(LOBJS.${_P})
                    386:        ${LINT} ${LINTFLAGS} ${_LDFLAGS.${_P}:C/-L[  ]*/-L/Wg:M-L*} ${LOBJS.${_P}} ${_LDADD.${_P}}
                    387: .endif
                    388:
                    389: .endfor # _P in ${PROGS} ${PROGS_CXX}                                  # }
1.23      mycroft   390:
1.225     jmmv      391: .if defined(OBJS) && !empty(OBJS) && \
                    392:     (empty(PROGS) && empty(PROGS_CXX))
                    393: cleanobjs: cleanobjs-plain
                    394: cleanobjs-plain:
                    395:        rm -f ${OBJS} ${LOBJS}
                    396: .endif
                    397:
1.74      mycroft   398: .if !target(proginstall)
1.223     jmmv      399: proginstall:: ${_PROG_INSTALL}
1.74      mycroft   400: .endif
1.197     lukem     401: .PHONY:                proginstall
1.74      mycroft   402:
1.223     jmmv      403:
                    404:
                    405: realall: ${SCRIPTS}
1.215     lukem     406: .if defined(SCRIPTS) && !target(scriptsinstall)                                # {
1.65      mycroft   407: SCRIPTSDIR?=${BINDIR}
                    408: SCRIPTSOWN?=${BINOWN}
                    409: SCRIPTSGRP?=${BINGRP}
                    410: SCRIPTSMODE?=${BINMODE}
1.113     mycroft   411:
                    412: scriptsinstall:: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.114     mycroft   413: .PRECIOUS: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.113     mycroft   414:
1.115     mycroft   415: __scriptinstall: .USE
1.192     lukem     416:        ${_MKTARGET_INSTALL}
1.139     tv        417:        ${INSTALL_FILE} \
1.116     mycroft   418:            -o ${SCRIPTSOWN_${.ALLSRC:T}:U${SCRIPTSOWN}} \
                    419:            -g ${SCRIPTSGRP_${.ALLSRC:T}:U${SCRIPTSGRP}} \
                    420:            -m ${SCRIPTSMODE_${.ALLSRC:T}:U${SCRIPTSMODE}} \
1.209     jwise     421:            ${.ALLSRC} ${.TARGET}
1.115     mycroft   422:
1.130     sommerfe  423: .for S in ${SCRIPTS:O:u}
1.172     lukem     424: .if ${MKUPDATE} == "no"
1.154     mycroft   425: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}! ${S} __scriptinstall
                    426: .if !defined(BUILD) && !make(all) && !make(${S})
                    427: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}! .MADE
                    428: .endif
                    429: .else
                    430: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: ${S} __scriptinstall
1.103     fredb     431: .if !defined(BUILD) && !make(all) && !make(${S})
1.113     mycroft   432: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: .MADE
1.63      christos  433: .endif
1.154     mycroft   434: .endif
1.63      christos  435: .endfor
1.215     lukem     436: .endif                                                                 # }
1.1       cgd       437:
1.74      mycroft   438: .if !target(scriptsinstall)
                    439: scriptsinstall::
1.1       cgd       440: .endif
1.197     lukem     441: .PHONY:                scriptsinstall
1.1       cgd       442:
1.138     tv        443: ##### Pull in related .mk logic
1.1       cgd       444: .include <bsd.man.mk>
1.50      jtc       445: .include <bsd.nls.mk>
1.66      christos  446: .include <bsd.files.mk>
1.63      christos  447: .include <bsd.inc.mk>
1.83      mycroft   448: .include <bsd.links.mk>
1.180     lukem     449: .include <bsd.sys.mk>
1.26      mycroft   450: .include <bsd.dep.mk>
1.88      mycroft   451:
1.138     tv        452: ${TARGETS}:    # ensure existence
1.166     lukem     453:
                    454: .endif # HOSTPROG

CVSweb <webmaster@jp.NetBSD.org>