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

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

CVSweb <webmaster@jp.NetBSD.org>