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

1.225   ! jmmv        1: #      $NetBSD: bsd.prog.mk,v 1.224 2007/11/13 13:57:53 jmmv 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
                     87: #              LIBX11?=${DESTDIR}/usr/X11R6/lib/libX11.a
                     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 \
                     94:        form fl g2c gcc gnumalloc gssapi hdb intl ipsec \
1.210     christos   95:        kadm5clnt kadm5srv kafs krb5 kvm l \
1.203     lukem      96:        m magic menu objc ossaudio pam pcap pci pmc posix pthread pthread_dbg \
1.217     pooka      97:        puffs radius resolv rmt roken rpcsvc rt sdp skey sl ss ssh ssl termcap \
1.222     tls        98:        usbhid util wrap y z bind9 dns lwres isccfg isccc isc
1.202     lukem      99: .ifndef LIB${_lib:tu}
                    100: LIB${_lib:tu}= ${DESTDIR}/usr/lib/lib${_lib}.a
                    101: .MADE:         ${LIB${_lib:tu}}        # Note: ${DESTDIR} will be expanded
                    102: .endif
                    103: .endfor
                    104:
1.206     he        105: # PAM applications, if linked statically, need more libraries
                    106: .if (${MKPIC} == "no")
1.208     christos  107: .if (${MKCRYPTO} != "no")
                    108: PAM_STATIC_LDADD+= -lssh
                    109: PAM_STATIC_DPADD+= ${LIBSSH}
                    110: .endif
                    111: .if (${MKKERBEROS} != "no")
1.210     christos  112: PAM_STATIC_LDADD+= -lkafs -lkrb5 -lasn1 -lroken -lcom_err -lcrypto
1.211     christos  113: PAM_STATIC_DPADD+= ${LIBKAFS} ${LIBKRB5} ${LIBASN1} ${LIBROKEN} \
1.208     christos  114:        ${LIBCOM_ERR} ${LIBCRYPTO}
                    115: .endif
                    116: .if (${MKSKEY} != "no")
                    117: PAM_STATIC_LDADD+= -lskey
                    118: PAM_STATIC_DPADD+= ${LIBSKEY}
                    119: .endif
                    120: PAM_STATIC_LDADD+= -lradius -lcrypt -lrpcsvc -lutil
                    121: PAM_STATIC_DPADD+= ${LIBRADIUS} ${LIBCRYPT} ${LIBRPCSVC} ${LIBUTIL}
1.206     he        122: .else
                    123: PAM_STATIC_LDADD=
                    124: PAM_STATIC_DPADD=
                    125: .endif
                    126:
1.216     mrg       127: # These need + -> X transformations
1.202     lukem     128: .ifndef LIBSTDCXX
                    129: LIBSTDCXX=     ${DESTDIR}/usr/lib/libstdc++.a
                    130: .MADE:         ${LIBSTDCXX}
                    131: .endif
                    132:
1.216     mrg       133: .ifndef LIBSUPCXX
                    134: LIBSUPCXX=     ${DESTDIR}/usr/lib/libsupc++.a
                    135: .MADE:         ${LIBSUPCXX}
                    136: .endif
                    137:
1.202     lukem     138: .for _lib in \
                    139:        dps expat fntstubs fontcache fontconfig fontenc freetype FS \
                    140:        GL GLU ICE lbxutil SM X11 Xau Xaw Xdmcp Xext Xfont Xft \
                    141:        Xi Xinerama xkbfile Xmu Xmuu Xpm Xrandr Xrender Xss Xt \
                    142:        XTrap Xtst Xv Xxf86dga Xxf86misc Xxf86vm
                    143: .ifndef LIB${_lib:tu}
                    144: LIB${_lib:tu}= ${DESTDIR}/usr/X11R6/lib/lib${_lib}.a
                    145: .MADE:         ${LIB${_lib:tu}}        # Note: ${DESTDIR} will be expanded
                    146: .endif
                    147: .endfor
                    148:
1.204     lukem     149: .if defined(RESCUEDIR)
                    150: CPPFLAGS+=     -DRESCUEDIR=\"${RESCUEDIR}\"
                    151: .endif
                    152:
1.144     lukem     153: _PROGLDOPTS=
                    154: .if ${SHLINKDIR} != "/usr/libexec"     # XXX: change or remove if ld.so moves
1.161     itohy     155: .if ${OBJECT_FMT} == "ELF"
1.144     lukem     156: _PROGLDOPTS+=  -Wl,-dynamic-linker=${_SHLINKER}
1.161     itohy     157: .endif
1.144     lukem     158: .endif
1.187     lukem     159: .if ${SHLIBDIR} != "/usr/lib"
1.144     lukem     160: _PROGLDOPTS+=  -Wl,-rpath-link,${DESTDIR}${SHLIBDIR}:${DESTDIR}/usr/lib \
1.179     lukem     161:                -R${SHLIBDIR} \
1.144     lukem     162:                -L${DESTDIR}${SHLIBDIR}
1.187     lukem     163: .elif ${SHLIBINSTALLDIR} != "/usr/lib"
1.159     thorpej   164: _PROGLDOPTS+=  -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR}:${DESTDIR}/usr/lib \
                    165:                -L${DESTDIR}${SHLIBINSTALLDIR}
1.144     lukem     166: .endif
                    167:
1.223     jmmv      168: __proginstall: .USE
                    169:        ${_MKTARGET_INSTALL}
                    170:        ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
                    171:                ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
                    172:
                    173: __progdebuginstall: .USE
                    174:        ${_MKTARGET_INSTALL}
                    175:        ${INSTALL_FILE} -o ${DEBUGOWN} -g ${DEBUGGRP} -m ${DEBUGMODE} \
                    176:                ${.ALLSRC} ${.TARGET}
                    177:
                    178:
                    179:
                    180: #
                    181: # Backwards compatibility with Makefiles that assume that bsd.prog.mk
                    182: # can only build a single binary.
                    183: #
                    184:
                    185: _APPEND_MANS=yes
                    186: _APPEND_SRCS=yes
                    187:
1.145     thorpej   188: .if defined(PROG_CXX)
1.223     jmmv      189: PROG=          ${PROG_CXX}
                    190: _CCLINK=       ${CXX} # XXX Some Makefiles rely on this being public.
                    191: .endif
                    192:
                    193: .if defined(PROG)
                    194: _CCLINK?=      ${CC} # XXX Some Makefiles rely on this being public.
                    195: .  if defined(MAN)
                    196: MAN.${PROG}=   ${MAN}
                    197: _APPEND_MANS=  no
                    198: .  endif
                    199: .  if !defined(OBJS)
                    200: OBJS=          ${OBJS.${PROG}}
                    201: .  endif
                    202: .  if defined(PROGNAME)
                    203: PROGNAME.${PROG}=      ${PROGNAME}
                    204: .  endif
                    205: .  if defined(SRCS)
                    206: SRCS.${PROG}=  ${SRCS}
                    207: _APPEND_SRCS=  no
                    208: .  endif
                    209: .endif
                    210:
                    211: # Turn the single-program PROG and PROG_CXX variables into their multi-word
                    212: # counterparts, PROGS and PROGS_CXX.
                    213: .if defined(PROG_CXX) && !defined(PROGS_CXX)
                    214: PROGS_CXX=     ${PROG_CXX}
                    215: .elif defined(PROG) && !defined(PROGS)
                    216: PROGS=         ${PROG}
                    217: .endif
                    218:
                    219:
                    220:
                    221: #
                    222: # Per-program definitions and targets.
                    223: #
                    224:
                    225: # Definitions specific to C programs.
                    226: .for _P in ${PROGS}
                    227: SRCS.${_P}?=   ${_P}.c
                    228: _CCLINK.${_P}= ${CC}
                    229: .endfor
                    230:
                    231: # Definitions specific to C++ programs.
                    232: .for _P in ${PROGS_CXX}
                    233: SRCS.${_P}?=   ${_P}.cc
                    234: _CCLINK.${_P}= ${CXX}
                    235: .endfor
                    236:
                    237: # Language-independent definitions.
                    238: .for _P in ${PROGS} ${PROGS_CXX}                                       # {
                    239:
                    240: BINDIR.${_P}?=         ${BINDIR}
                    241: PROGNAME.${_P}?=       ${_P}
                    242:
                    243: .if ${MKDEBUG} != "no" && ${OBJECT_FMT} == "ELF" && !commands(${_P})
                    244: _PROGDEBUG.${_P}:=     ${PROGNAME.${_P}}.debug
1.145     thorpej   245: .endif
                    246:
1.223     jmmv      247: .if defined(PAXCTL_FLAGS)
                    248: PAXCTL_FLAGS.${_P}?= ${PAXCTL_FLAGS}
1.215     lukem     249: .endif
                    250:
1.223     jmmv      251: ##### PROG specific flags.
                    252: COPTS+=     ${COPTS.${_P}}
                    253: CPPFLAGS+=  ${CPPFLAGS.${_P}}
                    254: CXXFLAGS+=  ${CXXFLAGS.${_P}}
                    255: OBJCOPTS+=  ${OBJCOPTS.${_P}}
                    256: LDADD+=     ${LDADD.${_P}}
                    257: LDFLAGS+=   ${LDFLAGS.${_P}}
                    258: LDSTATIC+=  ${LDSTATIC.${_P}}
                    259:
                    260: _COPTS.${_P}=          ${COPTS}    ${COPTS.${_P}}
                    261: _CPPFLAGS.${_P}=       ${CPPFLAGS} ${CPPFLAGS.${_P}}
                    262: _CXXFLAGS.${_P}=       ${CXXFLAGS} ${CXXFLAGS.${_P}}
                    263: _OBJCOPTS.${_P}=       ${OBJCOPTS} ${OBJCOPTS.${_P}}
                    264: _LDADD.${_P}=          ${LDADD}    ${LDADD.${_P}}
                    265: _LDFLAGS.${_P}=                ${LDFLAGS}  ${LDFLAGS.${_P}}
                    266: _LDSTATIC.${_P}=       ${LDSTATIC} ${LDSTATIC.${_P}}
                    267:
                    268: ##### Build and install rules
                    269: .if !empty(_APPEND_SRCS:M[Yy][Ee][Ss])
                    270: SRCS+=         ${SRCS.${_P}} # For bsd.dep.mk
                    271: .endif
                    272:
                    273: _YPSRCS.${_P}= ${SRCS.${_P}:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS.${_P}:M*.y:.y=.h}}
                    274:
                    275: DPSRCS+=               ${_YPSRCS.${_P}}
                    276: CLEANFILES+=           ${_YPSRCS.${_P}}
                    277:
                    278: .if !empty(SRCS.${_P}:N*.h:N*.sh:N*.fth)
                    279: OBJS.${_P}+=   ${SRCS.${_P}:N*.h:N*.sh:N*.fth:R:S/$/.o/g}
                    280: LOBJS.${_P}+=  ${LSRCS:.c=.ln} ${SRCS.${_P}:M*.c:.c=.ln}
1.157     thorpej   281: .endif
                    282:
1.223     jmmv      283: .if defined(OBJS.${_P}) && !empty(OBJS.${_P})                  # {
                    284: .NOPATH: ${OBJS.${_P}} ${_P} ${_YPSRCS.${_P}}
                    285:
                    286: ${OBJS.${_P}} ${LOBJS.${_P}}: ${DPSRCS}
1.182     lukem     287:
1.223     jmmv      288: ${_P}: .gdbinit ${LIBCRT0} ${OBJS.${_P}} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
                    289: .if !commands(${_P})
1.194     lukem     290:        ${_MKTARGET_LINK}
1.181     lukem     291: .if defined(DESTDIR)
1.223     jmmv      292:        ${_CCLINK.${_P}} -Wl,-nostdlib \
                    293:            ${_LDFLAGS.${_P}} ${_LDSTATIC.${_P}} -o ${.TARGET} ${_PROGLDOPTS} \
1.198     skrll     294:            -B${_GCC_CRTDIR}/ -B${DESTDIR}/usr/lib/  \
1.223     jmmv      295:            ${OBJS.${_P}} ${_LDADD.${_P}} \
1.198     skrll     296:            -L${_GCC_LIBGCCDIR} -L${DESTDIR}/usr/lib
1.46      mycroft   297: .else
1.223     jmmv      298:        ${_CCLINK.${_P}} ${_LDFLAGS.${_P}} ${_LDSTATIC.${_P}} -o ${.TARGET} ${_PROGLDOPTS} ${OBJS.${_P}} ${_LDADD.${_P}}
1.181     lukem     299: .endif # defined(DESTDIR)
1.223     jmmv      300: .if defined(PAXCTL_FLAGS.${_P})
                    301:        ${PAXCTL} ${PAXCTL_FLAGS.${_P}} ${.TARGET}
1.218     christos  302: .endif
1.223     jmmv      303: .endif # !commands(${_P})
1.183     dsl       304:
1.223     jmmv      305: ${_P}.ro: ${OBJS.${_P}} ${DPADD}
1.207     dsl       306:        ${_MKTARGET_LINK}
1.223     jmmv      307:        ${LD} -r -dc -o ${.TARGET} ${OBJS.${_P}}
1.1       cgd       308:
1.223     jmmv      309: .if defined(_PROGDEBUG.${_P})
1.224     jmmv      310: ${_PROGDEBUG.${_P}}: ${_P}
1.215     lukem     311:        ${_MKTARGET_CREATE}
1.223     jmmv      312:        ${OBJCOPY} --only-keep-debug ${_P} ${_PROGDEBUG.${_P}}
                    313:        ${OBJCOPY} -R .gnu_debuglink --add-gnu-debuglink=${_PROGDEBUG.${_P}} ${_P} \
                    314:            || rm -f ${_PROGDEBUG.${_P}}
1.215     lukem     315: .endif
                    316:
1.223     jmmv      317: .endif # defined(OBJS.${_P}) && !empty(OBJS.${_P})                     # }
1.1       cgd       318:
1.223     jmmv      319: .if !defined(MAN.${_P})
                    320: MAN.${_P}=     ${_P}.1
                    321: .endif # !defined(MAN.${_P})
                    322: .if !empty(_APPEND_MANS:M[Yy][Ee][Ss])
                    323: MAN+=          ${MAN.${_P}}
                    324: .endif
1.11      mycroft   325:
1.223     jmmv      326: realall: ${_P} ${_PROGDEBUG.${_P}}
1.1       cgd       327:
1.223     jmmv      328: cleanprog: cleanprog-${_P}
                    329: cleanprog-${_P}:
                    330:        rm -f ${_P} ${_PROGDEBUG.${_P}}
1.134     tls       331:
1.223     jmmv      332: .if defined(OBJS.${_P}) && !empty(OBJS.${_P})
                    333: cleanobjs: cleanobjs-${_P}
                    334: cleanobjs-${_P}:
                    335:        rm -f ${OBJS.${_P}} ${LOBJS.${_P}}
1.59      cgd       336: .endif
1.27      mycroft   337:
1.223     jmmv      338: _PROG_INSTALL+=        proginstall-${_P}
1.114     mycroft   339:
1.223     jmmv      340: .if !target(proginstall-${_P})                                         # {
                    341: proginstall-${_P}::    ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} \
                    342:                ${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}}
                    343: .PRECIOUS:     ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} \
                    344:                ${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}}
1.215     lukem     345:
1.172     lukem     346: .if ${MKUPDATE} == "no"
1.223     jmmv      347: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! ${_P} __proginstall
                    348: .if !defined(BUILD) && !make(all) && !make(${_P})
                    349: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! .MADE
                    350: .endif
                    351: .if defined(_PROGDEBUG.${_P})
                    352: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}! ${_PROGDEBUG.${_P}} __progdebuginstall
                    353: .if !defined(BUILD) && !make(all) && !make(${_P})
                    354: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}! .MADE
1.215     lukem     355: .endif
1.223     jmmv      356: .endif #  define(_PROGDEBUG.${_P})
1.215     lukem     357: .else  # 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.154     mycroft   366: .endif
1.223     jmmv      367: .endif #  defined(_PROGDEBUG.${_P})
1.215     lukem     368: .endif # MKUPDATE != no
                    369:
1.223     jmmv      370: .endif # !target(proginstall-${_P})                                    # }
                    371:
                    372: lint: lint-${_P}
                    373: lint-${_P}: ${LOBJS.${_P}}
                    374: .if defined(LOBJS.${_P}) && !empty(LOBJS.${_P})
                    375:        ${LINT} ${LINTFLAGS} ${_LDFLAGS.${_P}:C/-L[  ]*/-L/Wg:M-L*} ${LOBJS.${_P}} ${_LDADD.${_P}}
                    376: .endif
                    377:
                    378: .endfor # _P in ${PROGS} ${PROGS_CXX}                                  # }
1.23      mycroft   379:
1.225   ! jmmv      380: .if defined(OBJS) && !empty(OBJS) && \
        !           381:     (empty(PROGS) && empty(PROGS_CXX))
        !           382: cleanobjs: cleanobjs-plain
        !           383: cleanobjs-plain:
        !           384:        rm -f ${OBJS} ${LOBJS}
        !           385: .endif
        !           386:
1.74      mycroft   387: .if !target(proginstall)
1.223     jmmv      388: proginstall:: ${_PROG_INSTALL}
1.74      mycroft   389: .endif
1.197     lukem     390: .PHONY:                proginstall
1.74      mycroft   391:
1.223     jmmv      392:
                    393:
                    394: realall: ${SCRIPTS}
1.215     lukem     395: .if defined(SCRIPTS) && !target(scriptsinstall)                                # {
1.65      mycroft   396: SCRIPTSDIR?=${BINDIR}
                    397: SCRIPTSOWN?=${BINOWN}
                    398: SCRIPTSGRP?=${BINGRP}
                    399: SCRIPTSMODE?=${BINMODE}
1.113     mycroft   400:
                    401: scriptsinstall:: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.114     mycroft   402: .PRECIOUS: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.113     mycroft   403:
1.115     mycroft   404: __scriptinstall: .USE
1.192     lukem     405:        ${_MKTARGET_INSTALL}
1.139     tv        406:        ${INSTALL_FILE} \
1.116     mycroft   407:            -o ${SCRIPTSOWN_${.ALLSRC:T}:U${SCRIPTSOWN}} \
                    408:            -g ${SCRIPTSGRP_${.ALLSRC:T}:U${SCRIPTSGRP}} \
                    409:            -m ${SCRIPTSMODE_${.ALLSRC:T}:U${SCRIPTSMODE}} \
1.209     jwise     410:            ${.ALLSRC} ${.TARGET}
1.115     mycroft   411:
1.130     sommerfe  412: .for S in ${SCRIPTS:O:u}
1.172     lukem     413: .if ${MKUPDATE} == "no"
1.154     mycroft   414: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}! ${S} __scriptinstall
                    415: .if !defined(BUILD) && !make(all) && !make(${S})
                    416: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}! .MADE
                    417: .endif
                    418: .else
                    419: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: ${S} __scriptinstall
1.103     fredb     420: .if !defined(BUILD) && !make(all) && !make(${S})
1.113     mycroft   421: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: .MADE
1.63      christos  422: .endif
1.154     mycroft   423: .endif
1.63      christos  424: .endfor
1.215     lukem     425: .endif                                                                 # }
1.1       cgd       426:
1.74      mycroft   427: .if !target(scriptsinstall)
                    428: scriptsinstall::
1.1       cgd       429: .endif
1.197     lukem     430: .PHONY:                scriptsinstall
1.1       cgd       431:
1.138     tv        432: ##### Pull in related .mk logic
1.1       cgd       433: .include <bsd.man.mk>
1.50      jtc       434: .include <bsd.nls.mk>
1.66      christos  435: .include <bsd.files.mk>
1.63      christos  436: .include <bsd.inc.mk>
1.83      mycroft   437: .include <bsd.links.mk>
1.180     lukem     438: .include <bsd.sys.mk>
1.26      mycroft   439: .include <bsd.dep.mk>
1.88      mycroft   440:
1.138     tv        441: ${TARGETS}:    # ensure existence
1.166     lukem     442:
                    443: .endif # HOSTPROG

CVSweb <webmaster@jp.NetBSD.org>