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

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

CVSweb <webmaster@jp.NetBSD.org>