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

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

CVSweb <webmaster@jp.NetBSD.org>