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

1.261   ! jmmv        1: #      $NetBSD: bsd.prog.mk,v 1.260 2011/02/20 20:16:01 jmmv 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.259     christos  105:        puffs radius resolv rmt roken rpcsvc rt rump rumpuser saslc 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
1.260     jmmv      116: # atf-c and atf-c++ are special cases because we cannot use [-+] as part of
                    117: # make(1) variable names.  Just define them here.
                    118: LIBATF_C=      ${DESTDIR}/usr/lib/libatf-c.a
                    119: LIBATF_CXX=    ${DESTDIR}/usr/lib/libatf-c++.a
                    120: .MADE:         ${LIBATF_C} ${LIBATF_CXX}
1.202     lukem     121:
1.206     he        122: # PAM applications, if linked statically, need more libraries
                    123: .if (${MKPIC} == "no")
1.208     christos  124: .if (${MKCRYPTO} != "no")
                    125: PAM_STATIC_LDADD+= -lssh
                    126: PAM_STATIC_DPADD+= ${LIBSSH}
                    127: .endif
                    128: .if (${MKKERBEROS} != "no")
1.227     tsutsui   129: PAM_STATIC_LDADD+= -lkafs -lkrb5 -lhx509 -lasn1 -lroken -lcom_err -lcrypto
                    130: PAM_STATIC_DPADD+= ${LIBKAFS} ${LIBKRB5} ${LIBHX509} ${LIBASN1} ${LIBROKEN} \
1.208     christos  131:        ${LIBCOM_ERR} ${LIBCRYPTO}
                    132: .endif
                    133: .if (${MKSKEY} != "no")
                    134: PAM_STATIC_LDADD+= -lskey
                    135: PAM_STATIC_DPADD+= ${LIBSKEY}
                    136: .endif
                    137: PAM_STATIC_LDADD+= -lradius -lcrypt -lrpcsvc -lutil
                    138: PAM_STATIC_DPADD+= ${LIBRADIUS} ${LIBCRYPT} ${LIBRPCSVC} ${LIBUTIL}
1.206     he        139: .else
                    140: PAM_STATIC_LDADD=
                    141: PAM_STATIC_DPADD=
                    142: .endif
                    143:
1.216     mrg       144: # These need + -> X transformations
1.202     lukem     145: .ifndef LIBSTDCXX
                    146: LIBSTDCXX=     ${DESTDIR}/usr/lib/libstdc++.a
                    147: .MADE:         ${LIBSTDCXX}
                    148: .endif
                    149:
1.216     mrg       150: .ifndef LIBSUPCXX
                    151: LIBSUPCXX=     ${DESTDIR}/usr/lib/libsupc++.a
                    152: .MADE:         ${LIBSUPCXX}
                    153: .endif
                    154:
1.202     lukem     155: .for _lib in \
                    156:        dps expat fntstubs fontcache fontconfig fontenc freetype FS \
                    157:        GL GLU ICE lbxutil SM X11 Xau Xaw Xdmcp Xext Xfont Xft \
                    158:        Xi Xinerama xkbfile Xmu Xmuu Xpm Xrandr Xrender Xss Xt \
                    159:        XTrap Xtst Xv Xxf86dga Xxf86misc Xxf86vm
                    160: .ifndef LIB${_lib:tu}
1.233     rtr       161: LIB${_lib:tu}= ${DESTDIR}${X11USRLIBDIR}/lib${_lib}.a
1.202     lukem     162: .MADE:         ${LIB${_lib:tu}}        # Note: ${DESTDIR} will be expanded
                    163: .endif
                    164: .endfor
                    165:
1.204     lukem     166: .if defined(RESCUEDIR)
                    167: CPPFLAGS+=     -DRESCUEDIR=\"${RESCUEDIR}\"
                    168: .endif
                    169:
1.144     lukem     170: _PROGLDOPTS=
                    171: .if ${SHLINKDIR} != "/usr/libexec"     # XXX: change or remove if ld.so moves
                    172: _PROGLDOPTS+=  -Wl,-dynamic-linker=${_SHLINKER}
1.161     itohy     173: .endif
1.187     lukem     174: .if ${SHLIBDIR} != "/usr/lib"
1.231     lukem     175: _PROGLDOPTS+=  -Wl,-rpath-link,${DESTDIR}${SHLIBDIR} \
1.252     joerg     176:                -Wl,-rpath,${SHLIBDIR} \
1.144     lukem     177:                -L${DESTDIR}${SHLIBDIR}
1.187     lukem     178: .elif ${SHLIBINSTALLDIR} != "/usr/lib"
1.231     lukem     179: _PROGLDOPTS+=  -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR} \
1.159     thorpej   180:                -L${DESTDIR}${SHLIBINSTALLDIR}
1.144     lukem     181: .endif
1.231     lukem     182: _PROGLDOPTS+=  -Wl,-rpath-link,${DESTDIR}/usr/lib \
                    183:                -L${DESTDIR}/usr/lib
1.144     lukem     184:
1.223     jmmv      185: __proginstall: .USE
                    186:        ${_MKTARGET_INSTALL}
                    187:        ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
                    188:                ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
                    189:
1.255     pooka     190: __progrumpinstall: .USE
                    191:        ${_MKTARGET_INSTALL}
                    192:        ${INSTALL_FILE} -o ${RUMPBINOWN} -g ${RUMPBINGRP} -m ${RUMPBINMODE} \
                    193:                ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
                    194:
1.223     jmmv      195: __progdebuginstall: .USE
                    196:        ${_MKTARGET_INSTALL}
                    197:        ${INSTALL_FILE} -o ${DEBUGOWN} -g ${DEBUGGRP} -m ${DEBUGMODE} \
                    198:                ${.ALLSRC} ${.TARGET}
                    199:
                    200:
                    201:
                    202: #
                    203: # Backwards compatibility with Makefiles that assume that bsd.prog.mk
                    204: # can only build a single binary.
                    205: #
                    206:
                    207: _APPEND_MANS=yes
                    208: _APPEND_SRCS=yes
                    209:
1.231     lukem     210: _CCLINKFLAGS=
                    211: .if defined(DESTDIR)
                    212: _CCLINKFLAGS+= -B${_GCC_CRTDIR}/ -B${DESTDIR}/usr/lib/
                    213: .endif
                    214:
1.145     thorpej   215: .if defined(PROG_CXX)
1.223     jmmv      216: PROG=          ${PROG_CXX}
1.231     lukem     217: _CCLINK=       ${CXX} ${_CCLINKFLAGS}
1.223     jmmv      218: .endif
                    219:
1.255     pooka     220: .if defined(RUMPPRG)
                    221: PROG=                  ${RUMPPRG}
1.256     pooka     222: .ifndef CRUNCHEDPROG
1.255     pooka     223: PROGS=                 ${RUMPPRG} rump.${RUMPPRG}
                    224: . if defined(SRCS)
                    225: SRCS.rump.${PROG}:=    ${SRCS} ${PROG}_rumpops.c ${RUMPSRCS}
                    226: SRCS+=                 ${PROG}_hostops.c
                    227: . else
                    228: SRCS=                  ${PROG}.c ${PROG}_hostops.c
                    229: SRCS.rump.${PROG}=     ${PROG}.c ${PROG}_rumpops.c ${RUMPSRCS}
                    230: . endif
1.257     pooka     231: DPSRCS+=               ${PROG}_rumpops.c ${RUMPSRCS}
1.255     pooka     232: LDADD.rump.${PROG}+=   -lrumpclient
                    233: DPADD.rump.${PROG}+=   ${LIBRUMPCLIENT}
                    234: MAN.rump.${PROG}=      # defined but feeling empty
                    235: _RUMPINSTALL.rump.${PROG}=# defined
1.256     pooka     236: .else # CRUNCHEDPROG
                    237: PROGS=                 ${PROG}
                    238: CPPFLAGS+=             -DCRUNCHOPS
                    239: .endif
1.255     pooka     240: .endif
                    241:
1.223     jmmv      242: .if defined(PROG)
1.231     lukem     243: _CCLINK?=      ${CC} ${_CCLINKFLAGS}
1.223     jmmv      244: .  if defined(MAN)
                    245: MAN.${PROG}=   ${MAN}
                    246: _APPEND_MANS=  no
                    247: .  endif
                    248: .  if !defined(OBJS)
                    249: OBJS=          ${OBJS.${PROG}}
                    250: .  endif
                    251: .  if defined(PROGNAME)
                    252: PROGNAME.${PROG}=      ${PROGNAME}
                    253: .  endif
                    254: .  if defined(SRCS)
                    255: SRCS.${PROG}=  ${SRCS}
                    256: _APPEND_SRCS=  no
                    257: .  endif
                    258: .endif
                    259:
                    260: # Turn the single-program PROG and PROG_CXX variables into their multi-word
                    261: # counterparts, PROGS and PROGS_CXX.
1.255     pooka     262: .if !defined(RUMPPRG)
                    263: .  if defined(PROG_CXX) && !defined(PROGS_CXX)
1.223     jmmv      264: PROGS_CXX=     ${PROG_CXX}
1.261   ! jmmv      265: .  endif
        !           266: .  if defined(PROG) && !defined(PROGS)
1.223     jmmv      267: PROGS=         ${PROG}
1.255     pooka     268: .  endif
1.223     jmmv      269: .endif
                    270:
                    271: #
                    272: # Per-program definitions and targets.
                    273: #
                    274:
                    275: # Definitions specific to C programs.
                    276: .for _P in ${PROGS}
                    277: SRCS.${_P}?=   ${_P}.c
1.231     lukem     278: _CCLINK.${_P}= ${CC} ${_CCLINKFLAGS}
1.223     jmmv      279: .endfor
                    280:
                    281: # Definitions specific to C++ programs.
                    282: .for _P in ${PROGS_CXX}
                    283: SRCS.${_P}?=   ${_P}.cc
1.231     lukem     284: _CCLINK.${_P}= ${CXX} ${_CCLINKFLAGS}
1.223     jmmv      285: .endfor
                    286:
                    287: # Language-independent definitions.
                    288: .for _P in ${PROGS} ${PROGS_CXX}                                       # {
                    289:
                    290: BINDIR.${_P}?=         ${BINDIR}
                    291: PROGNAME.${_P}?=       ${_P}
                    292:
1.249     mrg       293: .if ${MKDEBUG} != "no" && !commands(${_P})
1.223     jmmv      294: _PROGDEBUG.${_P}:=     ${PROGNAME.${_P}}.debug
1.145     thorpej   295: .endif
                    296:
1.223     jmmv      297: .if defined(PAXCTL_FLAGS)
                    298: PAXCTL_FLAGS.${_P}?= ${PAXCTL_FLAGS}
1.215     lukem     299: .endif
                    300:
1.223     jmmv      301: ##### PROG specific flags.
1.244     uebayasi  302:
1.223     jmmv      303: _LDADD.${_P}=          ${LDADD}    ${LDADD.${_P}}
                    304: _LDFLAGS.${_P}=                ${LDFLAGS}  ${LDFLAGS.${_P}}
                    305: _LDSTATIC.${_P}=       ${LDSTATIC} ${LDSTATIC.${_P}}
                    306:
                    307: ##### Build and install rules
                    308: .if !empty(_APPEND_SRCS:M[Yy][Ee][Ss])
                    309: SRCS+=         ${SRCS.${_P}} # For bsd.dep.mk
                    310: .endif
                    311:
                    312: _YPSRCS.${_P}= ${SRCS.${_P}:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS.${_P}:M*.y:.y=.h}}
                    313:
                    314: DPSRCS+=               ${_YPSRCS.${_P}}
                    315: CLEANFILES+=           ${_YPSRCS.${_P}}
                    316:
                    317: .if !empty(SRCS.${_P}:N*.h:N*.sh:N*.fth)
                    318: OBJS.${_P}+=   ${SRCS.${_P}:N*.h:N*.sh:N*.fth:R:S/$/.o/g}
                    319: LOBJS.${_P}+=  ${LSRCS:.c=.ln} ${SRCS.${_P}:M*.c:.c=.ln}
1.157     thorpej   320: .endif
                    321:
1.223     jmmv      322: .if defined(OBJS.${_P}) && !empty(OBJS.${_P})                  # {
                    323: .NOPATH: ${OBJS.${_P}} ${_P} ${_YPSRCS.${_P}}
                    324:
                    325: ${OBJS.${_P}} ${LOBJS.${_P}}: ${DPSRCS}
1.182     lukem     326:
1.223     jmmv      327: ${_P}: .gdbinit ${LIBCRT0} ${OBJS.${_P}} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
                    328: .if !commands(${_P})
1.194     lukem     329:        ${_MKTARGET_LINK}
1.231     lukem     330:        ${_CCLINK.${_P}} \
1.232     lukem     331:            ${DESTDIR:D-Wl,-nostdlib} \
                    332:            ${_LDFLAGS.${_P}} ${_LDSTATIC.${_P}} -o ${.TARGET} \
                    333:            ${OBJS.${_P}} ${_LDADD.${_P}} \
                    334:            ${DESTDIR:D-L${_GCC_LIBGCCDIR}} \
                    335:            ${_PROGLDOPTS}
1.247     darran    336: .if defined(CTFMERGE)
                    337:        ${CTFMERGE} ${CTFMFLAGS} -o ${.TARGET} ${OBJS.${_P}}
                    338: .endif
1.223     jmmv      339: .if defined(PAXCTL_FLAGS.${_P})
                    340:        ${PAXCTL} ${PAXCTL_FLAGS.${_P}} ${.TARGET}
1.218     christos  341: .endif
1.235     joerg     342: .if ${MKSTRIPIDENT} != "no"
                    343:        ${OBJCOPY} -R .ident ${.TARGET}
                    344: .endif
1.223     jmmv      345: .endif # !commands(${_P})
1.183     dsl       346:
1.223     jmmv      347: ${_P}.ro: ${OBJS.${_P}} ${DPADD}
1.207     dsl       348:        ${_MKTARGET_LINK}
1.254     joerg     349:        ${CC} ${LDFLAGS} -nostdlib -r -Wl,-dc -o ${.TARGET} ${OBJS.${_P}}
1.1       cgd       350:
1.223     jmmv      351: .if defined(_PROGDEBUG.${_P})
1.224     jmmv      352: ${_PROGDEBUG.${_P}}: ${_P}
1.215     lukem     353:        ${_MKTARGET_CREATE}
1.251     lukem     354:        (  ${OBJCOPY} --only-keep-debug ${_P} ${_PROGDEBUG.${_P}} \
                    355:        && ${OBJCOPY} --strip-debug -p -R .gnu_debuglink \
                    356:                --add-gnu-debuglink=${_PROGDEBUG.${_P}} ${_P} \
                    357:        ) || (rm -f ${_PROGDEBUG.${_P}}; false)
1.215     lukem     358: .endif
                    359:
1.223     jmmv      360: .endif # defined(OBJS.${_P}) && !empty(OBJS.${_P})                     # }
1.1       cgd       361:
1.223     jmmv      362: .if !defined(MAN.${_P})
                    363: MAN.${_P}=     ${_P}.1
                    364: .endif # !defined(MAN.${_P})
                    365: .if !empty(_APPEND_MANS:M[Yy][Ee][Ss])
                    366: MAN+=          ${MAN.${_P}}
                    367: .endif
1.11      mycroft   368:
1.223     jmmv      369: realall: ${_P} ${_PROGDEBUG.${_P}}
1.1       cgd       370:
1.223     jmmv      371: cleanprog: cleanprog-${_P}
                    372: cleanprog-${_P}:
                    373:        rm -f ${_P} ${_PROGDEBUG.${_P}}
1.134     tls       374:
1.223     jmmv      375: .if defined(OBJS.${_P}) && !empty(OBJS.${_P})
                    376: cleanobjs: cleanobjs-${_P}
                    377: cleanobjs-${_P}:
                    378:        rm -f ${OBJS.${_P}} ${LOBJS.${_P}}
1.59      cgd       379: .endif
1.27      mycroft   380:
1.223     jmmv      381: _PROG_INSTALL+=        proginstall-${_P}
1.114     mycroft   382:
1.223     jmmv      383: .if !target(proginstall-${_P})                                         # {
                    384: proginstall-${_P}::    ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} \
                    385:                ${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}}
                    386: .PRECIOUS:     ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} \
                    387:                ${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}}
1.215     lukem     388:
1.172     lukem     389: .if ${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.215     lukem     402: .endif
1.223     jmmv      403: .endif #  define(_PROGDEBUG.${_P})
1.215     lukem     404: .else  # MKUPDATE != no
1.255     pooka     405: .if defined(_RUMPINSTALL.${_P})
                    406: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __progrumpinstall
                    407: .else
1.223     jmmv      408: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __proginstall
1.255     pooka     409: .endif
1.223     jmmv      410: .if !defined(BUILD) && !make(all) && !make(${_P})
                    411: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: .MADE
                    412: .endif
                    413: .if defined(_PROGDEBUG.${_P})
                    414: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}: ${_PROGDEBUG.${_P}} __progdebuginstall
                    415: .if !defined(BUILD) && !make(all) && !make(${_P})
                    416: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}: .MADE
1.154     mycroft   417: .endif
1.223     jmmv      418: .endif #  defined(_PROGDEBUG.${_P})
1.215     lukem     419: .endif # MKUPDATE != no
                    420:
1.223     jmmv      421: .endif # !target(proginstall-${_P})                                    # }
                    422:
                    423: lint: lint-${_P}
                    424: lint-${_P}: ${LOBJS.${_P}}
                    425: .if defined(LOBJS.${_P}) && !empty(LOBJS.${_P})
                    426:        ${LINT} ${LINTFLAGS} ${_LDFLAGS.${_P}:C/-L[  ]*/-L/Wg:M-L*} ${LOBJS.${_P}} ${_LDADD.${_P}}
                    427: .endif
                    428:
                    429: .endfor # _P in ${PROGS} ${PROGS_CXX}                                  # }
1.23      mycroft   430:
1.225     jmmv      431: .if defined(OBJS) && !empty(OBJS) && \
                    432:     (empty(PROGS) && empty(PROGS_CXX))
                    433: cleanobjs: cleanobjs-plain
                    434: cleanobjs-plain:
                    435:        rm -f ${OBJS} ${LOBJS}
                    436: .endif
                    437:
1.74      mycroft   438: .if !target(proginstall)
1.223     jmmv      439: proginstall:: ${_PROG_INSTALL}
1.74      mycroft   440: .endif
1.197     lukem     441: .PHONY:                proginstall
1.74      mycroft   442:
1.223     jmmv      443:
                    444:
                    445: realall: ${SCRIPTS}
1.215     lukem     446: .if defined(SCRIPTS) && !target(scriptsinstall)                                # {
1.65      mycroft   447: SCRIPTSDIR?=${BINDIR}
                    448: SCRIPTSOWN?=${BINOWN}
                    449: SCRIPTSGRP?=${BINGRP}
                    450: SCRIPTSMODE?=${BINMODE}
1.113     mycroft   451:
                    452: scriptsinstall:: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.114     mycroft   453: .PRECIOUS: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.113     mycroft   454:
1.115     mycroft   455: __scriptinstall: .USE
1.192     lukem     456:        ${_MKTARGET_INSTALL}
1.139     tv        457:        ${INSTALL_FILE} \
1.116     mycroft   458:            -o ${SCRIPTSOWN_${.ALLSRC:T}:U${SCRIPTSOWN}} \
                    459:            -g ${SCRIPTSGRP_${.ALLSRC:T}:U${SCRIPTSGRP}} \
                    460:            -m ${SCRIPTSMODE_${.ALLSRC:T}:U${SCRIPTSMODE}} \
1.209     jwise     461:            ${.ALLSRC} ${.TARGET}
1.115     mycroft   462:
1.130     sommerfe  463: .for S in ${SCRIPTS:O:u}
1.172     lukem     464: .if ${MKUPDATE} == "no"
1.154     mycroft   465: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}! ${S} __scriptinstall
                    466: .if !defined(BUILD) && !make(all) && !make(${S})
                    467: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}! .MADE
                    468: .endif
                    469: .else
                    470: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: ${S} __scriptinstall
1.103     fredb     471: .if !defined(BUILD) && !make(all) && !make(${S})
1.113     mycroft   472: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: .MADE
1.63      christos  473: .endif
1.154     mycroft   474: .endif
1.63      christos  475: .endfor
1.215     lukem     476: .endif                                                                 # }
1.1       cgd       477:
1.74      mycroft   478: .if !target(scriptsinstall)
                    479: scriptsinstall::
1.1       cgd       480: .endif
1.197     lukem     481: .PHONY:                scriptsinstall
1.1       cgd       482:
1.138     tv        483: ##### Pull in related .mk logic
1.241     apb       484: LINKSOWN?= ${BINOWN}
                    485: LINKSGRP?= ${BINGRP}
                    486: LINKSMODE?= ${BINMODE}
1.1       cgd       487: .include <bsd.man.mk>
1.50      jtc       488: .include <bsd.nls.mk>
1.66      christos  489: .include <bsd.files.mk>
1.63      christos  490: .include <bsd.inc.mk>
1.83      mycroft   491: .include <bsd.links.mk>
1.180     lukem     492: .include <bsd.sys.mk>
1.26      mycroft   493: .include <bsd.dep.mk>
1.88      mycroft   494:
1.240     cube      495: cleanextra: .PHONY
                    496: .if defined(CLEANFILES) && !empty(CLEANFILES)
                    497:        rm -f ${CLEANFILES}
                    498: .endif
                    499:
1.138     tv        500: ${TARGETS}:    # ensure existence
1.166     lukem     501:
                    502: .endif # HOSTPROG

CVSweb <webmaster@jp.NetBSD.org>