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

1.230   ! pooka       1: #      $NetBSD: bsd.prog.mk,v 1.229 2008/05/28 11:23:26 lukem 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 \
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}
                    148: LIB${_lib:tu}= ${DESTDIR}/usr/X11R6/lib/lib${_lib}.a
                    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.144     lukem     164: _PROGLDOPTS+=  -Wl,-rpath-link,${DESTDIR}${SHLIBDIR}:${DESTDIR}/usr/lib \
1.179     lukem     165:                -R${SHLIBDIR} \
1.144     lukem     166:                -L${DESTDIR}${SHLIBDIR}
1.187     lukem     167: .elif ${SHLIBINSTALLDIR} != "/usr/lib"
1.159     thorpej   168: _PROGLDOPTS+=  -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR}:${DESTDIR}/usr/lib \
                    169:                -L${DESTDIR}${SHLIBINSTALLDIR}
1.144     lukem     170: .endif
                    171:
1.223     jmmv      172: __proginstall: .USE
                    173:        ${_MKTARGET_INSTALL}
                    174:        ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
                    175:                ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
                    176:
                    177: __progdebuginstall: .USE
                    178:        ${_MKTARGET_INSTALL}
                    179:        ${INSTALL_FILE} -o ${DEBUGOWN} -g ${DEBUGGRP} -m ${DEBUGMODE} \
                    180:                ${.ALLSRC} ${.TARGET}
                    181:
                    182:
                    183:
                    184: #
                    185: # Backwards compatibility with Makefiles that assume that bsd.prog.mk
                    186: # can only build a single binary.
                    187: #
                    188:
                    189: _APPEND_MANS=yes
                    190: _APPEND_SRCS=yes
                    191:
1.145     thorpej   192: .if defined(PROG_CXX)
1.223     jmmv      193: PROG=          ${PROG_CXX}
                    194: _CCLINK=       ${CXX} # XXX Some Makefiles rely on this being public.
                    195: .endif
                    196:
                    197: .if defined(PROG)
                    198: _CCLINK?=      ${CC} # XXX Some Makefiles rely on this being public.
                    199: .  if defined(MAN)
                    200: MAN.${PROG}=   ${MAN}
                    201: _APPEND_MANS=  no
                    202: .  endif
                    203: .  if !defined(OBJS)
                    204: OBJS=          ${OBJS.${PROG}}
                    205: .  endif
                    206: .  if defined(PROGNAME)
                    207: PROGNAME.${PROG}=      ${PROGNAME}
                    208: .  endif
                    209: .  if defined(SRCS)
                    210: SRCS.${PROG}=  ${SRCS}
                    211: _APPEND_SRCS=  no
                    212: .  endif
                    213: .endif
                    214:
                    215: # Turn the single-program PROG and PROG_CXX variables into their multi-word
                    216: # counterparts, PROGS and PROGS_CXX.
                    217: .if defined(PROG_CXX) && !defined(PROGS_CXX)
                    218: PROGS_CXX=     ${PROG_CXX}
                    219: .elif defined(PROG) && !defined(PROGS)
                    220: PROGS=         ${PROG}
                    221: .endif
                    222:
                    223:
                    224:
                    225: #
                    226: # Per-program definitions and targets.
                    227: #
                    228:
                    229: # Definitions specific to C programs.
                    230: .for _P in ${PROGS}
                    231: SRCS.${_P}?=   ${_P}.c
                    232: _CCLINK.${_P}= ${CC}
                    233: .endfor
                    234:
                    235: # Definitions specific to C++ programs.
                    236: .for _P in ${PROGS_CXX}
                    237: SRCS.${_P}?=   ${_P}.cc
                    238: _CCLINK.${_P}= ${CXX}
                    239: .endfor
                    240:
                    241: # Language-independent definitions.
                    242: .for _P in ${PROGS} ${PROGS_CXX}                                       # {
                    243:
                    244: BINDIR.${_P}?=         ${BINDIR}
                    245: PROGNAME.${_P}?=       ${_P}
                    246:
                    247: .if ${MKDEBUG} != "no" && ${OBJECT_FMT} == "ELF" && !commands(${_P})
                    248: _PROGDEBUG.${_P}:=     ${PROGNAME.${_P}}.debug
1.145     thorpej   249: .endif
                    250:
1.223     jmmv      251: .if defined(PAXCTL_FLAGS)
                    252: PAXCTL_FLAGS.${_P}?= ${PAXCTL_FLAGS}
1.215     lukem     253: .endif
                    254:
1.223     jmmv      255: ##### PROG specific flags.
                    256: COPTS+=     ${COPTS.${_P}}
                    257: CPPFLAGS+=  ${CPPFLAGS.${_P}}
                    258: CXXFLAGS+=  ${CXXFLAGS.${_P}}
                    259: OBJCOPTS+=  ${OBJCOPTS.${_P}}
                    260: LDADD+=     ${LDADD.${_P}}
                    261: LDFLAGS+=   ${LDFLAGS.${_P}}
                    262: LDSTATIC+=  ${LDSTATIC.${_P}}
                    263:
                    264: _COPTS.${_P}=          ${COPTS}    ${COPTS.${_P}}
                    265: _CPPFLAGS.${_P}=       ${CPPFLAGS} ${CPPFLAGS.${_P}}
                    266: _CXXFLAGS.${_P}=       ${CXXFLAGS} ${CXXFLAGS.${_P}}
                    267: _OBJCOPTS.${_P}=       ${OBJCOPTS} ${OBJCOPTS.${_P}}
                    268: _LDADD.${_P}=          ${LDADD}    ${LDADD.${_P}}
                    269: _LDFLAGS.${_P}=                ${LDFLAGS}  ${LDFLAGS.${_P}}
                    270: _LDSTATIC.${_P}=       ${LDSTATIC} ${LDSTATIC.${_P}}
                    271:
                    272: ##### Build and install rules
                    273: .if !empty(_APPEND_SRCS:M[Yy][Ee][Ss])
                    274: SRCS+=         ${SRCS.${_P}} # For bsd.dep.mk
                    275: .endif
                    276:
                    277: _YPSRCS.${_P}= ${SRCS.${_P}:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS.${_P}:M*.y:.y=.h}}
                    278:
                    279: DPSRCS+=               ${_YPSRCS.${_P}}
                    280: CLEANFILES+=           ${_YPSRCS.${_P}}
                    281:
                    282: .if !empty(SRCS.${_P}:N*.h:N*.sh:N*.fth)
                    283: OBJS.${_P}+=   ${SRCS.${_P}:N*.h:N*.sh:N*.fth:R:S/$/.o/g}
                    284: LOBJS.${_P}+=  ${LSRCS:.c=.ln} ${SRCS.${_P}:M*.c:.c=.ln}
1.157     thorpej   285: .endif
                    286:
1.223     jmmv      287: .if defined(OBJS.${_P}) && !empty(OBJS.${_P})                  # {
                    288: .NOPATH: ${OBJS.${_P}} ${_P} ${_YPSRCS.${_P}}
                    289:
                    290: ${OBJS.${_P}} ${LOBJS.${_P}}: ${DPSRCS}
1.182     lukem     291:
1.223     jmmv      292: ${_P}: .gdbinit ${LIBCRT0} ${OBJS.${_P}} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
                    293: .if !commands(${_P})
1.194     lukem     294:        ${_MKTARGET_LINK}
1.181     lukem     295: .if defined(DESTDIR)
1.223     jmmv      296:        ${_CCLINK.${_P}} -Wl,-nostdlib \
                    297:            ${_LDFLAGS.${_P}} ${_LDSTATIC.${_P}} -o ${.TARGET} ${_PROGLDOPTS} \
1.198     skrll     298:            -B${_GCC_CRTDIR}/ -B${DESTDIR}/usr/lib/  \
1.223     jmmv      299:            ${OBJS.${_P}} ${_LDADD.${_P}} \
1.198     skrll     300:            -L${_GCC_LIBGCCDIR} -L${DESTDIR}/usr/lib
1.46      mycroft   301: .else
1.223     jmmv      302:        ${_CCLINK.${_P}} ${_LDFLAGS.${_P}} ${_LDSTATIC.${_P}} -o ${.TARGET} ${_PROGLDOPTS} ${OBJS.${_P}} ${_LDADD.${_P}}
1.181     lukem     303: .endif # defined(DESTDIR)
1.223     jmmv      304: .if defined(PAXCTL_FLAGS.${_P})
                    305:        ${PAXCTL} ${PAXCTL_FLAGS.${_P}} ${.TARGET}
1.218     christos  306: .endif
1.223     jmmv      307: .endif # !commands(${_P})
1.183     dsl       308:
1.223     jmmv      309: ${_P}.ro: ${OBJS.${_P}} ${DPADD}
1.207     dsl       310:        ${_MKTARGET_LINK}
1.223     jmmv      311:        ${LD} -r -dc -o ${.TARGET} ${OBJS.${_P}}
1.1       cgd       312:
1.223     jmmv      313: .if defined(_PROGDEBUG.${_P})
1.224     jmmv      314: ${_PROGDEBUG.${_P}}: ${_P}
1.215     lukem     315:        ${_MKTARGET_CREATE}
1.223     jmmv      316:        ${OBJCOPY} --only-keep-debug ${_P} ${_PROGDEBUG.${_P}}
                    317:        ${OBJCOPY} -R .gnu_debuglink --add-gnu-debuglink=${_PROGDEBUG.${_P}} ${_P} \
                    318:            || rm -f ${_PROGDEBUG.${_P}}
1.215     lukem     319: .endif
                    320:
1.223     jmmv      321: .endif # defined(OBJS.${_P}) && !empty(OBJS.${_P})                     # }
1.1       cgd       322:
1.223     jmmv      323: .if !defined(MAN.${_P})
                    324: MAN.${_P}=     ${_P}.1
                    325: .endif # !defined(MAN.${_P})
                    326: .if !empty(_APPEND_MANS:M[Yy][Ee][Ss])
                    327: MAN+=          ${MAN.${_P}}
                    328: .endif
1.11      mycroft   329:
1.223     jmmv      330: realall: ${_P} ${_PROGDEBUG.${_P}}
1.1       cgd       331:
1.223     jmmv      332: cleanprog: cleanprog-${_P}
                    333: cleanprog-${_P}:
                    334:        rm -f ${_P} ${_PROGDEBUG.${_P}}
1.134     tls       335:
1.223     jmmv      336: .if defined(OBJS.${_P}) && !empty(OBJS.${_P})
                    337: cleanobjs: cleanobjs-${_P}
                    338: cleanobjs-${_P}:
                    339:        rm -f ${OBJS.${_P}} ${LOBJS.${_P}}
1.59      cgd       340: .endif
1.27      mycroft   341:
1.223     jmmv      342: _PROG_INSTALL+=        proginstall-${_P}
1.114     mycroft   343:
1.223     jmmv      344: .if !target(proginstall-${_P})                                         # {
                    345: proginstall-${_P}::    ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} \
                    346:                ${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}}
                    347: .PRECIOUS:     ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} \
                    348:                ${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}}
1.215     lukem     349:
1.172     lukem     350: .if ${MKUPDATE} == "no"
1.223     jmmv      351: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! ${_P} __proginstall
                    352: .if !defined(BUILD) && !make(all) && !make(${_P})
                    353: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! .MADE
                    354: .endif
                    355: .if defined(_PROGDEBUG.${_P})
                    356: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}! ${_PROGDEBUG.${_P}} __progdebuginstall
                    357: .if !defined(BUILD) && !make(all) && !make(${_P})
                    358: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}! .MADE
1.215     lukem     359: .endif
1.223     jmmv      360: .endif #  define(_PROGDEBUG.${_P})
1.215     lukem     361: .else  # MKUPDATE != no
1.223     jmmv      362: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __proginstall
                    363: .if !defined(BUILD) && !make(all) && !make(${_P})
                    364: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: .MADE
                    365: .endif
                    366: .if defined(_PROGDEBUG.${_P})
                    367: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}: ${_PROGDEBUG.${_P}} __progdebuginstall
                    368: .if !defined(BUILD) && !make(all) && !make(${_P})
                    369: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}: .MADE
1.154     mycroft   370: .endif
1.223     jmmv      371: .endif #  defined(_PROGDEBUG.${_P})
1.215     lukem     372: .endif # MKUPDATE != no
                    373:
1.223     jmmv      374: .endif # !target(proginstall-${_P})                                    # }
                    375:
                    376: lint: lint-${_P}
                    377: lint-${_P}: ${LOBJS.${_P}}
                    378: .if defined(LOBJS.${_P}) && !empty(LOBJS.${_P})
                    379:        ${LINT} ${LINTFLAGS} ${_LDFLAGS.${_P}:C/-L[  ]*/-L/Wg:M-L*} ${LOBJS.${_P}} ${_LDADD.${_P}}
                    380: .endif
                    381:
                    382: .endfor # _P in ${PROGS} ${PROGS_CXX}                                  # }
1.23      mycroft   383:
1.225     jmmv      384: .if defined(OBJS) && !empty(OBJS) && \
                    385:     (empty(PROGS) && empty(PROGS_CXX))
                    386: cleanobjs: cleanobjs-plain
                    387: cleanobjs-plain:
                    388:        rm -f ${OBJS} ${LOBJS}
                    389: .endif
                    390:
1.74      mycroft   391: .if !target(proginstall)
1.223     jmmv      392: proginstall:: ${_PROG_INSTALL}
1.74      mycroft   393: .endif
1.197     lukem     394: .PHONY:                proginstall
1.74      mycroft   395:
1.223     jmmv      396:
                    397:
                    398: realall: ${SCRIPTS}
1.215     lukem     399: .if defined(SCRIPTS) && !target(scriptsinstall)                                # {
1.65      mycroft   400: SCRIPTSDIR?=${BINDIR}
                    401: SCRIPTSOWN?=${BINOWN}
                    402: SCRIPTSGRP?=${BINGRP}
                    403: SCRIPTSMODE?=${BINMODE}
1.113     mycroft   404:
                    405: scriptsinstall:: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.114     mycroft   406: .PRECIOUS: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.113     mycroft   407:
1.115     mycroft   408: __scriptinstall: .USE
1.192     lukem     409:        ${_MKTARGET_INSTALL}
1.139     tv        410:        ${INSTALL_FILE} \
1.116     mycroft   411:            -o ${SCRIPTSOWN_${.ALLSRC:T}:U${SCRIPTSOWN}} \
                    412:            -g ${SCRIPTSGRP_${.ALLSRC:T}:U${SCRIPTSGRP}} \
                    413:            -m ${SCRIPTSMODE_${.ALLSRC:T}:U${SCRIPTSMODE}} \
1.209     jwise     414:            ${.ALLSRC} ${.TARGET}
1.115     mycroft   415:
1.130     sommerfe  416: .for S in ${SCRIPTS:O:u}
1.172     lukem     417: .if ${MKUPDATE} == "no"
1.154     mycroft   418: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}! ${S} __scriptinstall
                    419: .if !defined(BUILD) && !make(all) && !make(${S})
                    420: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}! .MADE
                    421: .endif
                    422: .else
                    423: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: ${S} __scriptinstall
1.103     fredb     424: .if !defined(BUILD) && !make(all) && !make(${S})
1.113     mycroft   425: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: .MADE
1.63      christos  426: .endif
1.154     mycroft   427: .endif
1.63      christos  428: .endfor
1.215     lukem     429: .endif                                                                 # }
1.1       cgd       430:
1.74      mycroft   431: .if !target(scriptsinstall)
                    432: scriptsinstall::
1.1       cgd       433: .endif
1.197     lukem     434: .PHONY:                scriptsinstall
1.1       cgd       435:
1.138     tv        436: ##### Pull in related .mk logic
1.1       cgd       437: .include <bsd.man.mk>
1.50      jtc       438: .include <bsd.nls.mk>
1.66      christos  439: .include <bsd.files.mk>
1.63      christos  440: .include <bsd.inc.mk>
1.83      mycroft   441: .include <bsd.links.mk>
1.180     lukem     442: .include <bsd.sys.mk>
1.26      mycroft   443: .include <bsd.dep.mk>
1.88      mycroft   444:
1.138     tv        445: ${TARGETS}:    # ensure existence
1.166     lukem     446:
                    447: .endif # HOSTPROG

CVSweb <webmaster@jp.NetBSD.org>