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

1.255   ! pooka       1: #      $NetBSD: bsd.prog.mk,v 1.254 2010/12/10 20:08:17 joerg 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.153     pk         73: .ifndef LIBCRTBEGIN
1.167     thorpej    74: LIBCRTBEGIN=   ${DESTDIR}/usr/lib/crti.o ${_GCC_CRTBEGIN}
1.152     christos   75: .MADE: ${LIBCRTBEGIN}
1.153     pk         76: .endif
                     77: .ifndef LIBCRTEND
1.167     thorpej    78: LIBCRTEND=     ${_GCC_CRTEND} ${DESTDIR}/usr/lib/crtn.o
1.152     christos   79: .MADE: ${LIBCRTEND}
1.153     pk         80: .endif
1.144     lukem      81: _SHLINKER=     ${SHLINKDIR}/ld.elf_so
1.69      thorpej    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.250     mbalmer   100:        kadm5clnt kadm5srv kafs krb5 kvm l lber ldap ldap_r lua \
1.203     lukem     101:        m magic menu objc ossaudio pam pcap pci pmc posix pthread pthread_dbg \
1.242     plunky    102:        puffs radius resolv rmt roken rpcsvc rt rump rumpuser skey sl ss \
1.230     pooka     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
                    164: _PROGLDOPTS+=  -Wl,-dynamic-linker=${_SHLINKER}
1.161     itohy     165: .endif
1.187     lukem     166: .if ${SHLIBDIR} != "/usr/lib"
1.231     lukem     167: _PROGLDOPTS+=  -Wl,-rpath-link,${DESTDIR}${SHLIBDIR} \
1.252     joerg     168:                -Wl,-rpath,${SHLIBDIR} \
1.144     lukem     169:                -L${DESTDIR}${SHLIBDIR}
1.187     lukem     170: .elif ${SHLIBINSTALLDIR} != "/usr/lib"
1.231     lukem     171: _PROGLDOPTS+=  -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR} \
1.159     thorpej   172:                -L${DESTDIR}${SHLIBINSTALLDIR}
1.144     lukem     173: .endif
1.231     lukem     174: _PROGLDOPTS+=  -Wl,-rpath-link,${DESTDIR}/usr/lib \
                    175:                -L${DESTDIR}/usr/lib
1.144     lukem     176:
1.223     jmmv      177: __proginstall: .USE
                    178:        ${_MKTARGET_INSTALL}
                    179:        ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
                    180:                ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
                    181:
1.255   ! pooka     182: __progrumpinstall: .USE
        !           183:        ${_MKTARGET_INSTALL}
        !           184:        ${INSTALL_FILE} -o ${RUMPBINOWN} -g ${RUMPBINGRP} -m ${RUMPBINMODE} \
        !           185:                ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
        !           186:
1.223     jmmv      187: __progdebuginstall: .USE
                    188:        ${_MKTARGET_INSTALL}
                    189:        ${INSTALL_FILE} -o ${DEBUGOWN} -g ${DEBUGGRP} -m ${DEBUGMODE} \
                    190:                ${.ALLSRC} ${.TARGET}
                    191:
                    192:
                    193:
                    194: #
                    195: # Backwards compatibility with Makefiles that assume that bsd.prog.mk
                    196: # can only build a single binary.
                    197: #
                    198:
                    199: _APPEND_MANS=yes
                    200: _APPEND_SRCS=yes
                    201:
1.231     lukem     202: _CCLINKFLAGS=
                    203: .if defined(DESTDIR)
                    204: _CCLINKFLAGS+= -B${_GCC_CRTDIR}/ -B${DESTDIR}/usr/lib/
                    205: .endif
                    206:
1.145     thorpej   207: .if defined(PROG_CXX)
1.223     jmmv      208: PROG=          ${PROG_CXX}
1.231     lukem     209: _CCLINK=       ${CXX} ${_CCLINKFLAGS}
1.223     jmmv      210: .endif
                    211:
1.255   ! pooka     212: .if defined(RUMPPRG)
        !           213: PROG=                  ${RUMPPRG}
        !           214: PROGS=                 ${RUMPPRG} rump.${RUMPPRG}
        !           215: . if defined(SRCS)
        !           216: SRCS.rump.${PROG}:=    ${SRCS} ${PROG}_rumpops.c ${RUMPSRCS}
        !           217: SRCS+=                 ${PROG}_hostops.c
        !           218: . else
        !           219: SRCS=                  ${PROG}.c ${PROG}_hostops.c
        !           220: SRCS.rump.${PROG}=     ${PROG}.c ${PROG}_rumpops.c ${RUMPSRCS}
        !           221: . endif
        !           222: LDADD.rump.${PROG}+=   -lrumpclient
        !           223: DPADD.rump.${PROG}+=   ${LIBRUMPCLIENT}
        !           224: MAN.rump.${PROG}=      # defined but feeling empty
        !           225: _RUMPINSTALL.rump.${PROG}=# defined
        !           226: .endif
        !           227:
1.223     jmmv      228: .if defined(PROG)
1.231     lukem     229: _CCLINK?=      ${CC} ${_CCLINKFLAGS}
1.223     jmmv      230: .  if defined(MAN)
                    231: MAN.${PROG}=   ${MAN}
                    232: _APPEND_MANS=  no
                    233: .  endif
                    234: .  if !defined(OBJS)
                    235: OBJS=          ${OBJS.${PROG}}
                    236: .  endif
                    237: .  if defined(PROGNAME)
                    238: PROGNAME.${PROG}=      ${PROGNAME}
                    239: .  endif
                    240: .  if defined(SRCS)
                    241: SRCS.${PROG}=  ${SRCS}
                    242: _APPEND_SRCS=  no
                    243: .  endif
                    244: .endif
                    245:
                    246: # Turn the single-program PROG and PROG_CXX variables into their multi-word
                    247: # counterparts, PROGS and PROGS_CXX.
1.255   ! pooka     248: .if !defined(RUMPPRG)
        !           249: .  if defined(PROG_CXX) && !defined(PROGS_CXX)
1.223     jmmv      250: PROGS_CXX=     ${PROG_CXX}
1.255   ! pooka     251: .  elif defined(PROG) && !defined(PROGS)
1.223     jmmv      252: PROGS=         ${PROG}
1.255   ! pooka     253: .  endif
1.223     jmmv      254: .endif
                    255:
                    256: #
                    257: # Per-program definitions and targets.
                    258: #
                    259:
                    260: # Definitions specific to C programs.
                    261: .for _P in ${PROGS}
                    262: SRCS.${_P}?=   ${_P}.c
1.231     lukem     263: _CCLINK.${_P}= ${CC} ${_CCLINKFLAGS}
1.223     jmmv      264: .endfor
                    265:
                    266: # Definitions specific to C++ programs.
                    267: .for _P in ${PROGS_CXX}
                    268: SRCS.${_P}?=   ${_P}.cc
1.231     lukem     269: _CCLINK.${_P}= ${CXX} ${_CCLINKFLAGS}
1.223     jmmv      270: .endfor
                    271:
                    272: # Language-independent definitions.
                    273: .for _P in ${PROGS} ${PROGS_CXX}                                       # {
                    274:
                    275: BINDIR.${_P}?=         ${BINDIR}
                    276: PROGNAME.${_P}?=       ${_P}
                    277:
1.249     mrg       278: .if ${MKDEBUG} != "no" && !commands(${_P})
1.223     jmmv      279: _PROGDEBUG.${_P}:=     ${PROGNAME.${_P}}.debug
1.145     thorpej   280: .endif
                    281:
1.223     jmmv      282: .if defined(PAXCTL_FLAGS)
                    283: PAXCTL_FLAGS.${_P}?= ${PAXCTL_FLAGS}
1.215     lukem     284: .endif
                    285:
1.223     jmmv      286: ##### PROG specific flags.
1.244     uebayasi  287:
1.223     jmmv      288: _LDADD.${_P}=          ${LDADD}    ${LDADD.${_P}}
                    289: _LDFLAGS.${_P}=                ${LDFLAGS}  ${LDFLAGS.${_P}}
                    290: _LDSTATIC.${_P}=       ${LDSTATIC} ${LDSTATIC.${_P}}
                    291:
                    292: ##### Build and install rules
                    293: .if !empty(_APPEND_SRCS:M[Yy][Ee][Ss])
                    294: SRCS+=         ${SRCS.${_P}} # For bsd.dep.mk
                    295: .endif
                    296:
                    297: _YPSRCS.${_P}= ${SRCS.${_P}:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS.${_P}:M*.y:.y=.h}}
                    298:
                    299: DPSRCS+=               ${_YPSRCS.${_P}}
                    300: CLEANFILES+=           ${_YPSRCS.${_P}}
                    301:
                    302: .if !empty(SRCS.${_P}:N*.h:N*.sh:N*.fth)
                    303: OBJS.${_P}+=   ${SRCS.${_P}:N*.h:N*.sh:N*.fth:R:S/$/.o/g}
                    304: LOBJS.${_P}+=  ${LSRCS:.c=.ln} ${SRCS.${_P}:M*.c:.c=.ln}
1.157     thorpej   305: .endif
                    306:
1.223     jmmv      307: .if defined(OBJS.${_P}) && !empty(OBJS.${_P})                  # {
                    308: .NOPATH: ${OBJS.${_P}} ${_P} ${_YPSRCS.${_P}}
                    309:
                    310: ${OBJS.${_P}} ${LOBJS.${_P}}: ${DPSRCS}
1.182     lukem     311:
1.223     jmmv      312: ${_P}: .gdbinit ${LIBCRT0} ${OBJS.${_P}} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
                    313: .if !commands(${_P})
1.194     lukem     314:        ${_MKTARGET_LINK}
1.231     lukem     315:        ${_CCLINK.${_P}} \
1.232     lukem     316:            ${DESTDIR:D-Wl,-nostdlib} \
                    317:            ${_LDFLAGS.${_P}} ${_LDSTATIC.${_P}} -o ${.TARGET} \
                    318:            ${OBJS.${_P}} ${_LDADD.${_P}} \
                    319:            ${DESTDIR:D-L${_GCC_LIBGCCDIR}} \
                    320:            ${_PROGLDOPTS}
1.247     darran    321: .if defined(CTFMERGE)
                    322:        ${CTFMERGE} ${CTFMFLAGS} -o ${.TARGET} ${OBJS.${_P}}
                    323: .endif
1.223     jmmv      324: .if defined(PAXCTL_FLAGS.${_P})
                    325:        ${PAXCTL} ${PAXCTL_FLAGS.${_P}} ${.TARGET}
1.218     christos  326: .endif
1.235     joerg     327: .if ${MKSTRIPIDENT} != "no"
                    328:        ${OBJCOPY} -R .ident ${.TARGET}
                    329: .endif
1.223     jmmv      330: .endif # !commands(${_P})
1.183     dsl       331:
1.223     jmmv      332: ${_P}.ro: ${OBJS.${_P}} ${DPADD}
1.207     dsl       333:        ${_MKTARGET_LINK}
1.254     joerg     334:        ${CC} ${LDFLAGS} -nostdlib -r -Wl,-dc -o ${.TARGET} ${OBJS.${_P}}
1.1       cgd       335:
1.223     jmmv      336: .if defined(_PROGDEBUG.${_P})
1.224     jmmv      337: ${_PROGDEBUG.${_P}}: ${_P}
1.215     lukem     338:        ${_MKTARGET_CREATE}
1.251     lukem     339:        (  ${OBJCOPY} --only-keep-debug ${_P} ${_PROGDEBUG.${_P}} \
                    340:        && ${OBJCOPY} --strip-debug -p -R .gnu_debuglink \
                    341:                --add-gnu-debuglink=${_PROGDEBUG.${_P}} ${_P} \
                    342:        ) || (rm -f ${_PROGDEBUG.${_P}}; false)
1.215     lukem     343: .endif
                    344:
1.223     jmmv      345: .endif # defined(OBJS.${_P}) && !empty(OBJS.${_P})                     # }
1.1       cgd       346:
1.223     jmmv      347: .if !defined(MAN.${_P})
                    348: MAN.${_P}=     ${_P}.1
                    349: .endif # !defined(MAN.${_P})
                    350: .if !empty(_APPEND_MANS:M[Yy][Ee][Ss])
                    351: MAN+=          ${MAN.${_P}}
                    352: .endif
1.11      mycroft   353:
1.223     jmmv      354: realall: ${_P} ${_PROGDEBUG.${_P}}
1.1       cgd       355:
1.223     jmmv      356: cleanprog: cleanprog-${_P}
                    357: cleanprog-${_P}:
                    358:        rm -f ${_P} ${_PROGDEBUG.${_P}}
1.134     tls       359:
1.223     jmmv      360: .if defined(OBJS.${_P}) && !empty(OBJS.${_P})
                    361: cleanobjs: cleanobjs-${_P}
                    362: cleanobjs-${_P}:
                    363:        rm -f ${OBJS.${_P}} ${LOBJS.${_P}}
1.59      cgd       364: .endif
1.27      mycroft   365:
1.223     jmmv      366: _PROG_INSTALL+=        proginstall-${_P}
1.114     mycroft   367:
1.223     jmmv      368: .if !target(proginstall-${_P})                                         # {
                    369: proginstall-${_P}::    ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} \
                    370:                ${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}}
                    371: .PRECIOUS:     ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} \
                    372:                ${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}}
1.215     lukem     373:
1.172     lukem     374: .if ${MKUPDATE} == "no"
1.255   ! pooka     375: .if defined(_RUMPINSTALL.${_P})
        !           376: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! ${_P} __progrumpinstall
        !           377: .else
1.223     jmmv      378: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! ${_P} __proginstall
1.255   ! pooka     379: .endif
1.223     jmmv      380: .if !defined(BUILD) && !make(all) && !make(${_P})
                    381: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! .MADE
                    382: .endif
                    383: .if defined(_PROGDEBUG.${_P})
                    384: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}! ${_PROGDEBUG.${_P}} __progdebuginstall
                    385: .if !defined(BUILD) && !make(all) && !make(${_P})
                    386: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}! .MADE
1.215     lukem     387: .endif
1.223     jmmv      388: .endif #  define(_PROGDEBUG.${_P})
1.215     lukem     389: .else  # MKUPDATE != no
1.255   ! pooka     390: .if defined(_RUMPINSTALL.${_P})
        !           391: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __progrumpinstall
        !           392: .else
1.223     jmmv      393: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __proginstall
1.255   ! pooka     394: .endif
1.223     jmmv      395: .if !defined(BUILD) && !make(all) && !make(${_P})
                    396: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: .MADE
                    397: .endif
                    398: .if defined(_PROGDEBUG.${_P})
                    399: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}: ${_PROGDEBUG.${_P}} __progdebuginstall
                    400: .if !defined(BUILD) && !make(all) && !make(${_P})
                    401: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}: .MADE
1.154     mycroft   402: .endif
1.223     jmmv      403: .endif #  defined(_PROGDEBUG.${_P})
1.215     lukem     404: .endif # MKUPDATE != no
                    405:
1.223     jmmv      406: .endif # !target(proginstall-${_P})                                    # }
                    407:
                    408: lint: lint-${_P}
                    409: lint-${_P}: ${LOBJS.${_P}}
                    410: .if defined(LOBJS.${_P}) && !empty(LOBJS.${_P})
                    411:        ${LINT} ${LINTFLAGS} ${_LDFLAGS.${_P}:C/-L[  ]*/-L/Wg:M-L*} ${LOBJS.${_P}} ${_LDADD.${_P}}
                    412: .endif
                    413:
                    414: .endfor # _P in ${PROGS} ${PROGS_CXX}                                  # }
1.23      mycroft   415:
1.225     jmmv      416: .if defined(OBJS) && !empty(OBJS) && \
                    417:     (empty(PROGS) && empty(PROGS_CXX))
                    418: cleanobjs: cleanobjs-plain
                    419: cleanobjs-plain:
                    420:        rm -f ${OBJS} ${LOBJS}
                    421: .endif
                    422:
1.74      mycroft   423: .if !target(proginstall)
1.223     jmmv      424: proginstall:: ${_PROG_INSTALL}
1.74      mycroft   425: .endif
1.197     lukem     426: .PHONY:                proginstall
1.74      mycroft   427:
1.223     jmmv      428:
                    429:
                    430: realall: ${SCRIPTS}
1.215     lukem     431: .if defined(SCRIPTS) && !target(scriptsinstall)                                # {
1.65      mycroft   432: SCRIPTSDIR?=${BINDIR}
                    433: SCRIPTSOWN?=${BINOWN}
                    434: SCRIPTSGRP?=${BINGRP}
                    435: SCRIPTSMODE?=${BINMODE}
1.113     mycroft   436:
                    437: scriptsinstall:: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.114     mycroft   438: .PRECIOUS: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.113     mycroft   439:
1.115     mycroft   440: __scriptinstall: .USE
1.192     lukem     441:        ${_MKTARGET_INSTALL}
1.139     tv        442:        ${INSTALL_FILE} \
1.116     mycroft   443:            -o ${SCRIPTSOWN_${.ALLSRC:T}:U${SCRIPTSOWN}} \
                    444:            -g ${SCRIPTSGRP_${.ALLSRC:T}:U${SCRIPTSGRP}} \
                    445:            -m ${SCRIPTSMODE_${.ALLSRC:T}:U${SCRIPTSMODE}} \
1.209     jwise     446:            ${.ALLSRC} ${.TARGET}
1.115     mycroft   447:
1.130     sommerfe  448: .for S in ${SCRIPTS:O:u}
1.172     lukem     449: .if ${MKUPDATE} == "no"
1.154     mycroft   450: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}! ${S} __scriptinstall
                    451: .if !defined(BUILD) && !make(all) && !make(${S})
                    452: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}! .MADE
                    453: .endif
                    454: .else
                    455: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: ${S} __scriptinstall
1.103     fredb     456: .if !defined(BUILD) && !make(all) && !make(${S})
1.113     mycroft   457: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: .MADE
1.63      christos  458: .endif
1.154     mycroft   459: .endif
1.63      christos  460: .endfor
1.215     lukem     461: .endif                                                                 # }
1.1       cgd       462:
1.74      mycroft   463: .if !target(scriptsinstall)
                    464: scriptsinstall::
1.1       cgd       465: .endif
1.197     lukem     466: .PHONY:                scriptsinstall
1.1       cgd       467:
1.138     tv        468: ##### Pull in related .mk logic
1.241     apb       469: LINKSOWN?= ${BINOWN}
                    470: LINKSGRP?= ${BINGRP}
                    471: LINKSMODE?= ${BINMODE}
1.1       cgd       472: .include <bsd.man.mk>
1.50      jtc       473: .include <bsd.nls.mk>
1.66      christos  474: .include <bsd.files.mk>
1.63      christos  475: .include <bsd.inc.mk>
1.83      mycroft   476: .include <bsd.links.mk>
1.180     lukem     477: .include <bsd.sys.mk>
1.26      mycroft   478: .include <bsd.dep.mk>
1.88      mycroft   479:
1.240     cube      480: cleanextra: .PHONY
                    481: .if defined(CLEANFILES) && !empty(CLEANFILES)
                    482:        rm -f ${CLEANFILES}
                    483: .endif
                    484:
1.138     tv        485: ${TARGETS}:    # ensure existence
1.166     lukem     486:
                    487: .endif # HOSTPROG

CVSweb <webmaster@jp.NetBSD.org>