[BACK]Return to bsd.prog.mk CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / share / mk

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/share/mk/bsd.prog.mk between version 1.222 and 1.266

version 1.222, 2007/11/04 23:28:20 version 1.266, 2011/08/27 18:35:20
Line 7 
Line 7 
 .include <bsd.shlib.mk>  .include <bsd.shlib.mk>
 .include <bsd.gcc.mk>  .include <bsd.gcc.mk>
   
 .if defined(PROG_CXX)  #
 PROG=   ${PROG_CXX}  # Definitions and targets shared among all programs built by a single
 .endif  # Makefile.
   #
 .if defined(PAXCTL_FLAGS)  
 PAXCTL_FLAGS.${PROG}?= ${PAXCTL_FLAGS}  
 .endif  
   
 ##### Basic targets  ##### Basic targets
 realinstall:    proginstall scriptsinstall  realinstall:    proginstall scriptsinstall
 clean:          cleanprog  clean:          cleanprog
   
 ##### PROG specific flags.  .gdbinit:
 COPTS+=     ${COPTS.${PROG}}          rm -f .gdbinit
 CPPFLAGS+=  ${CPPFLAGS.${PROG}}  .if defined(DESTDIR) && !empty(DESTDIR)
 CXXFLAGS+=  ${CXXFLAGS.${PROG}}          echo "set solib-absolute-prefix ${DESTDIR}" > .gdbinit
 OBJCOPTS+=  ${OBJCOPTS.${PROG}}  .else
 LDADD+=     ${LDADD.${PROG}}          touch .gdbinit
 LDFLAGS+=   ${LDFLAGS.${PROG}}  .endif
 LDSTATIC+=  ${LDSTATIC.${PROG}}  .for __gdbinit in ${GDBINIT}
           echo "source ${__gdbinit}" >> .gdbinit
 ##### Default values  .endfor
 CPPFLAGS+=      ${DESTDIR:D-nostdinc ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include}  
 CXXFLAGS+=      ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEMXX} ${DESTDIR}/usr/include/g++}  cleanobjs: .PHONY
   
   cleanprog: .PHONY cleanobjs cleanextra
           rm -f a.out [Ee]rrs mklog core *.core .gdbinit
   
   .if defined(SHAREDSTRINGS)
   CLEANFILES+=strings
   .c.o:
           ${CC} -E ${CPPFLAGS} ${CFLAGS} ${.IMPSRC} | xstr -c -
           @${CC} ${CPPFLAGS} ${CFLAGS} -c x.c -o ${.TARGET}
           @rm -f x.c
   
   .cc.o .cpp.o .cxx.o .C.o:
           ${CXX} -E ${CPPFLAGS} ${CXXFLAGS} ${.IMPSRC} | xstr -c -
           @mv -f x.c x.cc
           @${CXX} ${CPPFLAGS} ${CXXFLAGS} -c x.cc -o ${.TARGET}
           @rm -f x.cc
   .endif
   
   .if defined(MKPIE) && (${MKPIE} != "no")
   CFLAGS+=        ${PIE_CFLAGS}
   AFLAGS+=        ${PIE_AFLAGS}
   LDFLAGS+=       ${PIE_LDFLAGS}
   .endif
   
 CFLAGS+=        ${COPTS}  CFLAGS+=        ${COPTS}
 OBJCFLAGS+=     ${OBJCOPTS}  OBJCFLAGS+=     ${OBJCOPTS}
 MKDEP_SUFFIXES?=        .o .ln  MKDEP_SUFFIXES?=        .o .ln
   
   # CTF preserve debug symbols
   .if defined(MKDTRACE) && (${MKDTRACE} != "no") && (${CFLAGS:M-g} != "")
   CTFFLAGS+= -g
   CTFMFLAGS+= -g
   .endif
   
 # ELF platforms depend on crti.o, crtbegin.o, crtend.o, and crtn.o  # ELF platforms depend on crti.o, crtbegin.o, crtend.o, and crtn.o
 .if ${OBJECT_FMT} == "ELF"  
 .ifndef LIBCRTBEGIN  .ifndef LIBCRTBEGIN
 LIBCRTBEGIN=    ${DESTDIR}/usr/lib/crti.o ${_GCC_CRTBEGIN}  LIBCRTBEGIN=    ${DESTDIR}/usr/lib/crti.o ${_GCC_CRTBEGIN}
 .MADE: ${LIBCRTBEGIN}  .MADE: ${LIBCRTBEGIN}
Line 46  LIBCRTEND= ${_GCC_CRTEND} ${DESTDIR}/usr
Line 72  LIBCRTEND= ${_GCC_CRTEND} ${DESTDIR}/usr
 .MADE: ${LIBCRTEND}  .MADE: ${LIBCRTEND}
 .endif  .endif
 _SHLINKER=      ${SHLINKDIR}/ld.elf_so  _SHLINKER=      ${SHLINKDIR}/ld.elf_so
 .else  
 LIBCRTBEGIN?=  
 LIBCRTEND?=  
 _SHLINKER=      ${SHLINKDIR}/ld.so  
 .endif  
   
 .ifndef LIBCRT0  .ifndef LIBCRT0
 LIBCRT0=        ${DESTDIR}/usr/lib/crt0.o  LIBCRT0=        ${DESTDIR}/usr/lib/crt0.o
Line 61  LIBCRT0= ${DESTDIR}/usr/lib/crt0.o
Line 82  LIBCRT0= ${DESTDIR}/usr/lib/crt0.o
 #  #
 #       E.g.  #       E.g.
 #               LIBC?=${DESTDIR}/usr/lib/libc.a  #               LIBC?=${DESTDIR}/usr/lib/libc.a
 #               LIBX11?=${DESTDIR}/usr/X11R6/lib/libX11.a  #               LIBX11?=${DESTDIR}/usr/X11R7/lib/libX11.a
 #       etc..  #       etc..
   
 .for _lib in \  .for _lib in \
         archive asn1 bluetooth bsdmalloc bz2 c c_pic cdk com_err compat \          archive asn1 bluetooth bsdmalloc bz2 c c_pic cdk com_err compat \
         crypt crypto crypto_idea crypto_mdc2 crypto_rc5 \          crypt crypto crypto_idea crypto_mdc2 crypto_rc5 \
         curses dbm des edit event \          curses dbm des edit event \
         form fl g2c gcc gnumalloc gssapi hdb intl ipsec \          fetch form fl g2c gcc gnumalloc gssapi hdb heimbase heimntlm hx509 \
         kadm5clnt kadm5srv kafs krb5 kvm l \          intl ipsec \
           kadm5clnt kadm5srv kafs krb5 kvm l lber ldap ldap_r lua \
         m magic menu objc ossaudio pam pcap pci pmc posix pthread pthread_dbg \          m magic menu objc ossaudio pam pcap pci pmc posix pthread pthread_dbg \
         puffs radius resolv rmt roken rpcsvc rt sdp skey sl ss ssh ssl termcap \          puffs radius resolv rmt roken rpcsvc rt rump rumpuser saslc skey sl ss \
         usbhid util wrap y z bind9 dns lwres isccfg isccc isc          ssh ssl termcap usbhid util wrap y z bind9 dns lwres isccfg isccc isc \
           \
           rumpfs_cd9660fs rumpfs_efs rumpfs_ext2fs rumpfs_ffs rumpfs_hfs \
           rumpfs_lfs rumpfs_msdosfs rumpfs_nfs rumpfs_ntfs rumpfs_syspuffs \
           rumpfs_tmpfs rumpfs_udf rumpfs_ufs \
           wind
 .ifndef LIB${_lib:tu}  .ifndef LIB${_lib:tu}
 LIB${_lib:tu}=  ${DESTDIR}/usr/lib/lib${_lib}.a  LIB${_lib:tu}=  ${DESTDIR}/usr/lib/lib${_lib}.a
 .MADE:          ${LIB${_lib:tu}}        # Note: ${DESTDIR} will be expanded  .MADE:          ${LIB${_lib:tu}}        # Note: ${DESTDIR} will be expanded
 .endif  .endif
 .endfor  .endfor
   # atf-c and atf-c++ are special cases because we cannot use [-+] as part of
   # make(1) variable names.  Just define them here.
   LIBATF_C=       ${DESTDIR}/usr/lib/libatf-c.a
   LIBATF_CXX=     ${DESTDIR}/usr/lib/libatf-c++.a
   .MADE:          ${LIBATF_C} ${LIBATF_CXX}
   
 # PAM applications, if linked statically, need more libraries  # PAM applications, if linked statically, need more libraries
 .if (${MKPIC} == "no")  .if (${MKPIC} == "no")
Line 86  PAM_STATIC_LDADD+= -lssh
Line 118  PAM_STATIC_LDADD+= -lssh
 PAM_STATIC_DPADD+= ${LIBSSH}  PAM_STATIC_DPADD+= ${LIBSSH}
 .endif  .endif
 .if (${MKKERBEROS} != "no")  .if (${MKKERBEROS} != "no")
 PAM_STATIC_LDADD+= -lkafs -lkrb5 -lasn1 -lroken -lcom_err -lcrypto  PAM_STATIC_LDADD+= -lkafs -lkrb5 -lhx509 -lwind -lasn1 \
 PAM_STATIC_DPADD+= ${LIBKAFS} ${LIBKRB5} ${LIBASN1} ${LIBROKEN} \          -lroken -lcom_err -lheimbase -lcrypto
         ${LIBCOM_ERR} ${LIBCRYPTO}  PAM_STATIC_DPADD+= ${LIBKAFS} ${LIBKRB5} ${LIBHX509} ${LIBWIND} ${LIBASN1} \
           ${LIBROKEN} ${LIBCOM_ERR} ${LIBHEIMBASE} ${LIBCRYPTO}
 .endif  .endif
 .if (${MKSKEY} != "no")  .if (${MKSKEY} != "no")
 PAM_STATIC_LDADD+= -lskey  PAM_STATIC_LDADD+= -lskey
Line 118  LIBSUPCXX= ${DESTDIR}/usr/lib/libsupc++.
Line 151  LIBSUPCXX= ${DESTDIR}/usr/lib/libsupc++.
         Xi Xinerama xkbfile Xmu Xmuu Xpm Xrandr Xrender Xss Xt \          Xi Xinerama xkbfile Xmu Xmuu Xpm Xrandr Xrender Xss Xt \
         XTrap Xtst Xv Xxf86dga Xxf86misc Xxf86vm          XTrap Xtst Xv Xxf86dga Xxf86misc Xxf86vm
 .ifndef LIB${_lib:tu}  .ifndef LIB${_lib:tu}
 LIB${_lib:tu}=  ${DESTDIR}/usr/X11R6/lib/lib${_lib}.a  LIB${_lib:tu}=  ${DESTDIR}${X11USRLIBDIR}/lib${_lib}.a
 .MADE:          ${LIB${_lib:tu}}        # Note: ${DESTDIR} will be expanded  .MADE:          ${LIB${_lib:tu}}        # Note: ${DESTDIR} will be expanded
 .endif  .endif
 .endfor  .endfor
   
   
 ##### Build and install rules  
 .if defined(SHAREDSTRINGS)  
 CLEANFILES+=strings  
 .c.o:  
         ${CC} -E ${CPPFLAGS} ${CFLAGS} ${.IMPSRC} | xstr -c -  
         @${CC} ${CPPFLAGS} ${CFLAGS} -c x.c -o ${.TARGET}  
         @rm -f x.c  
   
 .cc.o .cpp.o .cxx.o .C.o:  
         ${CXX} -E ${CPPFLAGS} ${CXXFLAGS} ${.IMPSRC} | xstr -c -  
         @mv -f x.c x.cc  
         @${CXX} ${CPPFLAGS} ${CXXFLAGS} -c x.cc -o ${.TARGET}  
         @rm -f x.cc  
 .endif  
   
 .if defined(PROG)                                                       # {  
 .if defined(PROG_CXX)  
 SRCS?=          ${PROG}.cc  
 .else  
 SRCS?=          ${PROG}.c  
 .endif  
   
 PROGNAME?=      ${PROG}  
   
 .if defined(RESCUEDIR)  .if defined(RESCUEDIR)
 CPPFLAGS+=      -DRESCUEDIR=\"${RESCUEDIR}\"  CPPFLAGS+=      -DRESCUEDIR=\"${RESCUEDIR}\"
 .endif  .endif
   
 _YPSRCS=        ${SRCS:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS:M*.y:.y=.h}}  
   
 DPSRCS+=        ${_YPSRCS}  
 CLEANFILES+=    ${_YPSRCS}  
   
 .if !empty(SRCS:N*.h:N*.sh:N*.fth)  
 OBJS+=          ${SRCS:N*.h:N*.sh:N*.fth:R:S/$/.o/g}  
 LOBJS+=         ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}  
 .endif  
   
 .if defined(OBJS) && !empty(OBJS)                                       # {  
 .NOPATH: ${OBJS} ${PROG} ${_YPSRCS}  
   
 _PROGLDOPTS=  _PROGLDOPTS=
 .if ${SHLINKDIR} != "/usr/libexec"      # XXX: change or remove if ld.so moves  .if ${SHLINKDIR} != "/usr/libexec"      # XXX: change or remove if ld.so moves
 .if ${OBJECT_FMT} == "ELF"  
 _PROGLDOPTS+=   -Wl,-dynamic-linker=${_SHLINKER}  _PROGLDOPTS+=   -Wl,-dynamic-linker=${_SHLINKER}
 .endif  .endif
 .endif  
 .if ${SHLIBDIR} != "/usr/lib"  .if ${SHLIBDIR} != "/usr/lib"
 _PROGLDOPTS+=   -Wl,-rpath-link,${DESTDIR}${SHLIBDIR}:${DESTDIR}/usr/lib \  _PROGLDOPTS+=   -Wl,-rpath,${SHLIBDIR} \
                 -R${SHLIBDIR} \                  -L=${SHLIBDIR}
                 -L${DESTDIR}${SHLIBDIR}  
 .elif ${SHLIBINSTALLDIR} != "/usr/lib"  .elif ${SHLIBINSTALLDIR} != "/usr/lib"
 _PROGLDOPTS+=   -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR}:${DESTDIR}/usr/lib \  _PROGLDOPTS+=   -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR} \
                 -L${DESTDIR}${SHLIBINSTALLDIR}                  -L=${SHLIBINSTALLDIR}
 .endif  .endif
   
   __proginstall: .USE
           ${_MKTARGET_INSTALL}
           ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
                   ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
   
   __progrumpinstall: .USE
           ${_MKTARGET_INSTALL}
           ${INSTALL_FILE} -o ${RUMPBINOWN} -g ${RUMPBINGRP} -m ${RUMPBINMODE} \
                   ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
   
   __progdebuginstall: .USE
           ${_MKTARGET_INSTALL}
           ${INSTALL_FILE} -o ${DEBUGOWN} -g ${DEBUGGRP} -m ${DEBUGMODE} \
                   ${.ALLSRC} ${.TARGET}
   
   
   
   #
   # Backwards compatibility with Makefiles that assume that bsd.prog.mk
   # can only build a single binary.
   #
   
   _APPEND_MANS=yes
   _APPEND_SRCS=yes
   
   _CCLINKFLAGS=
   
 .if defined(PROG_CXX)  .if defined(PROG_CXX)
 _CCLINK=        ${CXX}  PROG=           ${PROG_CXX}
 .else  _CCLINK=        ${CXX} ${_CCLINKFLAGS}
 _CCLINK=        ${CC}  
 .endif  .endif
   
 .if ${MKDEBUG} != "no" && ${OBJECT_FMT} == "ELF" && !commands(${PROG})  .if defined(RUMPPRG)
 _PROGDEBUG=     ${PROGNAME}.debug  PROG=                   ${RUMPPRG}
   .ifndef CRUNCHEDPROG
   PROGS=                  ${RUMPPRG} rump.${RUMPPRG}
   . if defined(SRCS)
   SRCS.rump.${PROG}:=     ${SRCS} ${PROG}_rumpops.c ${RUMPSRCS}
   SRCS+=                  ${PROG}_hostops.c
   . else
   SRCS=                   ${PROG}.c ${PROG}_hostops.c
   SRCS.rump.${PROG}=      ${PROG}.c ${PROG}_rumpops.c ${RUMPSRCS}
   . endif
   DPSRCS+=                ${PROG}_rumpops.c ${RUMPSRCS}
   LDADD.rump.${PROG}+=    -lrumpclient
   DPADD.rump.${PROG}+=    ${LIBRUMPCLIENT}
   MAN.rump.${PROG}=       # defined but feeling empty
   _RUMPINSTALL.rump.${PROG}=# defined
   .else # CRUNCHEDPROG
   PROGS=                  ${PROG}
   CPPFLAGS+=              -DCRUNCHOPS
   .endif
 .endif  .endif
   
 .gdbinit:  .if defined(PROG)
         rm -f .gdbinit  _CCLINK?=       ${CC} ${_CCLINKFLAGS}
 .if defined(DESTDIR) && !empty(DESTDIR)  .  if defined(MAN)
         echo "set solib-absolute-prefix ${DESTDIR}" > .gdbinit  MAN.${PROG}=    ${MAN}
 .else  _APPEND_MANS=   no
         touch .gdbinit  .  endif
   .  if !defined(OBJS)
   OBJS=           ${OBJS.${PROG}}
   .  endif
   .  if defined(PROGNAME)
   PROGNAME.${PROG}=       ${PROGNAME}
   .  endif
   .  if defined(SRCS)
   SRCS.${PROG}=   ${SRCS}
   _APPEND_SRCS=   no
   .  endif
   .endif
   
   # Turn the single-program PROG and PROG_CXX variables into their multi-word
   # counterparts, PROGS and PROGS_CXX.
   .if !defined(RUMPPRG)
   .  if defined(PROG_CXX) && !defined(PROGS_CXX)
   PROGS_CXX=      ${PROG_CXX}
   .  elif defined(PROG) && !defined(PROGS)
   PROGS=          ${PROG}
   .  endif
 .endif  .endif
 .for __gdbinit in ${GDBINIT}  
         echo "source ${__gdbinit}" >> .gdbinit  #
   # Per-program definitions and targets.
   #
   
   # Definitions specific to C programs.
   .for _P in ${PROGS}
   SRCS.${_P}?=    ${_P}.c
   _CCLINK.${_P}=  ${CC} ${_CCLINKFLAGS}
 .endfor  .endfor
   
 ${OBJS} ${LOBJS}: ${DPSRCS}  # Definitions specific to C++ programs.
   .for _P in ${PROGS_CXX}
   SRCS.${_P}?=    ${_P}.cc
   _CCLINK.${_P}=  ${CXX} ${_CCLINKFLAGS}
   .endfor
   
 ${PROG}: .gdbinit ${LIBCRT0} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}  # Language-independent definitions.
 .if !commands(${PROG})  .for _P in ${PROGS} ${PROGS_CXX}                                        # {
         ${_MKTARGET_LINK}  
 .if defined(DESTDIR)  BINDIR.${_P}?=          ${BINDIR}
         ${_CCLINK} -Wl,-nostdlib \  PROGNAME.${_P}?=        ${_P}
             ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${_PROGLDOPTS} \  
             -B${_GCC_CRTDIR}/ -B${DESTDIR}/usr/lib/  \  .if ${MKDEBUG} != "no" && !commands(${_P})
             ${OBJS} ${LDADD} \  _PROGDEBUG.${_P}:=      ${PROGNAME.${_P}}.debug
             -L${_GCC_LIBGCCDIR} -L${DESTDIR}/usr/lib  
 .else  
         ${_CCLINK} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${_PROGLDOPTS} ${OBJS} ${LDADD}  
 .endif  # defined(DESTDIR)  
 .if defined(PAXCTL_FLAGS.${PROG})  
         ${PAXCTL} ${PAXCTL_FLAGS.${PROG}} ${.TARGET}  
 .endif  .endif
 .endif  # !commands(${PROG})  
   
 ${PROG}.ro: ${OBJS} ${DPADD}  .if defined(PAXCTL_FLAGS)
         ${_MKTARGET_LINK}  PAXCTL_FLAGS.${_P}?= ${PAXCTL_FLAGS}
         ${LD} -r -dc -o ${.TARGET} ${OBJS}  .endif
   
 .if defined(_PROGDEBUG)  ##### PROG specific flags.
 ${_PROGDEBUG}: ${PROG}  
         ${_MKTARGET_CREATE}  _LDADD.${_P}=           ${LDADD}    ${LDADD.${_P}}
         ${OBJCOPY} --only-keep-debug ${PROG} ${_PROGDEBUG}  _LDFLAGS.${_P}=         ${LDFLAGS}  ${LDFLAGS.${_P}}
         ${OBJCOPY} -R .gnu_debuglink --add-gnu-debuglink=${_PROGDEBUG} ${PROG} \  _LDSTATIC.${_P}=        ${LDSTATIC} ${LDSTATIC.${_P}}
             || rm -f ${_PROGDEBUG}  
   ##### Build and install rules
   .if !empty(_APPEND_SRCS:M[Yy][Ee][Ss])
   SRCS+=          ${SRCS.${_P}} # For bsd.dep.mk
 .endif  .endif
   
 .endif  # defined(OBJS) && !empty(OBJS)                                 # }  _YPSRCS.${_P}=  ${SRCS.${_P}:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS.${_P}:M*.y:.y=.h}}
   
   DPSRCS+=                ${_YPSRCS.${_P}}
   CLEANFILES+=            ${_YPSRCS.${_P}}
   
 .if !defined(MAN)  .if !empty(SRCS.${_P}:N*.h:N*.sh:N*.fth)
 MAN=    ${PROG}.1  OBJS.${_P}+=    ${SRCS.${_P}:N*.h:N*.sh:N*.fth:R:S/$/.o/g}
 .endif  # !defined(MAN)  LOBJS.${_P}+=   ${LSRCS:.c=.ln} ${SRCS.${_P}:M*.c:.c=.ln}
 .endif  # defined(PROG)                                                 # }  .endif
   
 realall: ${PROG} ${_PROGDEBUG} ${SCRIPTS}  .if defined(OBJS.${_P}) && !empty(OBJS.${_P})                   # {
   .NOPATH: ${OBJS.${_P}} ${_P} ${_YPSRCS.${_P}}
   
 cleanprog: .PHONY cleanobjs cleanextra  ${OBJS.${_P}} ${LOBJS.${_P}}: ${DPSRCS}
         rm -f a.out [Ee]rrs mklog core *.core .gdbinit ${PROG} ${_PROGDEBUG}  
   
 cleanobjs: .PHONY  ${_P}: .gdbinit ${LIBCRT0} ${OBJS.${_P}} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
 .if defined(OBJS) && !empty(OBJS)  .if !commands(${_P})
         rm -f ${OBJS} ${LOBJS}          ${_MKTARGET_LINK}
           ${_CCLINK.${_P}} \
               ${_LDFLAGS.${_P}} ${_LDSTATIC.${_P}} -o ${.TARGET} \
               ${OBJS.${_P}} ${_LDADD.${_P}} \
               ${_PROGLDOPTS}
   .if defined(CTFMERGE)
           ${CTFMERGE} ${CTFMFLAGS} -o ${.TARGET} ${OBJS.${_P}}
   .endif
   .if defined(PAXCTL_FLAGS.${_P})
           ${PAXCTL} ${PAXCTL_FLAGS.${_P}} ${.TARGET}
 .endif  .endif
   .if ${MKSTRIPIDENT} != "no"
           ${OBJCOPY} -R .ident ${.TARGET}
   .endif
   .endif  # !commands(${_P})
   
 cleanextra: .PHONY  ${_P}.ro: ${OBJS.${_P}} ${DPADD}
 .if defined(CLEANFILES) && !empty(CLEANFILES)          ${_MKTARGET_LINK}
         rm -f ${CLEANFILES}          ${CC} ${LDFLAGS} -nostdlib -r -Wl,-dc -o ${.TARGET} ${OBJS.${_P}}
   
   .if defined(_PROGDEBUG.${_P})
   ${_PROGDEBUG.${_P}}: ${_P}
           ${_MKTARGET_CREATE}
           (  ${OBJCOPY} --only-keep-debug ${_P} ${_PROGDEBUG.${_P}} \
           && ${OBJCOPY} --strip-debug -p -R .gnu_debuglink \
                   --add-gnu-debuglink=${_PROGDEBUG.${_P}} ${_P} \
           ) || (rm -f ${_PROGDEBUG.${_P}}; false)
 .endif  .endif
   
 .if defined(PROG) && !target(proginstall)                               # {  .endif  # defined(OBJS.${_P}) && !empty(OBJS.${_P})                     # }
   
 proginstall::   ${DESTDIR}${BINDIR}/${PROGNAME} ${_PROGDEBUG:D${DESTDIR}${DEBUGDIR}${BINDIR}/${_PROGDEBUG}}  .if !defined(MAN.${_P})
 .PRECIOUS:      ${DESTDIR}${BINDIR}/${PROGNAME} ${_PROGDEBUG:D${DESTDIR}${DEBUGDIR}${BINDIR}/${_PROGDEBUG}}  MAN.${_P}=      ${_P}.1
   .endif  # !defined(MAN.${_P})
   .if !empty(_APPEND_MANS:M[Yy][Ee][Ss])
   MAN+=           ${MAN.${_P}}
   .endif
   
 __proginstall: .USE  realall: ${_P} ${_PROGDEBUG.${_P}}
         ${_MKTARGET_INSTALL}  
         ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \  
                 ${STRIPFLAG} ${.ALLSRC} ${.TARGET}  
   
 __progdebuginstall: .USE  cleanprog: cleanprog-${_P}
         ${_MKTARGET_INSTALL}  cleanprog-${_P}:
         ${INSTALL_FILE} -o ${DEBUGOWN} -g ${DEBUGGRP} -m ${DEBUGMODE} \          rm -f ${_P} ${_PROGDEBUG.${_P}}
                 ${.ALLSRC} ${.TARGET}  
   .if defined(OBJS.${_P}) && !empty(OBJS.${_P})
   cleanobjs: cleanobjs-${_P}
   cleanobjs-${_P}:
           rm -f ${OBJS.${_P}} ${LOBJS.${_P}}
   .endif
   
   _PROG_INSTALL+= proginstall-${_P}
   
   .if !target(proginstall-${_P})                                          # {
   proginstall-${_P}::     ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} \
                   ${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}}
   .PRECIOUS:      ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}} \
                   ${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}}
   
 .if ${MKUPDATE} == "no"  .if ${MKUPDATE} == "no"
 ${DESTDIR}${BINDIR}/${PROGNAME}! ${PROG} __proginstall  .if defined(_RUMPINSTALL.${_P})
 .if !defined(BUILD) && !make(all) && !make(${PROG})  ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! ${_P} __progrumpinstall
 ${DESTDIR}${BINDIR}/${PROGNAME}! .MADE  .else
 .endif  ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! ${_P} __proginstall
 .if defined(_PROGDEBUG)  
 ${DESTDIR}${DEBUGDIR}${BINDIR}/${_PROGDEBUG}! ${_PROGDEBUG} __progdebuginstall  
 .if !defined(BUILD) && !make(all) && !make(${PROG})  
 ${DESTDIR}${DEBUGDIR}${BINDIR}/${_PROGDEBUG}! .MADE  
 .endif  .endif
 .endif  #  define(_PROGDEBUG)  .if !defined(BUILD) && !make(all) && !make(${_P})
   ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! .MADE
   .endif
   .if defined(_PROGDEBUG.${_P})
   ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}! ${_PROGDEBUG.${_P}} __progdebuginstall
   .if !defined(BUILD) && !make(all) && !make(${_P})
   ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}! .MADE
   .endif
   .endif  #  define(_PROGDEBUG.${_P})
 .else   # MKUPDATE != no  .else   # MKUPDATE != no
 ${DESTDIR}${BINDIR}/${PROGNAME}: ${PROG} __proginstall  .if defined(_RUMPINSTALL.${_P})
 .if !defined(BUILD) && !make(all) && !make(${PROG})  ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __progrumpinstall
 ${DESTDIR}${BINDIR}/${PROGNAME}: .MADE  .else
 .endif  ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __proginstall
 .if defined(_PROGDEBUG)  .endif
 ${DESTDIR}${DEBUGDIR}${BINDIR}/${_PROGDEBUG}: ${_PROGDEBUG} __progdebuginstall  .if !defined(BUILD) && !make(all) && !make(${_P})
 .if !defined(BUILD) && !make(all) && !make(${PROG})  ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: .MADE
 ${DESTDIR}${DEBUGDIR}${BINDIR}/${_PROGDEBUG}: .MADE  .endif
   .if defined(_PROGDEBUG.${_P})
   ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}: ${_PROGDEBUG.${_P}} __progdebuginstall
   .if !defined(BUILD) && !make(all) && !make(${_P})
   ${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}: .MADE
 .endif  .endif
 .endif  #  defined(_PROGDEBUG)  .endif  #  defined(_PROGDEBUG.${_P})
 .endif  # MKUPDATE != no  .endif  # MKUPDATE != no
   
 .endif  # defined(PROG) && !target(proginstall)                         # }  .endif  # !target(proginstall-${_P})                                    # }
   
   lint: lint-${_P}
   lint-${_P}: ${LOBJS.${_P}}
   .if defined(LOBJS.${_P}) && !empty(LOBJS.${_P})
           ${LINT} ${LINTFLAGS} ${_LDFLAGS.${_P}:C/-L[  ]*/-L/Wg:M-L*} ${LOBJS.${_P}} ${_LDADD.${_P}}
   .endif
   
   .endfor # _P in ${PROGS} ${PROGS_CXX}                                   # }
   
   .if defined(OBJS) && !empty(OBJS) && \
       (empty(PROGS) && empty(PROGS_CXX))
   cleanobjs: cleanobjs-plain
   cleanobjs-plain:
           rm -f ${OBJS} ${LOBJS}
   .endif
   
 .if !target(proginstall)  .if !target(proginstall)
 proginstall::  proginstall:: ${_PROG_INSTALL}
 .endif  .endif
 .PHONY:         proginstall  .PHONY:         proginstall
   
   
   
   realall: ${SCRIPTS}
 .if defined(SCRIPTS) && !target(scriptsinstall)                         # {  .if defined(SCRIPTS) && !target(scriptsinstall)                         # {
 SCRIPTSDIR?=${BINDIR}  SCRIPTSDIR?=${BINDIR}
 SCRIPTSOWN?=${BINOWN}  SCRIPTSOWN?=${BINOWN}
Line 337  scriptsinstall::
Line 464  scriptsinstall::
 .endif  .endif
 .PHONY:         scriptsinstall  .PHONY:         scriptsinstall
   
 lint: ${LOBJS}  
 .if defined(LOBJS) && !empty(LOBJS)  
         ${LINT} ${LINTFLAGS} ${LDFLAGS:C/-L[  ]*/-L/Wg:M-L*} ${LOBJS} ${LDADD}  
 .endif  
   
 ##### Pull in related .mk logic  ##### Pull in related .mk logic
   LINKSOWN?= ${BINOWN}
   LINKSGRP?= ${BINGRP}
   LINKSMODE?= ${BINMODE}
 .include <bsd.man.mk>  .include <bsd.man.mk>
 .include <bsd.nls.mk>  .include <bsd.nls.mk>
 .include <bsd.files.mk>  .include <bsd.files.mk>
Line 350  lint: ${LOBJS}
Line 475  lint: ${LOBJS}
 .include <bsd.links.mk>  .include <bsd.links.mk>
 .include <bsd.sys.mk>  .include <bsd.sys.mk>
 .include <bsd.dep.mk>  .include <bsd.dep.mk>
   .include <bsd.clang-analyze.mk>
   
   cleanextra: .PHONY
   .if defined(CLEANFILES) && !empty(CLEANFILES)
           rm -f ${CLEANFILES}
   .endif
   
 ${TARGETS}:     # ensure existence  ${TARGETS}:     # ensure existence
   

Legend:
Removed from v.1.222  
changed lines
  Added in v.1.266

CVSweb <webmaster@jp.NetBSD.org>