[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

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

CVSweb <webmaster@jp.NetBSD.org>