[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.116 and 1.151

version 1.116, 2000/06/10 14:12:04 version 1.151, 2002/02/03 21:40:14
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 !target(__initialized__)  .include <bsd.init.mk>
 __initialized__:  
 .if exists(${.CURDIR}/../Makefile.inc)  
 .include "${.CURDIR}/../Makefile.inc"  
 .endif  
 .include <bsd.own.mk>  
 .include <bsd.obj.mk>  
 .include <bsd.depall.mk>  
 .MAIN:          all  
 .endif  
   
 .PHONY:         cleanprog proginstall scriptsinstall  ##### Basic targets
   .PHONY:         cleanextra cleanobjs cleanprog proginstall scriptsinstall
 realinstall:    proginstall scriptsinstall  realinstall:    proginstall scriptsinstall
 clean cleandir distclean: cleanprog  clean:          cleanprog
   
   ##### Default values
   CPPFLAGS+=      ${DESTDIR:D-nostdinc ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include}
   CXXFLAGS+=      ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include/g++}
 CFLAGS+=        ${COPTS}  CFLAGS+=        ${COPTS}
   
 # ELF platforms depend on crtbegin.o and crtend.o  # ELF platforms depend on crtbegin.o and crtend.o
 .if ${OBJECT_FMT} == "ELF"  .if ${OBJECT_FMT} == "ELF"
 LIBCRTBEGIN?=   ${DESTDIR}/usr/lib/crtbegin.o  LIBCRTBEGIN?=   ${DESTDIR}/usr/lib/crtbegin.o
   .NOSUFF: ${LIBCRTBEGIN}
 LIBCRTEND?=     ${DESTDIR}/usr/lib/crtend.o  LIBCRTEND?=     ${DESTDIR}/usr/lib/crtend.o
   .NOSUFF: ${LIBCRTEND}
   _SHLINKER=      ${SHLINKDIR}/ld.elf_so
 .else  .else
 LIBCRTBEGIN?=  LIBCRTBEGIN?=
 LIBCRTEND?=  LIBCRTEND?=
   _SHLINKER=      ${SHLINKDIR}/ld.so
 .endif  .endif
   
 LIBCRT0?=       ${DESTDIR}/usr/lib/crt0.o  LIBCRT0?=       ${DESTDIR}/usr/lib/crt0.o
   .NOSUFF: ${LIBCRT0}
   
 LIBBZ2?=        ${DESTDIR}/usr/lib/libbz2.a  LIBBZ2?=        ${DESTDIR}/usr/lib/libbz2.a
   .NOSUFF: ${LIBBZ2}
 LIBC?=          ${DESTDIR}/usr/lib/libc.a  LIBC?=          ${DESTDIR}/usr/lib/libc.a
   .NOSUFF: ${LIBC}
 LIBC_PIC?=      ${DESTDIR}/usr/lib/libc_pic.a  LIBC_PIC?=      ${DESTDIR}/usr/lib/libc_pic.a
   .NOSUFF: ${LIBC_PIC}
   LIBCDK?=        ${DESTDIR}/usr/lib/libcdk.a
   .NOSUFF: ${LIBCDK}
   LIBCOM_ERR?=    ${DESTDIR}/usr/lib/libcom_err.a
   .NOSUFF: ${LIBCOM_ERR}
 LIBCOMPAT?=     ${DESTDIR}/usr/lib/libcompat.a  LIBCOMPAT?=     ${DESTDIR}/usr/lib/libcompat.a
   .NOSUFF: ${LIBCOMPAT}
 LIBCRYPT?=      ${DESTDIR}/usr/lib/libcrypt.a  LIBCRYPT?=      ${DESTDIR}/usr/lib/libcrypt.a
   .NOSUFF: ${LIBCRYPT}
   LIBCRYPTO?=     ${DESTDIR}/usr/lib/libcrypto.a
   .NOSUFF: ${LIBCRYPTO}
   LIBCRYPTO_RC5?= ${DESTDIR}/usr/lib/libcrypto_rc5.a
   .NOSUFF: ${LIBCRYPTO_RC5}
   LIBCRYPTO_IDEA?=${DESTDIR}/usr/lib/libcrypto_idea.a
   .NOSUFF: ${LIBCRYPTO_IDEA}
 LIBCURSES?=     ${DESTDIR}/usr/lib/libcurses.a  LIBCURSES?=     ${DESTDIR}/usr/lib/libcurses.a
   .NOSUFF: ${LIBCURSES}
 LIBDBM?=        ${DESTDIR}/usr/lib/libdbm.a  LIBDBM?=        ${DESTDIR}/usr/lib/libdbm.a
   .NOSUFF: ${LIBDBM}
 LIBDES?=        ${DESTDIR}/usr/lib/libdes.a  LIBDES?=        ${DESTDIR}/usr/lib/libdes.a
   .NOSUFF: ${LIBDES}
 LIBEDIT?=       ${DESTDIR}/usr/lib/libedit.a  LIBEDIT?=       ${DESTDIR}/usr/lib/libedit.a
   .NOSUFF: ${LIBEDIT}
   LIBFORM?=       ${DESTDIR}/usr/lib/libform.a
   .NOSUFF: ${LIBFORM}
 LIBGCC?=        ${DESTDIR}/usr/lib/libgcc.a  LIBGCC?=        ${DESTDIR}/usr/lib/libgcc.a
   .NOSUFF: ${LIBGCC}
 LIBGNUMALLOC?=  ${DESTDIR}/usr/lib/libgnumalloc.a  LIBGNUMALLOC?=  ${DESTDIR}/usr/lib/libgnumalloc.a
   .NOSUFF: ${LIBGNUMALLOC}
   LIBGSSAPI?=     ${DESTDIR}/usr/lib/libgssapi.a
   .NOSUFF: ${LIBGSSAPI}
   LIBHDB?=        ${DESTDIR}/usr/lib/libhdb.a
   .NOSUFF: ${LIBHDB}
   LIBINTL?=       ${DESTDIR}/usr/lib/libintl.a
   .NOSUFF: ${LIBINTL}
 LIBIPSEC?=      ${DESTDIR}/usr/lib/libipsec.a  LIBIPSEC?=      ${DESTDIR}/usr/lib/libipsec.a
   .NOSUFF: ${LIBIPSEC}
   LIBKADM?=       ${DESTDIR}/usr/lib/libkadm.a
   .NOSUFF: ${LIBKADM}
   LIBKADM5CLNT?=  ${DESTDIR}/usr/lib/libkadm5clnt.a
   .NOSUFF: ${LIBKADM5CLNT}
   LIBKADM5SRV?=   ${DESTDIR}/usr/lib/libkadm5srv.a
   .NOSUFF: ${LIBKADM5SRV}
   LIBKAFS?=       ${DESTDIR}/usr/lib/libkafs.a
   .NOSUFF: ${LIBKAFS}
 LIBKDB?=        ${DESTDIR}/usr/lib/libkdb.a  LIBKDB?=        ${DESTDIR}/usr/lib/libkdb.a
   .NOSUFF: ${LIBKDB}
 LIBKRB?=        ${DESTDIR}/usr/lib/libkrb.a  LIBKRB?=        ${DESTDIR}/usr/lib/libkrb.a
   .NOSUFF: ${LIBKRB}
   LIBKRB5?=       ${DESTDIR}/usr/lib/libkrb5.a
   .NOSUFF: ${LIBKRB5}
   LIBKSTREAM?=    ${DESTDIR}/usr/lib/libkstream.a
   .NOSUFF: ${LIBKSTREAM}
 LIBKVM?=        ${DESTDIR}/usr/lib/libkvm.a  LIBKVM?=        ${DESTDIR}/usr/lib/libkvm.a
   .NOSUFF: ${LIBKVM}
 LIBL?=          ${DESTDIR}/usr/lib/libl.a  LIBL?=          ${DESTDIR}/usr/lib/libl.a
   .NOSUFF: ${LIBL}
 LIBM?=          ${DESTDIR}/usr/lib/libm.a  LIBM?=          ${DESTDIR}/usr/lib/libm.a
   .NOSUFF: ${LIBM}
 LIBMENU?=       ${DESTDIR}/usr/lib/libmenu.a  LIBMENU?=       ${DESTDIR}/usr/lib/libmenu.a
 LIBMP?=         ${DESTDIR}/usr/lib/libmp.a  .NOSUFF: ${LIBMENU}
 LIBNTP?=        ${DESTDIR}/usr/lib/libntp.a  
 LIBOBJC?=       ${DESTDIR}/usr/lib/libobjc.a  LIBOBJC?=       ${DESTDIR}/usr/lib/libobjc.a
 LIBPC?=         ${DESTDIR}/usr/lib/libpc.a  .NOSUFF: ${LIBOBJC}
   LIBOSSAUDIO?=   ${DESTDIR}/usr/lib/libossaudio.a
   .NOSUFF: ${LIBOSSAUDIO}
 LIBPCAP?=       ${DESTDIR}/usr/lib/libpcap.a  LIBPCAP?=       ${DESTDIR}/usr/lib/libpcap.a
 LIBPLOT?=       ${DESTDIR}/usr/lib/libplot.a  .NOSUFF: ${LIBPCAP}
   LIBPCI?=        ${DESTDIR}/usr/lib/libpci.a
   .NOSUFF: ${LIBPCI}
 LIBPOSIX?=      ${DESTDIR}/usr/lib/libposix.a  LIBPOSIX?=      ${DESTDIR}/usr/lib/libposix.a
   .NOSUFF: ${LIBPOSIX}
 LIBRESOLV?=     ${DESTDIR}/usr/lib/libresolv.a  LIBRESOLV?=     ${DESTDIR}/usr/lib/libresolv.a
   .NOSUFF: ${LIBRESOLV}
   LIBRMT?=        ${DESTDIR}/usr/lib/librmt.a
   .NOSUFF: ${LIBRMT}
   LIBROKEN?=      ${DESTDIR}/usr/lib/libroken.a
   .NOSUFF: ${LIBROKEN}
 LIBRPCSVC?=     ${DESTDIR}/usr/lib/librpcsvc.a  LIBRPCSVC?=     ${DESTDIR}/usr/lib/librpcsvc.a
   .NOSUFF: ${LIBRPCSVC}
 LIBSKEY?=       ${DESTDIR}/usr/lib/libskey.a  LIBSKEY?=       ${DESTDIR}/usr/lib/libskey.a
   .NOSUFF: ${LIBSKEY}
   LIBSS?=         ${DESTDIR}/usr/lib/libss.a
   .NOSUFF: ${LIBSS}
   LIBSSL?=        ${DESTDIR}/usr/lib/libssl.a
   .NOSUFF: ${LIBSSL}
   LIBSL?=         ${DESTDIR}/usr/lib/libsl.a
   .NOSUFF: ${LIBSL}
 LIBTERMCAP?=    ${DESTDIR}/usr/lib/libtermcap.a  LIBTERMCAP?=    ${DESTDIR}/usr/lib/libtermcap.a
   .NOSUFF: ${LIBTERMCAP}
 LIBTELNET?=     ${DESTDIR}/usr/lib/libtelnet.a  LIBTELNET?=     ${DESTDIR}/usr/lib/libtelnet.a
   .NOSUFF: ${LIBTELNET}
   LIBUSBHID?=     ${DESTDIR}/usr/lib/libusbhid.a
   .NOSUFF: ${LIBUSBHID}
 LIBUTIL?=       ${DESTDIR}/usr/lib/libutil.a  LIBUTIL?=       ${DESTDIR}/usr/lib/libutil.a
   .NOSUFF: ${LIBUTIL}
 LIBWRAP?=       ${DESTDIR}/usr/lib/libwrap.a  LIBWRAP?=       ${DESTDIR}/usr/lib/libwrap.a
   .NOSUFF: ${LIBWRAP}
 LIBY?=          ${DESTDIR}/usr/lib/liby.a  LIBY?=          ${DESTDIR}/usr/lib/liby.a
   .NOSUFF: ${LIBY}
 LIBZ?=          ${DESTDIR}/usr/lib/libz.a  LIBZ?=          ${DESTDIR}/usr/lib/libz.a
   .NOSUFF: ${LIBZ}
   
   ##### Build and install rules
 .if defined(SHAREDSTRINGS)  .if defined(SHAREDSTRINGS)
 CLEANFILES+=strings  CLEANFILES+=strings
 .c.o:  .c.o:
Line 84  CLEANFILES+=strings
Line 157  CLEANFILES+=strings
         @rm -f x.C          @rm -f x.C
 .endif  .endif
   
   .if defined(PROG_CXX)
   PROG=   ${PROG_CXX}
   .endif
   
 .if defined(PROG)  .if defined(PROG)
   .if defined(PROG_CXX)
   SRCS?=          ${PROG}.cc
   .else
 SRCS?=          ${PROG}.c  SRCS?=          ${PROG}.c
   
 DPSRCS+=        ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}  
 CLEANFILES+=    ${DPSRCS}  
 .if defined(YHEADER)  
 CLEANFILES+=    ${SRCS:M*.y:.y=.h}  
 .endif  .endif
   
   DPSRCS+=        ${SRCS:M*.[ly]:C/\..$/.c/}
   CLEANFILES+=    ${DPSRCS} ${YHEADER:D${SRCS:M*.y:.y=.h}}
   
 .if !empty(SRCS:N*.h:N*.sh:N*.fth)  .if !empty(SRCS:N*.h:N*.sh:N*.fth)
 OBJS+=          ${SRCS:N*.h:N*.sh:N*.fth:R:S/$/.o/g}  OBJS+=          ${SRCS:N*.h:N*.sh:N*.fth:R:S/$/.o/g}
 LOBJS+=         ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}  LOBJS+=         ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
 .endif  .endif
   
 .if defined(OBJS) && !empty(OBJS)  .if defined(OBJS) && !empty(OBJS)
 .NOPATH: ${OBJS}  .NOPATH: ${OBJS} ${PROG} ${SRCS:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS:M*.y:.y=.h}}
   
   _PROGLDOPTS=
   .if ${SHLINKDIR} != "/usr/libexec"      # XXX: change or remove if ld.so moves
   _PROGLDOPTS+=   -Wl,-dynamic-linker=${_SHLINKER}
   .endif
   .if ${SHLIBDIR} != ${LIBDIR}
   _PROGLDOPTS+=   -Wl,-rpath-link,${DESTDIR}${SHLIBDIR}:${DESTDIR}/usr/lib \
                   -Wl,-rpath,${SHLIBDIR}:/usr/lib \
                   -L${DESTDIR}${SHLIBDIR}
   .endif
   
   .if defined(PROG_CXX)
   _CCLINK=        ${CXX}
   _SUPCXX=        -lstdc++ -lm
   .else
   _CCLINK=        ${CC}
   .endif
   
 .if defined(DESTDIR)  .if defined(DESTDIR)
   
 ${PROG}: ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}  ${PROG}: ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
         ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib -L${DESTDIR}/usr/lib -Wl,-rpath-link,${DESTDIR}/usr/lib ${LIBCRT0} ${LIBCRTBEGIN} ${OBJS} ${LDADD} -lgcc -lc -lgcc ${LIBCRTEND}  .if !commands(${PROG})
           ${_CCLINK} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib ${_PROGLDOPTS} ${LIBCRT0} ${LIBCRTBEGIN} ${OBJS} ${LDADD} -L${DESTDIR}/usr/lib ${_SUPCXX} -lgcc -lc -lgcc ${LIBCRTEND}
   .endif
   
 .else  .else
   
 ${PROG}: ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}  ${PROG}: ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
         ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}  .if !commands(${PROG})
           ${_CCLINK} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${_PROGLDOPTS} ${OBJS} ${LDADD}
   .endif
   
 .endif  # defined(DESTDIR)  .endif  # defined(DESTDIR)
 .endif  # defined(OBJS) && !empty(OBJS)  .endif  # defined(OBJS) && !empty(OBJS)
Line 121  MAN= ${PROG}.1
Line 220  MAN= ${PROG}.1
   
 realall: ${PROG} ${SCRIPTS}  realall: ${PROG} ${SCRIPTS}
   
 cleanprog:  cleanprog: cleanobjs cleanextra
         rm -f a.out [Ee]rrs mklog core *.core \          rm -f a.out [Ee]rrs mklog core *.core ${PROG}
             ${PROG} ${OBJS} ${LOBJS} ${CLEANFILES}  
   cleanobjs:
   .if defined(OBJS) && !empty(OBJS)
           rm -f ${OBJS} ${LOBJS}
   .endif
   
   cleanextra:
   .if defined(CLEANFILES) && !empty(CLEANFILES)
           rm -f ${CLEANFILES}
   .endif
   
 .if defined(SRCS)  .if defined(SRCS) && !target(afterdepend)
 afterdepend: .depend  afterdepend: .depend
         @(TMP=/tmp/_depend$$$$; \          @(TMP=/tmp/_depend$$$$; \
             sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.ln:/' \              sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.ln:/' \
Line 143  proginstall:: ${DESTDIR}${BINDIR}/${PROG
Line 251  proginstall:: ${DESTDIR}${BINDIR}/${PROG
 .endif  .endif
   
 __proginstall: .USE  __proginstall: .USE
         ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${STRIPFLAG} ${INSTPRIV} \          ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
             -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} ${.ALLSRC} ${.TARGET}                  ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
   
 .if !defined(BUILD) && !make(all) && !make(${PROG})  .if !defined(BUILD) && !make(all) && !make(${PROG})
 ${DESTDIR}${BINDIR}/${PROGNAME}: .MADE  ${DESTDIR}${BINDIR}/${PROGNAME}: .MADE
Line 169  scriptsinstall:: ${SCRIPTS:@S@${DESTDIR}
Line 277  scriptsinstall:: ${SCRIPTS:@S@${DESTDIR}
 .endif  .endif
   
 __scriptinstall: .USE  __scriptinstall: .USE
         ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} \          ${INSTALL_FILE} \
             -o ${SCRIPTSOWN_${.ALLSRC:T}:U${SCRIPTSOWN}} \              -o ${SCRIPTSOWN_${.ALLSRC:T}:U${SCRIPTSOWN}} \
             -g ${SCRIPTSGRP_${.ALLSRC:T}:U${SCRIPTSGRP}} \              -g ${SCRIPTSGRP_${.ALLSRC:T}:U${SCRIPTSGRP}} \
             -m ${SCRIPTSMODE_${.ALLSRC:T}:U${SCRIPTSMODE}} \              -m ${SCRIPTSMODE_${.ALLSRC:T}:U${SCRIPTSMODE}} \
             ${.ALLSRC} ${.TARGET}              ${.ALLSRC} ${.TARGET}
   
 .for S in ${SCRIPTS}  .for S in ${SCRIPTS:O:u}
 .if !defined(BUILD) && !make(all) && !make(${S})  .if !defined(BUILD) && !make(all) && !make(${S})
 ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: .MADE  ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: .MADE
 .endif  .endif
Line 192  lint: ${LOBJS}
Line 300  lint: ${LOBJS}
         ${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD}          ${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD}
 .endif  .endif
   
   ##### Pull in related .mk logic
 .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 200  lint: ${LOBJS}
Line 309  lint: ${LOBJS}
 .include <bsd.dep.mk>  .include <bsd.dep.mk>
 .include <bsd.sys.mk>  .include <bsd.sys.mk>
   
 # Make sure all of the standard targets are defined, even if they do nothing.  ${TARGETS}:     # ensure existence
 regress:  

Legend:
Removed from v.1.116  
changed lines
  Added in v.1.151

CVSweb <webmaster@jp.NetBSD.org>