[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.72 and 1.266

version 1.72, 1997/05/06 21:29:44 version 1.266, 2011/08/27 18:35:20
Line 1 
Line 1 
 #       $NetBSD$  #       $NetBSD$
 #       @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94  #       @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
   
 .if exists(${.CURDIR}/../Makefile.inc)  .ifndef HOSTPROG
 .include "${.CURDIR}/../Makefile.inc"  
 .endif  
   
 .MAIN:          all  
 .PHONY:         cleanprog afterdepend beforeinstall proginstall afterinstall  
   
 .include <bsd.own.mk>  
   
 .SUFFIXES: .out .o .c .cc .C .y .l .s .8 .7 .6 .5 .4 .3 .2 .1 .0  
   
 CFLAGS+=        ${COPTS}  
   
 # ELF platforms depend on crtbegin.o and crtend.o  .include <bsd.init.mk>
 .if (${MACHINE_ARCH} == "alpha")   || \  .include <bsd.shlib.mk>
     (${MACHINE_ARCH} == "powerpc")  .include <bsd.gcc.mk>
 LIBCRTBEGIN?=   ${DESTDIR}/usr/lib/crtbegin.o  
 LIBCRTEND?=     ${DESTDIR}/usr/lib/crtend.o  #
   # Definitions and targets shared among all programs built by a single
   # Makefile.
   #
   
   ##### Basic targets
   realinstall:    proginstall scriptsinstall
   clean:          cleanprog
   
   .gdbinit:
           rm -f .gdbinit
   .if defined(DESTDIR) && !empty(DESTDIR)
           echo "set solib-absolute-prefix ${DESTDIR}" > .gdbinit
 .else  .else
 LIBCRTBEGIN?=          touch .gdbinit
 LIBCRTEND?=  
 .endif  .endif
   .for __gdbinit in ${GDBINIT}
           echo "source ${__gdbinit}" >> .gdbinit
   .endfor
   
   cleanobjs: .PHONY
   
 LIBCRT0?=       ${DESTDIR}/usr/lib/crt0.o  cleanprog: .PHONY cleanobjs cleanextra
 LIBC?=          ${DESTDIR}/usr/lib/libc.a          rm -f a.out [Ee]rrs mklog core *.core .gdbinit
 LIBC_PIC?=      ${DESTDIR}/usr/lib/libc_pic.a  
 LIBCOMPAT?=     ${DESTDIR}/usr/lib/libcompat.a  
 LIBCRYPT?=      ${DESTDIR}/usr/lib/libcrypt.a  
 LIBCURSES?=     ${DESTDIR}/usr/lib/libcurses.a  
 LIBDBM?=        ${DESTDIR}/usr/lib/libdbm.a  
 LIBDES?=        ${DESTDIR}/usr/lib/libdes.a  
 LIBEDIT?=       ${DESTDIR}/usr/lib/libedit.a  
 LIBGCC?=        ${DESTDIR}/usr/lib/libgcc.a  
 LIBGNUMALLOC?=  ${DESTDIR}/usr/lib/libgnumalloc.a  
 LIBKDB?=        ${DESTDIR}/usr/lib/libkdb.a  
 LIBKRB?=        ${DESTDIR}/usr/lib/libkrb.a  
 LIBKVM?=        ${DESTDIR}/usr/lib/libkvm.a  
 LIBL?=          ${DESTDIR}/usr/lib/libl.a  
 LIBM?=          ${DESTDIR}/usr/lib/libm.a  
 LIBMP?=         ${DESTDIR}/usr/lib/libmp.a  
 LIBNTP?=        ${DESTDIR}/usr/lib/libntp.a  
 LIBPC?=         ${DESTDIR}/usr/lib/libpc.a  
 LIBPCAP?=       ${DESTDIR}/usr/lib/libpcap.a  
 LIBPLOT?=       ${DESTDIR}/usr/lib/libplot.a  
 LIBRESOLV?=     ${DESTDIR}/usr/lib/libresolv.a  
 LIBRPCSVC?=     ${DESTDIR}/usr/lib/librpcsvc.a  
 LIBSKEY?=       ${DESTDIR}/usr/lib/libskey.a  
 LIBTERMCAP?=    ${DESTDIR}/usr/lib/libtermcap.a  
 LIBTELNET?=     ${DESTDIR}/usr/lib/libtelnet.a  
 LIBUTIL?=       ${DESTDIR}/usr/lib/libutil.a  
 LIBWRAP?=       ${DESTDIR}/usr/lib/libwrap.a  
 LIBY?=          ${DESTDIR}/usr/lib/liby.a  
 LIBZ?=          ${DESTDIR}/usr/lib/libz.a  
   
 .if defined(SHAREDSTRINGS)  .if defined(SHAREDSTRINGS)
 CLEANFILES+=strings  CLEANFILES+=strings
 .c.o:  .c.o:
         ${CC} -E ${CFLAGS} ${.IMPSRC} | xstr -c -          ${CC} -E ${CPPFLAGS} ${CFLAGS} ${.IMPSRC} | xstr -c -
         @${CC} ${CFLAGS} -c x.c -o ${.TARGET}          @${CC} ${CPPFLAGS} ${CFLAGS} -c x.c -o ${.TARGET}
         @rm -f x.c          @rm -f x.c
   
 .cc.o:  .cc.o .cpp.o .cxx.o .C.o:
         ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -          ${CXX} -E ${CPPFLAGS} ${CXXFLAGS} ${.IMPSRC} | xstr -c -
         @mv -f x.c x.cc          @mv -f x.c x.cc
         @${CXX} ${CXXFLAGS} -c x.cc -o ${.TARGET}          @${CXX} ${CPPFLAGS} ${CXXFLAGS} -c x.cc -o ${.TARGET}
         @rm -f x.cc          @rm -f x.cc
   .endif
   
 .C.o:  .if defined(MKPIE) && (${MKPIE} != "no")
         ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -  CFLAGS+=        ${PIE_CFLAGS}
         @mv -f x.c x.C  AFLAGS+=        ${PIE_AFLAGS}
         @${CXX} ${CXXFLAGS} -c x.C -o ${.TARGET}  LDFLAGS+=       ${PIE_LDFLAGS}
         @rm -f x.C  
 .endif  .endif
   
   CFLAGS+=        ${COPTS}
   OBJCFLAGS+=     ${OBJCOPTS}
   MKDEP_SUFFIXES?=        .o .ln
   
 .if defined(PROG)  # CTF preserve debug symbols
 SRCS?=  ${PROG}.c  .if defined(MKDTRACE) && (${MKDTRACE} != "no") && (${CFLAGS:M-g} != "")
 .if !empty(SRCS:N*.h:N*.sh)  CTFFLAGS+= -g
 OBJS+=  ${SRCS:N*.h:N*.sh:R:S/$/.o/g}  CTFMFLAGS+= -g
 LOBJS+= ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}  .endif
   
   # ELF platforms depend on crti.o, crtbegin.o, crtend.o, and crtn.o
   .ifndef LIBCRTBEGIN
   LIBCRTBEGIN=    ${DESTDIR}/usr/lib/crti.o ${_GCC_CRTBEGIN}
   .MADE: ${LIBCRTBEGIN}
   .endif
   .ifndef LIBCRTEND
   LIBCRTEND=      ${_GCC_CRTEND} ${DESTDIR}/usr/lib/crtn.o
   .MADE: ${LIBCRTEND}
   .endif
   _SHLINKER=      ${SHLINKDIR}/ld.elf_so
   
   .ifndef LIBCRT0
   LIBCRT0=        ${DESTDIR}/usr/lib/crt0.o
   .MADE: ${LIBCRT0}
   .endif
   
   ##### Installed system library definitions
   #
   #       E.g.
   #               LIBC?=${DESTDIR}/usr/lib/libc.a
   #               LIBX11?=${DESTDIR}/usr/X11R7/lib/libX11.a
   #       etc..
   
   .for _lib in \
           archive asn1 bluetooth bsdmalloc bz2 c c_pic cdk com_err compat \
           crypt crypto crypto_idea crypto_mdc2 crypto_rc5 \
           curses dbm des edit event \
           fetch form fl g2c gcc gnumalloc gssapi hdb heimbase heimntlm hx509 \
           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 \
           puffs radius resolv rmt roken rpcsvc rt rump rumpuser saslc skey sl ss \
           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}
   LIB${_lib:tu}=  ${DESTDIR}/usr/lib/lib${_lib}.a
   .MADE:          ${LIB${_lib:tu}}        # Note: ${DESTDIR} will be expanded
   .endif
   .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
   .if (${MKPIC} == "no")
   .if (${MKCRYPTO} != "no")
   PAM_STATIC_LDADD+= -lssh
   PAM_STATIC_DPADD+= ${LIBSSH}
   .endif
   .if (${MKKERBEROS} != "no")
   PAM_STATIC_LDADD+= -lkafs -lkrb5 -lhx509 -lwind -lasn1 \
           -lroken -lcom_err -lheimbase -lcrypto
   PAM_STATIC_DPADD+= ${LIBKAFS} ${LIBKRB5} ${LIBHX509} ${LIBWIND} ${LIBASN1} \
           ${LIBROKEN} ${LIBCOM_ERR} ${LIBHEIMBASE} ${LIBCRYPTO}
   .endif
   .if (${MKSKEY} != "no")
   PAM_STATIC_LDADD+= -lskey
   PAM_STATIC_DPADD+= ${LIBSKEY}
   .endif
   PAM_STATIC_LDADD+= -lradius -lcrypt -lrpcsvc -lutil
   PAM_STATIC_DPADD+= ${LIBRADIUS} ${LIBCRYPT} ${LIBRPCSVC} ${LIBUTIL}
   .else
   PAM_STATIC_LDADD=
   PAM_STATIC_DPADD=
 .endif  .endif
   
 .if defined(OBJS) && !empty(OBJS)  # These need + -> X transformations
 .if defined(DESTDIR)  .ifndef LIBSTDCXX
   LIBSTDCXX=      ${DESTDIR}/usr/lib/libstdc++.a
   .MADE:          ${LIBSTDCXX}
   .endif
   
 ${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}  .ifndef LIBSUPCXX
         ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib -L${DESTDIR}/usr/lib ${LIBCRT0} ${LIBCRTBEGIN} ${OBJS} ${LDADD} -lgcc -lc -lgcc ${LIBCRTEND}  LIBSUPCXX=      ${DESTDIR}/usr/lib/libsupc++.a
   .MADE:          ${LIBSUPCXX}
   .endif
   
 .else  .for _lib in \
           dps expat fntstubs fontcache fontconfig fontenc freetype FS \
           GL GLU ICE lbxutil SM X11 Xau Xaw Xdmcp Xext Xfont Xft \
           Xi Xinerama xkbfile Xmu Xmuu Xpm Xrandr Xrender Xss Xt \
           XTrap Xtst Xv Xxf86dga Xxf86misc Xxf86vm
   .ifndef LIB${_lib:tu}
   LIB${_lib:tu}=  ${DESTDIR}${X11USRLIBDIR}/lib${_lib}.a
   .MADE:          ${LIB${_lib:tu}}        # Note: ${DESTDIR} will be expanded
   .endif
   .endfor
   
 ${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}  .if defined(RESCUEDIR)
         ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}  CPPFLAGS+=      -DRESCUEDIR=\"${RESCUEDIR}\"
   .endif
   
 .endif  # defined(DESTDIR)  _PROGLDOPTS=
 .endif  # defined(OBJS) && !empty(OBJS)  .if ${SHLINKDIR} != "/usr/libexec"      # XXX: change or remove if ld.so moves
   _PROGLDOPTS+=   -Wl,-dynamic-linker=${_SHLINKER}
   .endif
   .if ${SHLIBDIR} != "/usr/lib"
   _PROGLDOPTS+=   -Wl,-rpath,${SHLIBDIR} \
                   -L=${SHLIBDIR}
   .elif ${SHLIBINSTALLDIR} != "/usr/lib"
   _PROGLDOPTS+=   -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR} \
                   -L=${SHLIBINSTALLDIR}
   .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)
   PROG=           ${PROG_CXX}
   _CCLINK=        ${CXX} ${_CCLINKFLAGS}
   .endif
   
   .if defined(RUMPPRG)
   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
   
 .if     !defined(MAN)  .if defined(PROG)
 MAN=    ${PROG}.1  _CCLINK?=       ${CC} ${_CCLINKFLAGS}
 .endif  # !defined(MAN)  .  if defined(MAN)
 .endif  # defined(PROG)  MAN.${PROG}=    ${MAN}
   _APPEND_MANS=   no
 all: ${PROG} _SUBDIRUSE  .  endif
   .  if !defined(OBJS)
 .if !target(clean)  OBJS=           ${OBJS.${PROG}}
 cleanprog:  .  endif
         rm -f a.out [Ee]rrs mklog core *.core \  .  if defined(PROGNAME)
             ${PROG} ${OBJS} ${LOBJS} ${CLEANFILES}  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
   
   #
   # Per-program definitions and targets.
   #
   
   # Definitions specific to C programs.
   .for _P in ${PROGS}
   SRCS.${_P}?=    ${_P}.c
   _CCLINK.${_P}=  ${CC} ${_CCLINKFLAGS}
   .endfor
   
 clean: _SUBDIRUSE cleanprog  # Definitions specific to C++ programs.
 cleandir: _SUBDIRUSE cleanprog  .for _P in ${PROGS_CXX}
 .else  SRCS.${_P}?=    ${_P}.cc
 cleandir: _SUBDIRUSE clean  _CCLINK.${_P}=  ${CXX} ${_CCLINKFLAGS}
   .endfor
   
   # Language-independent definitions.
   .for _P in ${PROGS} ${PROGS_CXX}                                        # {
   
   BINDIR.${_P}?=          ${BINDIR}
   PROGNAME.${_P}?=        ${_P}
   
   .if ${MKDEBUG} != "no" && !commands(${_P})
   _PROGDEBUG.${_P}:=      ${PROGNAME.${_P}}.debug
 .endif  .endif
   
 .if defined(SRCS)  .if defined(PAXCTL_FLAGS)
 afterdepend: .depend  PAXCTL_FLAGS.${_P}?= ${PAXCTL_FLAGS}
         @(TMP=/tmp/_depend$$$$; \  
             sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.ln:/' \  
               < .depend > $$TMP; \  
             mv $$TMP .depend)  
 .endif  .endif
   
 .if !target(install)  ##### PROG specific flags.
 .if !target(beforeinstall)  
 beforeinstall:  _LDADD.${_P}=           ${LDADD}    ${LDADD.${_P}}
   _LDFLAGS.${_P}=         ${LDFLAGS}  ${LDFLAGS.${_P}}
   _LDSTATIC.${_P}=        ${LDSTATIC} ${LDSTATIC.${_P}}
   
   ##### Build and install rules
   .if !empty(_APPEND_SRCS:M[Yy][Ee][Ss])
   SRCS+=          ${SRCS.${_P}} # For bsd.dep.mk
 .endif  .endif
 .if !target(afterinstall)  
 afterinstall:  _YPSRCS.${_P}=  ${SRCS.${_P}:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS.${_P}:M*.y:.y=.h}}
   
   DPSRCS+=                ${_YPSRCS.${_P}}
   CLEANFILES+=            ${_YPSRCS.${_P}}
   
   .if !empty(SRCS.${_P}:N*.h:N*.sh:N*.fth)
   OBJS.${_P}+=    ${SRCS.${_P}:N*.h:N*.sh:N*.fth:R:S/$/.o/g}
   LOBJS.${_P}+=   ${LSRCS:.c=.ln} ${SRCS.${_P}:M*.c:.c=.ln}
 .endif  .endif
   
 .if !target(realinstall)  .if defined(OBJS.${_P}) && !empty(OBJS.${_P})                   # {
   .NOPATH: ${OBJS.${_P}} ${_P} ${_YPSRCS.${_P}}
   
 .if defined(PROG)  ${OBJS.${_P}} ${LOBJS.${_P}}: ${DPSRCS}
 PROGNAME?= ${PROG}  
 proginstall:: ${DESTDIR}${BINDIR}/${PROGNAME}  ${_P}: .gdbinit ${LIBCRT0} ${OBJS.${_P}} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
 .if !defined(UPDATE)  .if !commands(${_P})
 .PHONY: ${DESTDIR}${BINDIR}/${PROGNAME}          ${_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  .endif
 .if !defined(BUILD)  .if defined(PAXCTL_FLAGS.${_P})
 ${DESTDIR}${BINDIR}/${PROGNAME}: .MADE          ${PAXCTL} ${PAXCTL_FLAGS.${_P}} ${.TARGET}
 .endif  .endif
   .if ${MKSTRIPIDENT} != "no"
 .PRECIOUS: ${DESTDIR}${BINDIR}/${PROGNAME}          ${OBJCOPY} -R .ident ${.TARGET}
 ${DESTDIR}${BINDIR}/${PROGNAME}: ${PROG}  
         ${INSTALL} ${COPY} ${STRIPFLAG} -o ${BINOWN} -g ${BINGRP} \  
             -m ${BINMODE} ${.ALLSRC} ${.TARGET}  
 .endif  .endif
   .endif  # !commands(${_P})
   
 .if defined(SCRIPTS)  ${_P}.ro: ${OBJS.${_P}} ${DPADD}
 SCRIPTSDIR?=${BINDIR}          ${_MKTARGET_LINK}
 SCRIPTSOWN?=${BINOWN}          ${CC} ${LDFLAGS} -nostdlib -r -Wl,-dc -o ${.TARGET} ${OBJS.${_P}}
 SCRIPTSGRP?=${BINGRP}  
 SCRIPTSMODE?=${BINMODE}  .if defined(_PROGDEBUG.${_P})
 .for S in ${SCRIPTS}  ${_PROGDEBUG.${_P}}: ${_P}
 SCRIPTSDIR_${S}?=${SCRIPTSDIR}          ${_MKTARGET_CREATE}
 SCRIPTSOWN_${S}?=${SCRIPTSOWN}          (  ${OBJCOPY} --only-keep-debug ${_P} ${_PROGDEBUG.${_P}} \
 SCRIPTSGRP_${S}?=${SCRIPTSGRP}          && ${OBJCOPY} --strip-debug -p -R .gnu_debuglink \
 SCRIPTSMODE_${S}?=${SCRIPTSMODE}                  --add-gnu-debuglink=${_PROGDEBUG.${_P}} ${_P} \
 .if defined(SCRIPTSNAME)          ) || (rm -f ${_PROGDEBUG.${_P}}; false)
 SCRIPTSNAME_${S} ?= ${SCRIPTSNAME}  
 .else  
 SCRIPTSNAME_${S} ?= ${S:T:R}  
 .endif  
 SCRIPTSDIR_${S} ?= ${SCRIPTSDIR}  
 proginstall:: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}  
 .if !defined(UPDATE)  
 .PHONY: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}  
 .endif  .endif
 .if !defined(BUILD)  
 ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}: .MADE  .endif  # defined(OBJS.${_P}) && !empty(OBJS.${_P})                     # }
   
   .if !defined(MAN.${_P})
   MAN.${_P}=      ${_P}.1
   .endif  # !defined(MAN.${_P})
   .if !empty(_APPEND_MANS:M[Yy][Ee][Ss])
   MAN+=           ${MAN.${_P}}
 .endif  .endif
   
 .PRECIOUS: ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}  realall: ${_P} ${_PROGDEBUG.${_P}}
 ${DESTDIR}${SCRIPTSDIR_${S}}/${SCRIPTSNAME_${S}}: ${S}  
         ${INSTALL} ${COPY} -o ${SCRIPTSOWN_${S}} -g ${SCRIPTSGRP_${S}} \  cleanprog: cleanprog-${_P}
                 -m ${SCRIPTSMODE_${S}} ${.ALLSRC} ${.TARGET}  cleanprog-${_P}:
 .endfor          rm -f ${_P} ${_PROGDEBUG.${_P}}
   
   .if defined(OBJS.${_P}) && !empty(OBJS.${_P})
   cleanobjs: cleanobjs-${_P}
   cleanobjs-${_P}:
           rm -f ${OBJS.${_P}} ${LOBJS.${_P}}
 .endif  .endif
   
 .if target(proginstall)  _PROG_INSTALL+= proginstall-${_P}
 realinstall: proginstall filesinstall  
   .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 defined(_RUMPINSTALL.${_P})
   ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! ${_P} __progrumpinstall
 .else  .else
 realinstall: filesinstall  ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! ${_P} __proginstall
 .endif  .endif
   .if !defined(BUILD) && !make(all) && !make(${_P})
   ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! .MADE
 .endif  .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
   .if defined(_RUMPINSTALL.${_P})
   ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __progrumpinstall
   .else
   ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __proginstall
   .endif
   .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  #  defined(_PROGDEBUG.${_P})
   .endif  # MKUPDATE != no
   
 install: ${MANINSTALL} _SUBDIRUSE linksinstall  .endif  # !target(proginstall-${_P})                                    # }
   
 ${MANINSTALL}: afterinstall  lint: lint-${_P}
 afterinstall: realinstall  lint-${_P}: ${LOBJS.${_P}}
 realinstall: beforeinstall  .if defined(LOBJS.${_P}) && !empty(LOBJS.${_P})
           ${LINT} ${LINTFLAGS} ${_LDFLAGS.${_P}:C/-L[  ]*/-L/Wg:M-L*} ${LOBJS.${_P}} ${_LDADD.${_P}}
 .endif  .endif
   
 .if !target(lint)  .endfor # _P in ${PROGS} ${PROGS_CXX}                                   # }
 lint: ${LOBJS}  
 .if defined(LOBJS) && !empty(LOBJS)  .if defined(OBJS) && !empty(OBJS) && \
         @${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD}      (empty(PROGS) && empty(PROGS_CXX))
   cleanobjs: cleanobjs-plain
   cleanobjs-plain:
           rm -f ${OBJS} ${LOBJS}
 .endif  .endif
   
   .if !target(proginstall)
   proginstall:: ${_PROG_INSTALL}
 .endif  .endif
   .PHONY:         proginstall
   
 .if !defined(NOMAN)  
 .include <bsd.man.mk>  
   realall: ${SCRIPTS}
   .if defined(SCRIPTS) && !target(scriptsinstall)                         # {
   SCRIPTSDIR?=${BINDIR}
   SCRIPTSOWN?=${BINOWN}
   SCRIPTSGRP?=${BINGRP}
   SCRIPTSMODE?=${BINMODE}
   
   scriptsinstall:: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
   .PRECIOUS: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
   
   __scriptinstall: .USE
           ${_MKTARGET_INSTALL}
           ${INSTALL_FILE} \
               -o ${SCRIPTSOWN_${.ALLSRC:T}:U${SCRIPTSOWN}} \
               -g ${SCRIPTSGRP_${.ALLSRC:T}:U${SCRIPTSGRP}} \
               -m ${SCRIPTSMODE_${.ALLSRC:T}:U${SCRIPTSMODE}} \
               ${.ALLSRC} ${.TARGET}
   
   .for S in ${SCRIPTS:O:u}
   .if ${MKUPDATE} == "no"
   ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}! ${S} __scriptinstall
   .if !defined(BUILD) && !make(all) && !make(${S})
   ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}! .MADE
 .endif  .endif
   .else
   ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: ${S} __scriptinstall
   .if !defined(BUILD) && !make(all) && !make(${S})
   ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: .MADE
   .endif
   .endif
   .endfor
   .endif                                                                  # }
   
 .if !defined(NONLS)  .if !target(scriptsinstall)
 .include <bsd.nls.mk>  scriptsinstall::
 .endif  .endif
   .PHONY:         scriptsinstall
   
 .include <bsd.obj.mk>  ##### Pull in related .mk logic
 .include <bsd.links.mk>  LINKSOWN?= ${BINOWN}
   LINKSGRP?= ${BINGRP}
   LINKSMODE?= ${BINMODE}
   .include <bsd.man.mk>
   .include <bsd.nls.mk>
 .include <bsd.files.mk>  .include <bsd.files.mk>
 .include <bsd.inc.mk>  .include <bsd.inc.mk>
 .include <bsd.dep.mk>  .include <bsd.links.mk>
 .include <bsd.subdir.mk>  
 .include <bsd.sys.mk>  .include <bsd.sys.mk>
   .include <bsd.dep.mk>
   .include <bsd.clang-analyze.mk>
   
   cleanextra: .PHONY
   .if defined(CLEANFILES) && !empty(CLEANFILES)
           rm -f ${CLEANFILES}
   .endif
   
   ${TARGETS}:     # ensure existence
   
   .endif  # HOSTPROG

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

CVSweb <webmaster@jp.NetBSD.org>