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

1.266   ! joerg       1: #      $NetBSD: bsd.prog.mk,v 1.265 2011/04/26 08:22:17 he 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.25      mycroft    55: CFLAGS+=       ${COPTS}
1.212     mrg        56: OBJCFLAGS+=    ${OBJCOPTS}
1.193     dsl        57: MKDEP_SUFFIXES?=       .o .ln
1.1       cgd        58:
1.247     darran     59: # CTF preserve debug symbols
                     60: .if defined(MKDTRACE) && (${MKDTRACE} != "no") && (${CFLAGS:M-g} != "")
                     61: CTFFLAGS+= -g
                     62: CTFMFLAGS+= -g
                     63: .endif
                     64:
1.162     thorpej    65: # ELF platforms depend on crti.o, crtbegin.o, crtend.o, and crtn.o
1.153     pk         66: .ifndef LIBCRTBEGIN
1.167     thorpej    67: LIBCRTBEGIN=   ${DESTDIR}/usr/lib/crti.o ${_GCC_CRTBEGIN}
1.152     christos   68: .MADE: ${LIBCRTBEGIN}
1.153     pk         69: .endif
                     70: .ifndef LIBCRTEND
1.167     thorpej    71: LIBCRTEND=     ${_GCC_CRTEND} ${DESTDIR}/usr/lib/crtn.o
1.152     christos   72: .MADE: ${LIBCRTEND}
1.153     pk         73: .endif
1.144     lukem      74: _SHLINKER=     ${SHLINKDIR}/ld.elf_so
1.69      thorpej    75:
1.153     pk         76: .ifndef LIBCRT0
                     77: LIBCRT0=       ${DESTDIR}/usr/lib/crt0.o
1.152     christos   78: .MADE: ${LIBCRT0}
1.153     pk         79: .endif
1.95      ross       80:
1.202     lukem      81: ##### Installed system library definitions
                     82: #
                     83: #      E.g.
                     84: #              LIBC?=${DESTDIR}/usr/lib/libc.a
1.234     mrg        85: #              LIBX11?=${DESTDIR}/usr/X11R7/lib/libX11.a
1.202     lukem      86: #      etc..
                     87:
                     88: .for _lib in \
1.221     joerg      89:        archive asn1 bluetooth bsdmalloc bz2 c c_pic cdk com_err compat \
                     90:        crypt crypto crypto_idea crypto_mdc2 crypto_rc5 \
1.203     lukem      91:        curses dbm des edit event \
1.265     he         92:        fetch form fl g2c gcc gnumalloc gssapi hdb heimbase heimntlm hx509 \
                     93:        intl ipsec \
1.250     mbalmer    94:        kadm5clnt kadm5srv kafs krb5 kvm l lber ldap ldap_r lua \
1.203     lukem      95:        m magic menu objc ossaudio pam pcap pci pmc posix pthread pthread_dbg \
1.259     christos   96:        puffs radius resolv rmt roken rpcsvc rt rump rumpuser saslc skey sl ss \
1.230     pooka      97:        ssh ssl termcap usbhid util wrap y z bind9 dns lwres isccfg isccc isc \
                     98:        \
                     99:        rumpfs_cd9660fs rumpfs_efs rumpfs_ext2fs rumpfs_ffs rumpfs_hfs \
                    100:        rumpfs_lfs rumpfs_msdosfs rumpfs_nfs rumpfs_ntfs rumpfs_syspuffs \
1.265     he        101:        rumpfs_tmpfs rumpfs_udf rumpfs_ufs \
                    102:        wind
1.202     lukem     103: .ifndef LIB${_lib:tu}
                    104: LIB${_lib:tu}= ${DESTDIR}/usr/lib/lib${_lib}.a
                    105: .MADE:         ${LIB${_lib:tu}}        # Note: ${DESTDIR} will be expanded
                    106: .endif
                    107: .endfor
1.260     jmmv      108: # atf-c and atf-c++ are special cases because we cannot use [-+] as part of
                    109: # make(1) variable names.  Just define them here.
                    110: LIBATF_C=      ${DESTDIR}/usr/lib/libatf-c.a
                    111: LIBATF_CXX=    ${DESTDIR}/usr/lib/libatf-c++.a
                    112: .MADE:         ${LIBATF_C} ${LIBATF_CXX}
1.202     lukem     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.265     he        121: PAM_STATIC_LDADD+= -lkafs -lkrb5 -lhx509 -lwind -lasn1 \
                    122:        -lroken -lcom_err -lheimbase -lcrypto
                    123: PAM_STATIC_DPADD+= ${LIBKAFS} ${LIBKRB5} ${LIBHX509} ${LIBWIND} ${LIBASN1} \
                    124:        ${LIBROKEN} ${LIBCOM_ERR} ${LIBHEIMBASE} ${LIBCRYPTO}
1.208     christos  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
                    165: _PROGLDOPTS+=  -Wl,-dynamic-linker=${_SHLINKER}
1.161     itohy     166: .endif
1.187     lukem     167: .if ${SHLIBDIR} != "/usr/lib"
1.264     joerg     168: _PROGLDOPTS+=  -Wl,-rpath,${SHLIBDIR} \
1.263     joerg     169:                -L=${SHLIBDIR}
1.187     lukem     170: .elif ${SHLIBINSTALLDIR} != "/usr/lib"
1.264     joerg     171: _PROGLDOPTS+=  -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR} \
1.263     joerg     172:                -L=${SHLIBINSTALLDIR}
1.144     lukem     173: .endif
                    174:
1.223     jmmv      175: __proginstall: .USE
                    176:        ${_MKTARGET_INSTALL}
                    177:        ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
                    178:                ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
                    179:
1.255     pooka     180: __progrumpinstall: .USE
                    181:        ${_MKTARGET_INSTALL}
                    182:        ${INSTALL_FILE} -o ${RUMPBINOWN} -g ${RUMPBINGRP} -m ${RUMPBINMODE} \
                    183:                ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
                    184:
1.223     jmmv      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:
1.145     thorpej   202: .if defined(PROG_CXX)
1.223     jmmv      203: PROG=          ${PROG_CXX}
1.231     lukem     204: _CCLINK=       ${CXX} ${_CCLINKFLAGS}
1.223     jmmv      205: .endif
                    206:
1.255     pooka     207: .if defined(RUMPPRG)
                    208: PROG=                  ${RUMPPRG}
1.256     pooka     209: .ifndef CRUNCHEDPROG
1.255     pooka     210: PROGS=                 ${RUMPPRG} rump.${RUMPPRG}
                    211: . if defined(SRCS)
                    212: SRCS.rump.${PROG}:=    ${SRCS} ${PROG}_rumpops.c ${RUMPSRCS}
                    213: SRCS+=                 ${PROG}_hostops.c
                    214: . else
                    215: SRCS=                  ${PROG}.c ${PROG}_hostops.c
                    216: SRCS.rump.${PROG}=     ${PROG}.c ${PROG}_rumpops.c ${RUMPSRCS}
                    217: . endif
1.257     pooka     218: DPSRCS+=               ${PROG}_rumpops.c ${RUMPSRCS}
1.255     pooka     219: LDADD.rump.${PROG}+=   -lrumpclient
                    220: DPADD.rump.${PROG}+=   ${LIBRUMPCLIENT}
                    221: MAN.rump.${PROG}=      # defined but feeling empty
                    222: _RUMPINSTALL.rump.${PROG}=# defined
1.256     pooka     223: .else # CRUNCHEDPROG
                    224: PROGS=                 ${PROG}
                    225: CPPFLAGS+=             -DCRUNCHOPS
                    226: .endif
1.255     pooka     227: .endif
                    228:
1.223     jmmv      229: .if defined(PROG)
1.231     lukem     230: _CCLINK?=      ${CC} ${_CCLINKFLAGS}
1.223     jmmv      231: .  if defined(MAN)
                    232: MAN.${PROG}=   ${MAN}
                    233: _APPEND_MANS=  no
                    234: .  endif
                    235: .  if !defined(OBJS)
                    236: OBJS=          ${OBJS.${PROG}}
                    237: .  endif
                    238: .  if defined(PROGNAME)
                    239: PROGNAME.${PROG}=      ${PROGNAME}
                    240: .  endif
                    241: .  if defined(SRCS)
                    242: SRCS.${PROG}=  ${SRCS}
                    243: _APPEND_SRCS=  no
                    244: .  endif
                    245: .endif
                    246:
                    247: # Turn the single-program PROG and PROG_CXX variables into their multi-word
                    248: # counterparts, PROGS and PROGS_CXX.
1.255     pooka     249: .if !defined(RUMPPRG)
                    250: .  if defined(PROG_CXX) && !defined(PROGS_CXX)
1.223     jmmv      251: PROGS_CXX=     ${PROG_CXX}
1.262     jmmv      252: .  elif defined(PROG) && !defined(PROGS)
1.223     jmmv      253: PROGS=         ${PROG}
1.255     pooka     254: .  endif
1.223     jmmv      255: .endif
                    256:
                    257: #
                    258: # Per-program definitions and targets.
                    259: #
                    260:
                    261: # Definitions specific to C programs.
                    262: .for _P in ${PROGS}
                    263: SRCS.${_P}?=   ${_P}.c
1.231     lukem     264: _CCLINK.${_P}= ${CC} ${_CCLINKFLAGS}
1.223     jmmv      265: .endfor
                    266:
                    267: # Definitions specific to C++ programs.
                    268: .for _P in ${PROGS_CXX}
                    269: SRCS.${_P}?=   ${_P}.cc
1.231     lukem     270: _CCLINK.${_P}= ${CXX} ${_CCLINKFLAGS}
1.223     jmmv      271: .endfor
                    272:
                    273: # Language-independent definitions.
                    274: .for _P in ${PROGS} ${PROGS_CXX}                                       # {
                    275:
                    276: BINDIR.${_P}?=         ${BINDIR}
                    277: PROGNAME.${_P}?=       ${_P}
                    278:
1.249     mrg       279: .if ${MKDEBUG} != "no" && !commands(${_P})
1.223     jmmv      280: _PROGDEBUG.${_P}:=     ${PROGNAME.${_P}}.debug
1.145     thorpej   281: .endif
                    282:
1.223     jmmv      283: .if defined(PAXCTL_FLAGS)
                    284: PAXCTL_FLAGS.${_P}?= ${PAXCTL_FLAGS}
1.215     lukem     285: .endif
                    286:
1.223     jmmv      287: ##### PROG specific flags.
1.244     uebayasi  288:
1.223     jmmv      289: _LDADD.${_P}=          ${LDADD}    ${LDADD.${_P}}
                    290: _LDFLAGS.${_P}=                ${LDFLAGS}  ${LDFLAGS.${_P}}
                    291: _LDSTATIC.${_P}=       ${LDSTATIC} ${LDSTATIC.${_P}}
                    292:
                    293: ##### Build and install rules
                    294: .if !empty(_APPEND_SRCS:M[Yy][Ee][Ss])
                    295: SRCS+=         ${SRCS.${_P}} # For bsd.dep.mk
                    296: .endif
                    297:
                    298: _YPSRCS.${_P}= ${SRCS.${_P}:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS.${_P}:M*.y:.y=.h}}
                    299:
                    300: DPSRCS+=               ${_YPSRCS.${_P}}
                    301: CLEANFILES+=           ${_YPSRCS.${_P}}
                    302:
                    303: .if !empty(SRCS.${_P}:N*.h:N*.sh:N*.fth)
                    304: OBJS.${_P}+=   ${SRCS.${_P}:N*.h:N*.sh:N*.fth:R:S/$/.o/g}
                    305: LOBJS.${_P}+=  ${LSRCS:.c=.ln} ${SRCS.${_P}:M*.c:.c=.ln}
1.157     thorpej   306: .endif
                    307:
1.223     jmmv      308: .if defined(OBJS.${_P}) && !empty(OBJS.${_P})                  # {
                    309: .NOPATH: ${OBJS.${_P}} ${_P} ${_YPSRCS.${_P}}
                    310:
                    311: ${OBJS.${_P}} ${LOBJS.${_P}}: ${DPSRCS}
1.182     lukem     312:
1.223     jmmv      313: ${_P}: .gdbinit ${LIBCRT0} ${OBJS.${_P}} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
                    314: .if !commands(${_P})
1.194     lukem     315:        ${_MKTARGET_LINK}
1.231     lukem     316:        ${_CCLINK.${_P}} \
1.232     lukem     317:            ${_LDFLAGS.${_P}} ${_LDSTATIC.${_P}} -o ${.TARGET} \
                    318:            ${OBJS.${_P}} ${_LDADD.${_P}} \
                    319:            ${_PROGLDOPTS}
1.247     darran    320: .if defined(CTFMERGE)
                    321:        ${CTFMERGE} ${CTFMFLAGS} -o ${.TARGET} ${OBJS.${_P}}
                    322: .endif
1.223     jmmv      323: .if defined(PAXCTL_FLAGS.${_P})
                    324:        ${PAXCTL} ${PAXCTL_FLAGS.${_P}} ${.TARGET}
1.218     christos  325: .endif
1.235     joerg     326: .if ${MKSTRIPIDENT} != "no"
                    327:        ${OBJCOPY} -R .ident ${.TARGET}
                    328: .endif
1.223     jmmv      329: .endif # !commands(${_P})
1.183     dsl       330:
1.223     jmmv      331: ${_P}.ro: ${OBJS.${_P}} ${DPADD}
1.207     dsl       332:        ${_MKTARGET_LINK}
1.254     joerg     333:        ${CC} ${LDFLAGS} -nostdlib -r -Wl,-dc -o ${.TARGET} ${OBJS.${_P}}
1.1       cgd       334:
1.223     jmmv      335: .if defined(_PROGDEBUG.${_P})
1.224     jmmv      336: ${_PROGDEBUG.${_P}}: ${_P}
1.215     lukem     337:        ${_MKTARGET_CREATE}
1.251     lukem     338:        (  ${OBJCOPY} --only-keep-debug ${_P} ${_PROGDEBUG.${_P}} \
                    339:        && ${OBJCOPY} --strip-debug -p -R .gnu_debuglink \
                    340:                --add-gnu-debuglink=${_PROGDEBUG.${_P}} ${_P} \
                    341:        ) || (rm -f ${_PROGDEBUG.${_P}}; false)
1.215     lukem     342: .endif
                    343:
1.223     jmmv      344: .endif # defined(OBJS.${_P}) && !empty(OBJS.${_P})                     # }
1.1       cgd       345:
1.223     jmmv      346: .if !defined(MAN.${_P})
                    347: MAN.${_P}=     ${_P}.1
                    348: .endif # !defined(MAN.${_P})
                    349: .if !empty(_APPEND_MANS:M[Yy][Ee][Ss])
                    350: MAN+=          ${MAN.${_P}}
                    351: .endif
1.11      mycroft   352:
1.223     jmmv      353: realall: ${_P} ${_PROGDEBUG.${_P}}
1.1       cgd       354:
1.223     jmmv      355: cleanprog: cleanprog-${_P}
                    356: cleanprog-${_P}:
                    357:        rm -f ${_P} ${_PROGDEBUG.${_P}}
1.134     tls       358:
1.223     jmmv      359: .if defined(OBJS.${_P}) && !empty(OBJS.${_P})
                    360: cleanobjs: cleanobjs-${_P}
                    361: cleanobjs-${_P}:
                    362:        rm -f ${OBJS.${_P}} ${LOBJS.${_P}}
1.59      cgd       363: .endif
1.27      mycroft   364:
1.223     jmmv      365: _PROG_INSTALL+=        proginstall-${_P}
1.114     mycroft   366:
1.223     jmmv      367: .if !target(proginstall-${_P})                                         # {
                    368: proginstall-${_P}::    ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} \
                    369:                ${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}}
                    370: .PRECIOUS:     ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} \
                    371:                ${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}}
1.215     lukem     372:
1.172     lukem     373: .if ${MKUPDATE} == "no"
1.255     pooka     374: .if defined(_RUMPINSTALL.${_P})
                    375: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! ${_P} __progrumpinstall
                    376: .else
1.223     jmmv      377: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! ${_P} __proginstall
1.255     pooka     378: .endif
1.223     jmmv      379: .if !defined(BUILD) && !make(all) && !make(${_P})
                    380: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! .MADE
                    381: .endif
                    382: .if defined(_PROGDEBUG.${_P})
                    383: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}! ${_PROGDEBUG.${_P}} __progdebuginstall
                    384: .if !defined(BUILD) && !make(all) && !make(${_P})
                    385: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}! .MADE
1.215     lukem     386: .endif
1.223     jmmv      387: .endif #  define(_PROGDEBUG.${_P})
1.215     lukem     388: .else  # MKUPDATE != no
1.255     pooka     389: .if defined(_RUMPINSTALL.${_P})
                    390: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __progrumpinstall
                    391: .else
1.223     jmmv      392: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __proginstall
1.255     pooka     393: .endif
1.223     jmmv      394: .if !defined(BUILD) && !make(all) && !make(${_P})
                    395: ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: .MADE
                    396: .endif
                    397: .if defined(_PROGDEBUG.${_P})
                    398: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}: ${_PROGDEBUG.${_P}} __progdebuginstall
                    399: .if !defined(BUILD) && !make(all) && !make(${_P})
                    400: ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}: .MADE
1.154     mycroft   401: .endif
1.223     jmmv      402: .endif #  defined(_PROGDEBUG.${_P})
1.215     lukem     403: .endif # MKUPDATE != no
                    404:
1.223     jmmv      405: .endif # !target(proginstall-${_P})                                    # }
                    406:
                    407: lint: lint-${_P}
                    408: lint-${_P}: ${LOBJS.${_P}}
                    409: .if defined(LOBJS.${_P}) && !empty(LOBJS.${_P})
                    410:        ${LINT} ${LINTFLAGS} ${_LDFLAGS.${_P}:C/-L[  ]*/-L/Wg:M-L*} ${LOBJS.${_P}} ${_LDADD.${_P}}
                    411: .endif
                    412:
                    413: .endfor # _P in ${PROGS} ${PROGS_CXX}                                  # }
1.23      mycroft   414:
1.225     jmmv      415: .if defined(OBJS) && !empty(OBJS) && \
                    416:     (empty(PROGS) && empty(PROGS_CXX))
                    417: cleanobjs: cleanobjs-plain
                    418: cleanobjs-plain:
                    419:        rm -f ${OBJS} ${LOBJS}
                    420: .endif
                    421:
1.74      mycroft   422: .if !target(proginstall)
1.223     jmmv      423: proginstall:: ${_PROG_INSTALL}
1.74      mycroft   424: .endif
1.197     lukem     425: .PHONY:                proginstall
1.74      mycroft   426:
1.223     jmmv      427:
                    428:
                    429: realall: ${SCRIPTS}
1.215     lukem     430: .if defined(SCRIPTS) && !target(scriptsinstall)                                # {
1.65      mycroft   431: SCRIPTSDIR?=${BINDIR}
                    432: SCRIPTSOWN?=${BINOWN}
                    433: SCRIPTSGRP?=${BINGRP}
                    434: SCRIPTSMODE?=${BINMODE}
1.113     mycroft   435:
                    436: scriptsinstall:: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.114     mycroft   437: .PRECIOUS: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
1.113     mycroft   438:
1.115     mycroft   439: __scriptinstall: .USE
1.192     lukem     440:        ${_MKTARGET_INSTALL}
1.139     tv        441:        ${INSTALL_FILE} \
1.116     mycroft   442:            -o ${SCRIPTSOWN_${.ALLSRC:T}:U${SCRIPTSOWN}} \
                    443:            -g ${SCRIPTSGRP_${.ALLSRC:T}:U${SCRIPTSGRP}} \
                    444:            -m ${SCRIPTSMODE_${.ALLSRC:T}:U${SCRIPTSMODE}} \
1.209     jwise     445:            ${.ALLSRC} ${.TARGET}
1.115     mycroft   446:
1.130     sommerfe  447: .for S in ${SCRIPTS:O:u}
1.172     lukem     448: .if ${MKUPDATE} == "no"
1.154     mycroft   449: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}! ${S} __scriptinstall
                    450: .if !defined(BUILD) && !make(all) && !make(${S})
                    451: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}! .MADE
                    452: .endif
                    453: .else
                    454: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: ${S} __scriptinstall
1.103     fredb     455: .if !defined(BUILD) && !make(all) && !make(${S})
1.113     mycroft   456: ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: .MADE
1.63      christos  457: .endif
1.154     mycroft   458: .endif
1.63      christos  459: .endfor
1.215     lukem     460: .endif                                                                 # }
1.1       cgd       461:
1.74      mycroft   462: .if !target(scriptsinstall)
                    463: scriptsinstall::
1.1       cgd       464: .endif
1.197     lukem     465: .PHONY:                scriptsinstall
1.1       cgd       466:
1.138     tv        467: ##### Pull in related .mk logic
1.241     apb       468: LINKSOWN?= ${BINOWN}
                    469: LINKSGRP?= ${BINGRP}
                    470: LINKSMODE?= ${BINMODE}
1.1       cgd       471: .include <bsd.man.mk>
1.50      jtc       472: .include <bsd.nls.mk>
1.66      christos  473: .include <bsd.files.mk>
1.63      christos  474: .include <bsd.inc.mk>
1.83      mycroft   475: .include <bsd.links.mk>
1.180     lukem     476: .include <bsd.sys.mk>
1.26      mycroft   477: .include <bsd.dep.mk>
1.266   ! joerg     478: .include <bsd.clang-analyze.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>