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

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

CVSweb <webmaster@jp.NetBSD.org>